XOR, XNOR, & Adders

Download Report

Transcript XOR, XNOR, & Adders

XOR, XNOR, & Binary Adders
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
Y
Z  XY  XY  XY
X Y
Z
0
0
0
0
1
1
1
0
1
1
1
0
3
XNOR Gate – Exclusive NOR
X
Y
Z  XY  XY  X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

 
F  Z X  Y   Y X  Z 
F1  Z X Y  X Y  Y X Z  X Z

1
6
Binary Addition
Single Bit Addition:
Carry
1
0
0
0
0
1
1
1
0
1
Multiple Bit Addition:
1
6
3
9
1
1
10
Cin
Cout
1
0110
0011
1001
1
1
1
0
0
A
B
Sum
7
Two Types of Adders
Half Adder
• 2 Inputs (A & B)
• 2 Outputs (Sum & Cout)
• Used for LSB only
Full Adder
• 3 Inputs (A, B, Cin)
• 2 Outputs (Sum & Cout)
• Used for all other bits
A
A
Sum
B
Half Adder
B
Sum
Cout
Full Adder
Cout
Cin
8
Half Adder – Design
A
0
0
1
1
B
0
1
0
1
Sum Cout
0
0
1
0
1
0
0
1
Sum  A B  A B  A  B
Cout  A B
9
Half Adder - Circuit
10
Full Adder – Design of Cout
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
Cin Sum Cout
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
0
1
1
1
1
AB
Cin
VCin
AB
0
0
AB
0
1
AB
1
1
AB
0
1
B Cin
A Cin
Cout  A B  B Cin  A Cin
11
Full Adder – Design of Sum
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
Cin Sum Cout
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
0
1
1
1
1
Cin
VCin
AB
0
1
AB
1
0
AB
0
1
AB
1
0
Sum  A B Cin  A B Cin  A B Cin  A B Cin
K-Mapping did NOT help us simplify . . . Let’s try Boolean algebra.
12
Boolean Simplification of Sum
Sum  A B CIN  A B CIN  A B CIN  A B CIN



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
Though XOR gates can be used for implementing any
combinational logic design, their primary application is adder
circuits. Compare the AOI implementation (above) for the
sum function to the XOR implementation (below).
15
MSI Full Adder
SSI - Full Adder
MSI - Full Adder
16
Cascading Adders – Four Bits
0110
0011
1001
Example: 6 + 3 = 9
Cout
General Form
3
Cout
2
Cout
1
Cout
0
A 3 A 2 A1 A 0
 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