Adder Subtractor
Adder Subtractor
Adder
Half adder
Full adder
Subtractor
Half Subtractor
Full Subtractor
Adder
An adder is a digital logic circuit in electronics that
implements addition of numbers.
In many computers and other kinds of processors, adders
are used not only in the arithmetic logic units, but also in
other parts of the processor, where they are used to
calculate addresses, increment and decrement operators,
and similar operations.
Adders are classified into two types: 1)half adder.
2) full adder.
Let us first take a look at the addition of single bits.
0+0 = 0
0+1 = 1
1+0 = 1
1+1 =10 (i.e. 1+1=0 with carry = 1)
Half Adder
The half adder adds two single binary
digits A and B.
It has two outputs, sum (S) and carry (C).
The carry signal represents an overflow into
the next digit of a multi-digit addition.
Truth Table
SUM=A’B+AB’
1+1+1+1= 100 CARRY=AB
INPUTS OUTPUTS
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Solving truth table using K-map
Analysing results
No of inputs = 2
No of outputs = 2
Inputs are A , B.
Outputs are Sum , Carry.
Sum can be obtained using XOR logic gate.
Carry can be obtained using AND logic gate.
Designing circuit
Binary Adder
Half Adder x S
y HA
C
● Adds 1-bit plus 1-bit
● Produces Sum and Carry x
+ y
───
x y C S C S
0 0 0 0
0 1 0 1
x S
1 0 0 1
1 1 1 0
y C
Full Adder
A full adder adds binary numbers and accounts for
values carried in as well as out.
The main difference between a half-adder and a
full-adder is that the full-adder has three inputs and
two outputs.
A one-bit full adder adds three one-bit numbers,
often written as A, B, and Cin.
It has two outputs, sum (S) and carry (Cout).
Truth Table
x y C S
0 0 0 0
INPUTS OUTPUTS
0 1 0 1
A B CIN COUT Sum
1 0 0 1
0 0 0 0 0
1 1 1 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Solving Truth Table using K-Map
XOR’
OR
= AB+AC+BC
Analysing results
No of inputs = 3
No of outputs = 2
Inputs are A , B, Cin.
Outputs are Sum , Cout.
Designing circuit
CARRY=AB+ C*(A+B)
Binary Adder
Full Adder x S
y FA
● Adds 1-bit plus 1-bit plus 1-bit z C
x
+ y
y + z
x y z C S ───
0 1 0 1
0 0 0 0 0 C S
0 0 1 0 1 x 1 X X X
z
0 1 0 0 1
S = x+y z
0 1 1 1 0
y
1 0 0 0 1
0 0 1 0
1 0 1 X X
x 0 X X X
1 1 0 X X
z
1 1 1 X X C = yz
Binary Adder
Full Adder
x S
y HA HA
z C
x S=xy S = x yS = xy'z'+x'yz'+x'y'z+xyz = x y z
Z S
S = x y (x y)*Z
y C = xy Z
(x C
y)*Z+xy
=xy+xz+yz
z
Subtractor
INPUTS OUTPUTS
A B DIFF BORROW
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Solving truth table using K-map
A’ 0
00 01 11 10
1 0 0 0 1
1 1
A 1 1 1 1 0 1 0 0
Difference= 1 1 0 0 0
1 1 1 1 1
Solving Truth Table using K-Map
0 0 0 SUM=B 0 0 0 CARRY=0
0 1 1 0 1 0
B I0 1 0 1 SUM=B’ 1 0 0 CARRY=B
B’ I1 MUX SUM 1 1 0 1 1 1
Y
2X1
S1
S
0 I0 1
B I1 MUX CARRY
Y
2X1
0 I0
33 / 1 I1
1 INPUTS OUTPUTS
65 I2
I3 MUX A B CIN Carry Sum
0 Y Sum
1 I4 8X1 0 0 0 0 0
0 I5 0 0 1 0 1
0 I6
0 1 0 0 1
1 I7
S2 S1 S0 0 1 1 1 0
1 0 0 0 1
I0 1 0 1 1 0
I1 1 1 0 1 0
I2
1 1 1 1 1
I3
Y
I4 MUX Carry
I5
I6
Eastern Mediterranean University
I7
1+1+1+1= 100 A B CIN CARRY
A B CIN sum
0 0 0 0 CARRY
0 0 0 0 sum =0
0 0 1 0
=C
C I0 0 0 1 1
0 1 0 0 CARRY
C’ I1 MUX SUM 0 1 0 1 sum
0 1 1 1
=C
Y =C’
C’ I2 4X1 0 1 1 0
1 0 0 0 CARRY
C I3 1 0 0 1 sum =C
S1 S0 1 0 1 1
=C’
1 0 1 0
1 1 0 1 CARRY
A B 1 1 0 0 sum =1
1 1 1 1
=C
1 1 1 1
S S
0 I0 1 0
C I1 MUX CARRY
Y
C I2 4X1
1 I3
1+1+1+1= 100 A B CIN sum A B CIN CARRY
0 0 0 0 0 0 0 0
0 0 1 1 0 0 1 0
R)C I0 0 1 0 1 0 1 0 0
R)C I1 MUX SUM 0 1 1 0 0 1 1 1
Y
2X1 1 0 0 1 1 0 0 0
S1 1 0 1 0 1 0 1 1
1 1 0 0 1 1 0 1
A 1 1 1 1 1 1 1 1
S
BC I0 1
B+C I1 MUX CARRY
Y
2X1