XOR, XNOR, & Binary Adders: Digital Electronics
XOR, XNOR, & Binary Adders: Digital Electronics
Digital Electronics
XOR, XNOR & Adders
This presentation will demonstrate
• The basic function of the exclusive OR (XOR) gate.
• The basic function of the exclusive NOR (XNOR) gate.
• How XOR and XNOR gates can be used to implement
combinational logic design.
• How XOR gates can be using to design half and full adders.
• How full adders can be implemented with Small Scale
Integration (SSI) and Medium Scale Integration (MSI) logic.
• How single bit half and full adders can be cascaded to
make multi-bit adders.
2
XOR Gate – Exclusive OR
X
Z XY XY XY
Y
X Y Z
0 0 0
0 1 1
1 0 1
1 1 0
3
XNOR Gate – Exclusive NOR
X
Z XY XY XY
Y
X Y Z
0 0 1
0 1 0
1 0 0
1 1 1
4
Logic Design with XOR & XNOR
Example
Algebraically manipulate the logic expression for F1 so
that XOR and XNOR gates can be used to implement
the function. Other AOI gates can be used as needed.
F1 X Y Z X Y Z X Y Z X Y Z
5
Logic Design with XOR & XNOR
Solution
F1 X Y Z X Y Z X Y Z X Y Z
F1 Z X Y X Y Y X Z X Z
F1 Z X Y Y X Z
6
Binary Addition
Single Bit Addition: Carry
1
0 0 1 1
0 1 0 1
0 1 1 10
3 0011 0
B
Sum
9 1001 0
7
Two Types of Adders
Half Adder Full Adder
• 2 Inputs (A & B) • 3 Inputs (A, B, Cin)
• 2 Outputs (Sum & Cout) • 2 Outputs (Sum & Cout)
• Used for LSB only • Used for all other bits
A
A Sum Sum
Half Adder B Full Adder
B Cout Cout
Cin
8
Half Adder – Design
A B Sum Cout
0 0 0 0 Sum A B A B A B
0 1 1 0
Cout A B
1 0 1 0
1 1 0 1
9
Half Adder - Circuit
10
Full Adder – Design of Cout
0 0 0 0 0 AB 0 0
0 0 1 1 0
AB 0 1 B Cin
0 1 0 1 0
0 1 1 0 1 AB 1 1
1 0 0 1 0 AB
AB 0 1 A Cin
1 0 1 0 1
1 1 0 0 1
Cout A B B Cin A Cin
1 1 1 1 1
11
Full Adder – Design of Sum
A B Cin Sum Cout Cin VCin
0 0 0 0 0 AB 0 1
0 0 1 1 0
AB 1 0
0 1 0 1 0
0 1 1 0 1 AB 0 1
1 0 0 1 0 AB 1 0
1 0 1 0 1
1 1 0 0 1
Sum A B Cin A B Cin A B Cin A B Cin
1 1 1 1 1
Sum A B CIN B CIN A B CIN B CIN
Sum A B CIN A B CIN
Let K B CIN and substitute
Sum A K A K
Sum A K
Re placing B CIN for K
Sum A B CIN
13
Full Adder - Circuit
Sum A B CIN
Cout A B B Cin A Cin
14
Full Adder: AOI vs. XOR
15
MSI Full Adder
16
Cascading Adders – Four Bits
0110
0011 Example: 6 + 3 = 9
1001
General Form
B 3 B 2 B1 B 0
S 3 S 2 S1 S 0 17
Four Bit Adder with SSI Logic
Full Adder
Full Adder
Full Adder
Half Adder 18
Four Bit Adder with MSI Logic
Full Adder
Full Adder
Full Adder
Full Adder
19