Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2008-01-01 21:39:02

electra
Member
Registered: 2008-01-01
Posts: 1

Question on logic gates.

Can anyone help me out with this problem. I want to know how many AND, OR,shift gates are there in
1) addition
2)multiplication
3)subtraction
4)division

operations.

Thanks in advance.

Offline

#2 2008-01-01 22:53:38

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: Question on logic gates.

well your question isn't very straightfoward, firstly im going to assume you mean integers tongue

addition between N bit integers, is N×(2×XOR + 2×AND + 1×OR) although in its lowest number you could replace this with (N-1)×(2×XOR + 2×AND + 1×OR) + 1×XOR + 1×AND

heres a schematic diagram: http://www.play-hookey.com/digital/images/faddr000.gif
this is for a full 1 bit addition, for N bit addition these are linked in series with each Cout going to the next Cin

subtraction between N bit integers, doing it the fastest way is N×(2×XOR + 2×AND + 1×OR + 1×NOT) (each input from the second integer is inverted, and the first overflow bit going to the first bit addition is set to 1) assuming signed integers are in two's complement form.

multiplication and division i have never programmed into an electronic circuit so i couldn't tell you, you can always do multiplication with addition and bit shifts, but that is alot of operations and im sure there is a better way.


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#3 2008-01-03 07:51:29

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,588

Re: Question on logic gates.

Also, if you don't want to ripple down the digits, you can build a more complex adder that does all the answers like a hash table for a certain number of bits or digits (depending on the base of the numbering system).
rippling is like a series of events with carries, but doing it all at once may take more devices, but be faster.


igloo myrtilles fourmis

Offline

Board footer

Powered by FluxBB