Вы находитесь на странице: 1из 64

Boolean Algebra and Logic Gates

 Basic Building Blocks


 Logic Gate Symbol
 Unique function
 Truth or Function Table
 Function Expression
 Timing Diagram
1 output
 2 inputs
 3 inputs
 4 inputs
 Multiple inputs
 Logical Multiplication function

Input Output
F  A B
A B F F  A  B  C  ....  N
0 0 0
0 1 0
1 0 0
1 1 1
A

t0 t1 t2 t3 t4 t5 t6

F
1 output
 2 inputs
 3 inputs
 4 inputs
 Multiple inputs
 Boolean Add function

Input Output
F  A B
A B F
0 0 0 F  A  B  C  ..  N
0 1 1
1 0 1
1 1 1
A

t0 t1 t2 t3 t4 t5 t6

F
1 input
 1 output
 Invert function

Input Output
A F
0 1
1 0

FA
A

t0 t1 t2 t3 t4 t5 t6

F
 Enable/Disable Device
 Counter counts when it receives pulses

Clock Pulses U/D


Counter

B1

Reset B8

A
Carry out

B ENB

Disable
Enable
 Car door open alarm

Front left door


Rear left door
Alarm
Front right door
Rear right door
 1’s Complement

1 1 0 0 1 0 1 0

0 0 1 1 0 1 0 1
1 output
 2 inputs
 3 inputs
 4 inputs
 Multiple inputs
Input Output
F  A B
A B F F  A  B  C  ....  N
0 0 1
0 1 1
1 0 1
1 1 0
A

t0 t1 t2 t3 t4 t5 t6

F
1 output
 2 inputs
 3 inputs
 4 inputs
 Multiple inputs
Input Output
F  A B
A B F F  A  B  C  ....  N
0 0 1
0 1 0
1 0 0
1 1 0
t0 t1 t2 t3 t4 t5 t6
 Device Failure Alarm

ALARM
 Step 1: Invert each input and output of the
standard symbol
 Change the operation symbol from AND to OR, or
from OR to AND.
 Examples: AND, OR, NAND, NOR, INV
 How a NAND gate can be used to replace an AND gate,
an OR gate, or an INVERTER gate.
 How a logic circuit implemented with AOI logic gates
can be re-implemented using only NAND gates.
 That using a single gate type, in this case NAND, will
reduce the number of integrated circuits (IC) required
to implement a logic circuit.

AOI Logic NAND Logic

More ICs = More Cost Less ICs = Less Cost


X
Z XYXY
Y

X Y Z
0 0 1
0 1 1
1 0 1
1 1 0
X X  X (Before Bubble)

X ZX

X Z
0 1
Equivalent to Inverter
1 0
XY
X
ZXYXY
Y

NAND Gate Inverter

X Y Z
0 0 0
0 1 0
Equivalent to AND Gate
1 0 0
1 1 1
X

X Y
Z  XY  XY  XY
Y

Inverters NAND Gate

X Y Z
0 0 0
0 1 1
Equivalent to OR Gate
1 0 1
1 1 1
AND OR INVERTER
1. If starting from a logic expression, implement the
design with AOI logic.
2. In the AOI implementation, identify and replace every
AND,OR, and INVERTER gate with its NAND equivalent.
3. Redraw the circuit.
4. Identify and eliminate any double inversions (i.e.,
back-to-back inverters).
5. Redraw the final circuit.
Example:
Design a NAND Logic Circuit that is equivalent to the AOI circuit
shown below.

BC A C
Identify and replace every AND,OR, and INVERTER gate with its
NAND equivalent.
Redraw the circuit.
Identify and eliminate any double inversions.
Redraw the circuit.
C BC

BCAC

Z BCAC
AC
Z BC AC
IC Type Gates Gate / IC # ICs IC Type Gates Gate / IC # ICs
74LS04 1 6 1 74LS00 4 4 1
74LS08 2 4 1 Total Number of ICs → 1
74LS32 1 4 1
Total Number of ICs → 3
 How a NOR gate can be using to replace an AND gate,
an OR gate or an INVERTER gate.
 How a logic circuit implemented with AOI logic gates
could be re-implemented using only NOR gates
 That using a single gate type, in this case NOR, will
reduce the number of integrated circuits (IC) required
to implement a logic circuit.

AOI Logic NOR Logic

More ICs = More Cost Less ICs = Less Cost


X
Z XYX Y
Y

X Y Z
0 0 1
0 1 0
1 0 0
1 1 0
X  X  X (Before Bubble)

X ZX

X Z
0 1
Equivalent to Inverter
1 0
XY
X
Z  XY XY
Y

NOR Gate “Inverter”

X Y Z
0 0 0
0 1 1
Equivalent to OR Gate
1 0 1
1 1 1
X

X Y
Z XYXY XY
Y

“Inverters” NOR Gate

X Y Z
0 0 0
0 1 0
Equivalent to AND Gate
1 0 0
1 1 1
AND OR INVERTER
1. If starting from a logic expression, implement the
design with AOI logic.
2. In the AOI implementation, identify and replace every
AND,OR, and INVERTER gate with its NOR equivalent.
3. Redraw the circuit.
4. Identify and eliminate any double inversions. (i.e.
back-to-back inverters)
5. Redraw the final circuit.
Example:
Design a NOR Logic Circuit that is equivalent to the AOI circuit
shown below.

BC A C
Identify and replace every AND,OR, and INVERTER gate with its
NAND equivalent.
Redraw Circuit.
Identify and eliminate any double inversions.
Redraw Circuit.
BCBCBC
C

B BC AC
C
Z BC AC
BC AC
A
ACACAC
IC Type Gates Gate / IC # ICs IC Type Gates Gate / IC # ICs
74LS04 1 6 1 74LS02 7 4 2
74LS08 2 4 1 Total Number of ICs → 2
74LS32 1 4 1
Total Number of ICs → 3
1 output
 2 inputs
 Multiple inputs
 OddFunction:
Output is equal to 1, if the input has odd
numbers of 1s.
Input Output
F  A B
A B F
0 0 0
0 1 1
1 0 1
1 1 0
t0 t1 t2 t3 t4 t5 t6
1 output
 2 inputs
 Multiple inputs
 EvenFunction:
Output is equal to 1, if the input has even
numbers of 1s.
Input Output
F  A B
A B F
0 0 1
0 1 0
1 0 0
1 1 1
t0 t1 t2 t3 t4 t5 t6
14 13 12 11 10 9 8
14 13 12 11 10 9 8

1 2 3 4 5 6 7
1 2 3 4 5 6 7
7432
7408 Four 2-Input OR Gate
Four 2-Input AND Gate

14 13 12 11 10 9 8 14 13 12 11 10 9 8

1 2 3 4 5 6 7 1 2 3 4 5 6 7
7404 7400
Hex Inverters Four 2-Input NAND Gate
14 13 12 11 10 9 8 14 13 12 11 10 9 8

1 2 3 4 5 6 7 1 2 3 4 5 6 7
7402 7486
Four 2-Input NOR Gate Four 2-Input XOR Gate

14 13 12 11 10 9 8

1 2 3 4 5 6 7
74266
Four 2-Input XNOR Gate