I have an 4-bit unsigned Binary adder that performs F=A+B with carry in and carry out, I have to draw the smallest circuit using the adder and whatever other combinational logic gates I need to perform the 4-bit function below on 2's complement numbers A and B
F=A+B if ADD=1,
F=A-B if ADD=0
The circuit is shown below
Lets see what happend when ADD = 1
When ADD = 1, the output of the NOT gate will be 0. So the carry in bit Cin will be zero. Also the one input to each EX - OR gate will be 0. So the number B will go as it is to the adder and the numbers A and B will get added. We will get the output A + B
Lets see what happend when ADD = 0
When ADD = 0, the output of the NOT gate will be 1. So the carry in bit Cin will be 1. Also the one input to each EX - OR gate will be 1. So the number B will go as its one's complement. Now the Cin bit is also 1. So effectively we get the two's complement of B as the second number. Now A and the two's complement of B will be added. This is nothing but A - B . We will get the output A - B
Get Answers For Free
Most questions answered within 1 hours.