binary arithmetic

hello all is there any simple circuit that can perform the all basic binary arithmetic operations (multiplication, division, subtraction, addition)? thank you all

Reply to
jhon1
Loading thread data ...

"jhon1" schreef in bericht news: snipped-for-privacy@a34g2000cwb.googlegroups.com...

As for addition and subtraction (and a lot of other things) the ALU = Arithmetic and Logical Unit is used. But there is no simpel circuit for multiplicaton and divison as this are not simple operations.

petrus bitbyter

Reply to
petrus bitbyter

Everything in the world starts with a' half adder'........

Reply to
martin.shoebridge

A circuit with a microprocessor in the middle. That's as simple as you can get based on parts count (the uP being one part).

--
Paul Hovnanian     mailto:Paul@Hovnanian.com
------------------------------------------------------------------
The Three Laws of Thermodynamics:
 1) You can\'t win.
 2) You can\'t break even.
 3) You can\'t quit the game.
Reply to
Paul Hovnanian P.E.

You can build absolutely anything using the two elements:-

A 2 input nand and a D-type FF.

Reply to
Icky Thwacket

So how do you make a D type FF ? :) 2 I/p nands of course.

Reply to
martin.shoebridge

Not quite. It takes at least one 3-input nand... more if you want a set/reset function as well.

...Jim Thompson

-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | |

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply to
Jim Thompson

So you can't make a 3 i/p nand from a selection of 2 i/p nands then? More homework for you I think.... logically correct, pointless in practice, unless you are at college...........

Reply to
martin.shoebridge

Of course you can... but hardly minimal. And, in the real world, would aggravate metastability.

Homework for ME? Hardly. I'm got out of The Institute 44 years ago ;-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

Depends on what you call 'simple'. If you want to do these operations on four-bit binary numbers, you could put a lookup table in ROM that takes

4 bits of operand 1 4 bits of operand 2 2 bits of identify-the-operation code and outputs up to eight bits (enough for multiply to not overflow) You'll have to decide how to treat negative results in subtraction. Division can yield four bits of result and four more of remainder

and the whole thing is a single ROM of 1024 bytes (this is VERY small chip, really just a fraction of a current sizes). So, if less than one IC counts as simple, this is simple.

But, such a ROM has thousands of transistors; if you want to minimize transistor count, consider that a modest op amp only needs a dozen transistors, and that a transistor yields a current that is proportional to the exponential of a voltage; you can do logarithms with ease, and exponentials, and simple resistor connections accomplish sums (and negations are two-resistors-and-an-amplifier). Up to 8 digits accuracy and maybe 1MHz bandwidth, you can do all those operations on voltage-analog-to-pure-number signals with maybe 150 transistors.

Reply to
whit3rd

In article , snipped-for-privacy@gmail.com (known to some as jhon1) scribed...

Yes. It's called a 'Pocket Calculator.'

Happy figuring.

--
Dr. Anton T. Squeegee, Director, Dutch Surrealist Plumbing Institute
(Known to some as Bruce Lane, KC7GR)
http://www.bluefeathertech.com -- kyrrin a/t bluefeathertech d-o=t calm
"Salvadore Dali\'s computer has surreal ports..."
Reply to
Dr. Anton T. Squeegee

Now there's a response as bad as this: Q: How do I erase an EPROM? A: Use a hammer.. :)

D from BC

Reply to
D from BC

Depends on what else you've got in the circuit. Analog or digital, what resolution/ accuracy (or word size), how fast, what size operands, etc. etc. If you want it fast and flexible, but not particularly easy or cheap, use an FPGA.

Paul Burke

Reply to
Paul Burke

You can use a PROM. The address lines are the two data values and the operation selection.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Brilliant!

So for 32 bit data, 8 functions and 64 bit results we need a ........ errr ummmmmmm

32 + 32 + 8 address lines and 64 data lines

ooooooooh thats a 72 bit address or approx 4 x 10^21 64 bit words ...... yep thats 32 zetta bytes !

..... don't think the technologies quite up to it yet chum!

Reply to
Icky Thwacket

So, just do it a nybble at a time. For two four-bit words, you've got 8 bits for A and B, and two bits for "function", and 8 bits of output.

1024 X 8 should be easy to roust up. ;-)

Carry out might be a little tricky, but for add and sub, it's just the low bit of the high nybble. I don't even want to think about doing a practical multiply or divide, so that'd be best reserved for "demo". :-)

Cheers! Rich

Reply to
Rich Grise

So for 4 bit data, 8 functions and 16 bit answers we need ....

The OP didn't say how many bits were needed, now did he

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

If you can go nibble at a time, why not a bit at a time. The multiply isn't all that awful if you can use enough clock cycles. You may want to use two PROMs to make it easier to design. One can determine the sequencing and the other and do the actual math. What you end up making is sort of a limited processor.

If you don't need exact values you could use a table based log() approximation.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

See

formatting link
: Books
formatting link

Understanding Digital Computers Year: 1978 Author: Forest M Mims Publisher: Radio Shack Type: PDF Pages: 162 Download Size: 24.2M

Very interesting book on microcode.

Reply to
Homer J Simpson

Oy, talk about memory lane! The very first computer I ever programmed was a G-15. Its main memory was a rotating magnetic drum. It did everything one bit at a time, albeit in groups of 29 bits per word:

formatting link
- CAUTION! 2.8 MB download!

Cheers! Rich

Reply to
Rich Grise

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.