You are on page 1of 3

# THE 4-BIT ADDER SUBTRACTOR Introduction To be able to perform arithmetic, you must first be familiar with numbers.

For binary subtraction, we use 2s complement to keep things simple. For instance, to perform the operation six (0110) minus five (0101), we first obtain the 2s complement of five and then add it to six: Step one: Getting the 2s complement of 5 1. Flip every bit in five to get 1010. 2. Add one to 1010 to get: 1010 + 1 = 1011. Step two: Adding the 2s complement of 5 to 6: 1. Decimal numerals 6 +(-5) 1 Binary numerals 0110 +1011 10001.

B3 C Operation

B2 S2

B1 S1

B0 S0

S3

Note The addends A & B and the sum S are all 2s complements. Ignore C & V A3 B3 S3 A2 B2 S2

calculation A1 B1 S1 A0 B0 S0

## Operation Subtraction without overflow (V=0)

Note The minuend A, the subtrahend B, and the difference S are all 2s complements. Ignore C A3 B3 S3

calculation A2 B2 S2 A1 B1 S1 calculation A3 B3 C S3 A2 B2 S2 A1 B1 S1 A0 B0 S0 A0 B0 S0

Operation

Note

Subtraction with The minuend A, the subtrahend B, and the overflow difference S are all 2s complements. (V=1) 2s Complement Table Binary 01111 01110 01101 01100 01011 01010 01001 01000 00111 00110 00101 00100 00011 00010 00001 00000 +15 +14 +13 +12 +11 +10 +9 +8 +7 +6 +5 +4 +3 +2 +1 +0 2s complement Binary 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111