Designing an arithmetic circuit

Thread Starter

glam

Joined Apr 16, 2008
2
Hi guys,

Here is the question:

An arithmetic circuit generates the following four arithmetic
operations in conjunction with the input carry Cin, one selection
variable S and 3-bit data inputs A and B.


S| Cin = 0 ____|Cin = 1
0| G = A + B __|G = A + 2
1| G = A + 1 __|G = A - B


Design the circuit using appropriate logic gates and full
adders
_____________________

I made adder/subtractor circuit but it doesn't do G = A + 2 and G = A + 1 .. how i can add these..???
 

Caveman

Joined Apr 15, 2008
471
Use a 3-bit mux to switch in either B,-B,1,or 2 to the second input of the adder. The mux is controlled by S and Cin. The first input is always A.
 

Caveman

Joined Apr 15, 2008
471
Two is 010 binary.
Okay, let's look at bit 0. Remove all that other stuff before the adder that you've got. We just want a circuit that feeds the B0 adder input. Here is your truth table for that bit. Note that B0 just passes the value of B0 through. And that /B0 inverts the value of B0 and passes that through.

S|Cin|Out0
0 0 B0
0 1 0
1 0 1
1 1 /B0

An example of a circuit that does this (without any logic reduction) is a 4to1 mux. Use S as one of the selects and Cin as the other. For /B0, you will need an inverter.

Now you just do it twice more for B1 and B2 of the adder. B1 and B2 have different truth tables, so you need to feed their muxes differently.
S|Cin|Out1
0 0 B1
0 1 1 // This is the 1 in 010
1 0 0 // This is the middle 0 in 000
1 1 /B1

Does this make sense?
 
Top