CA Lecture 9
CA Lecture 9
Lecture 9.
. Digital Logic.
Instructors
• Mathematical discipline used to design and analyze the behavior of the digital circuitry in
digital computers and other digital systems
• Named after George Boole
– English mathematician
– Proposed basic principles of the algebra in 1854
• Claude Shannon suggested Boolean algebra could be used to solve problems in relay-switching
circuit design
• Is a convenient tool:
– Analysis
• It is an economical way of describing the function of digital circuitry
– Design
• Given a desired function, Boolean algebra can be applied to develop a simplified
implementation of that function
3
Boolean Variables and Operations
5
Basic Identities of Boolean Algebra
Basic Postulates
A•B=B•A A+B=B+A Commutative Laws
A • (B + C) = (A • B) + (A • C) A + (B • C) = (A + B) • (A + C) Distributive Laws
1•A=A 0+A=A Identity Elements
A• A =0 A+ A =1 Inverse Elements
Other Identities
0•A=0 1+A=1
A•A=A A+A=A
A • (B • C) = (A • B) • C A + (B + C) = (A + B) + C Associative Laws
A·B= A + B A +B= A· B DeMorgan's Theorem
6
Basic Logic Gates
7
Basic Logic Gates
A A
A A
A (A+B)
A A B A+B
A B B
B
A
A A
A
A+B A B
B B
B B
Figure 11.2 Some Uses of NAND Gates Figure 11.3 Some Uses of NOR Gates
8
Combinational Circuit
9
A Boolean Function of Three Variables
Table 11.3 A B C
A B C F
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
F
1 0 1 0
1 1 0 1
1 1 1 0
10
A Boolean Function of Three Variables
A
A
B C
C
A
B
C
A F
B F B
C
B
A Figure 11.6 Simplified Implementation of Table 11.3
C
A
B
C
11
A Boolean Function of Three Variables
AB BC
00 01 11 10 00 01 11 10
1 1 0 1 1
A
1 1
(a) F = AB + AB
(b) F = ABC + ABC + ABC
CD
C
00 01 11 10
00 1
01
AB B
11 1
A
10 1
AB 01 1
CD CD CD 11 1 1
00 01 11 10 00 01 11 10 00 01 11 10
00 1 1 1 1 00 1 1 00 1 1 10 1
AB 01 1 1 1 1 AB 01 1 1 AB 01 1 1
(b) F = BCD + ACD
11 11 1 1 11 1 1
10 10 1 1 10 1 1
(g) A (h) D (i) C
Figure 11.9 Overlapping Groups
Figure 11.8 Example Use of Karnaugh Maps
13
Truth Table for the One-Digit Packed
Decimal Incrementer
14
Multiplexer
A multiplexer is a digital combinational logic circuit with n inputs and one output. Its purpose is to
connect one of the inputs to the output line, depending on a control signal. The general symbol of a
multiplexer is shown below.
15
2-to-1 Multiplexer
16
4-to-1 Multiplexer
S2 S1 F
0 0 D0
0 1 D1
1 0 D2
1 1 D3
17
Demultiplexer
18
Decoder
A decoder is a combinational circuit with a number of output lines, only one of which is
asserted at any time. Which output line is asserted depends on the pattern of input lines. In
general, a decoder has n inputs and 2n outputs.
A 000
D0
B
001
D1
C
010
D2
011
D3
100
D4
101
D5
110
D6
111
D7
A0
A7
n-bit
256 X 8 256 X 8 256 X 8 256 X 8
destination n-to-2n
address 2n outputs
RAM RAM RAM RAM decoder
Enable
Enable
Enable
Enable
Data input
A8
2-to-4
A9 decoder
20
Read-Only Memory (ROM)
21
Read-Only Memory (ROM)
0000
0001
Table 11.8 0010
0011
Truth Table for a ROM 0100
0101
X1 0110
Input Output 4-input 0111
X2
X1 X2 X3 X4 Z1 Z2 Z3 Z4 16-output 1000
X3
decoder 1001
0 0 0 0 0 0 0 0 X4
1010
0 0 0 1 0 0 0 1 1011
0 0 1 0 0 0 1 1 1100
1101
0 0 1 1 0 0 1 0 1110
0 1 0 0 0 1 1 0 1111
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0 Z1 Z2 Z3 Z4
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
23
Adder
A
B
C
A
B
C
Sum
A31 B31 A31 B31 A23 B23 A16 B16 A15 B15 A 8 B8 A7 B7 A 0 B0 A
B
C
C23 C15 C7
Cout 8-bit 8-bit 8-bit 8-bit Cin A
adder adder adder adder B
C
A
S31 S24 S23 S16 S15 S8 S7 S0 B
A
Carry
C
24
Sequential Circuit
25
Flip-Flops
1.The flip-flop is a bistable device. It exists in one of two states and, in the absence of
input, remains in that state. Thus, the flip-flop can function as a 1-bit memory.
2.The flip-flop has two outputs, which are always the complements of each other.
26
S-R Flip Flop
27
Master Slave JK Flip Flop
28
Delay Flip Flop / D Flip Flop
29
Toggle Flip Flop / T Flip Flop
30
Basic Flip-Flops
S Q S R Qn+1
0 0 Qn
S-R Ck 0 1 0
1 0 1
R Q 1 1 –
J Q J K Qn+1
0 0 Qn
J-K Ck 0 1 0
1 0 1
K Q 1 1 Qn
D Q D Qn+1
0 0
D Ck 1 1
31
PLD Terminology
Table 11.11 PLD Terminology
Logic Block
A relatively small circuit block that is replicated in an array in an FPD. When a circuit is
implemented in an FPD, it is first decomposed into smaller sub-circuits that can each be mapped
into a logic block. The term logic block is mostly used in the context of FPGAs, but it could also
refer to a block of circuitry in a CPLD.
32
PLD Examples
I1 I2 I3
“OR” array
Logic
block
I/O
block
“AND” array
A B C
ABC
AB
AC
33
Simple FPGA Logic Block
A0 2-to-1
MUX
lookup table
A1
16 1
D Q
A2
A3 Ck
Clock
34
Conclusion
35