Question: Design a circuit that can add and subtract two 2-bit two's complement binary numbers and check for overflow. Your circuit should have a 2-bit input

Design a circuit that can add and subtract two 2-bit two's complement binary numbers and check for overflow. Your circuit should have a 2-bit input A = a2a1, a 2-bit input B = b2b1, a 1-bit input M, a 2-bit output S = s2s1, and a 1-bit output OF. When M = 0, the output S should be the sum of A and B (i.e. S = A + B), and when M = 1 the output should be S = A - B. The output OF should be 1 if overflow occurs.

a. Create a truth table for the circuit described above. The truth table has been created below with a few filled out as examples, fill out the rest of the table (on excel or on paper).

b. Draw the resulting circuit diagram.

Design a circuit that can add and subtract two 2-bit two's complement

A1 AO B1 BO B1' BO Cout 1 Cout O s1 So OF English Description of Row MODE PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) PLUS (0) MINUS (1) 0 0000 0 MINUS (1) 0 MINUS (1) | 0 1 MINUS (1) 0 01 MINUS (1) 0 1 0 MINUS (1) 0 10 1 1 0 0 0 0x X o 00 1x X 0 0 1 1x x 0 1 0 0x x 0 1 0 1x X 0 1 1 0x X 0 1 1 1x X 1 0 0 0xX 1 0 0 1 x x 1 0 1 0x X 1 01 1x X 1 1 0 0x X 1 1 0 1x X 11| 1 x x 1 1 1 1x X 0 0 0 1 1 0 11 "1+1=2 OVERFLOW!" 0 "-2 + 0 =-2" 0 1 1"-1+ -2-3 OVERFLOW!" 0 01 1 1 Cannot represent +2 in two bits 0 1"O+2 2 OVERFLOW Special Case 1 0 1 0 0 0 Cannot represent +2 in two bit MINUS (1) 01 o MINUS (1) 0 11 MINUS (1) 1 00 00 0 MINUS (1) 1 0011 1 MINUS (1) 1 0101 0 MINUS (1) 1 01 1 MINUS (1) 1 10 MINUS (1) 1 10 MINUS (1) 1 11 MINUS (1) 1 11 10 1 1 0 1 Cannot represent +2 in two bits. 1 1 1 0 1 0 Cannot represent +2 in two bits

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!