Sei sulla pagina 1di 19

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 X Y X Y XY

X 0 0

Y 0 1

Z 0 1

1
1

0
1

1
0

XNOR Gate Exclusive NOR


X Y

Z X Y X Y XY

X 0 0

Y 0 1

Z 1 0

1
1

0
1

0
1

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

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
1

F1 Z X Y X Y Y X Z X Z

Binary Addition
Single Bit Addition:
1

Carry

0 0 0

0 1 1

1 0 1

1 1 10
Cout Cin
1 1

Multiple Bit Addition:


1 1

6 3 9

0110 0011 1001

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
Half Adder B

Sum B
Cout Cin Full Adder

Sum
Cout

Half Adder Design


A 0 0 1 1 B 0 1 0 1 Sum Cout 0 1 1 0 0 0 0 1
Sum A B A B A B Cout A B

Half Adder - Circuit

10

Full Adder Design of Cout


A 0 0 0 0 1 1 B 0 0 1 1 0 0 Cin Sum Cout 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 1 0 1
AB
AB AB
AB
C in

Cin V

0 0 1 0

0 1 1 1

B Cin

AB

A Cin

1 1

1 1

0 1

0 1

1 1

Cout A B B Cin A Cin


11

Full Adder Design of Sum


A 0 0 0 0 1 1 B 0 0 1 1 0 0 Cin Sum Cout 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 1 0 1
AB AB
AB
C in

Cin V

0 1 0 1

1 0 1 0

AB

1 1

1 1

0 1

0 1

1 1

Sum A B Cin A B Cin A B Cin A B Cin


12

K-Mapping did NOT help us simplify . . . Lets try Boolean algebra.

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

A 3 A 2 A1 A 0 B 3 B 2 B1 B 0 S 3 S 2 S1 S 0

Cout

Cout

Cout

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

Potrebbero piacerti anche