Digital Logic
Digital Logic
Number ….in
whatever base Decimal value of the given number
___________________________________________________________________________________________________________________________________________________________________
© Emil M. Petriu Prof. Emil M. Petriu, School of Electrical Engineering and Computer Science, University of Ottawa
Powers of 2
____________________________________________________________________________________________________________________________________________________________________
N 2N Comments
_____________________________________________________________________________________________________________________________________________________________________
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1,024 “Kilo”as 210 is the closest power of 2 to 1,000 (decimal)
11 2,048
……………………………………………………….....
15 32,768 215 Hz often used as clock crystal frequency in digital watches
…………………………………………………….....
© Emil M. Petriu
Negative Powers of 2
_____________________________________________________________
N <0 2N
____________________________________________________________ Binary numbers less than 1
-1 2-1 = 0.5 Binary Decimal value
-2 2-2 = 0.25 -----------------------------------------------------------------------------------------------------------------
© Emil M. Petriu
HEXADECIMAL
----------------------------------------------------------------------------------------------------
11111001110 0000 0 0
0001 1 1
0010 2 2
0011 3 3
111 1100 1110 0100 4 4
7 12 14 <== Decimal 0101 5 5
0110 6 6
0111 7 7
Hexadecimal: 7CE = 7x162 +12x161 1000 8 8
+14x160 = 1998 1001 9 9
1010 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F
----------------------------------------------------------------------------------------------------
© Emil M. Petriu
LOGIC OPERATIONS AND TRUTH TABLES
Digital logic circuits handle data encoded in binary form, i.e. signals
that have only two values, 0 and 1.
Binary logic dealing with “true” and “false” comes in handy to describe
the behaviour of these circuits: 0 is usually associated with “false” and
1 with “true.”
Quite complex digital logic circuits (e.g. entire computers) can be built
using a few types of basic circuits called gates, each performing a single
elementary logic operation : NOT, AND, OR, NAND, NOR, etc..
© Emil M. Petriu
GATES
A B A.B AND
A A NOT _____________________________________
______________________ 0 0 0 A
0 1 A F =A 0 1 0 F =A . B
1 0 1 0 0 B
1 1 1
_____________________________________
A B A+B OR
_____________________________________
0 0 0 A
0 1 1 F=A+ B
1 0 1 B
1 1 1
_____________________________________
© Emil M. Petriu
… more GATES
A B A.B NAND
_____________________________________
0 0 1 A
0 1 1 F =A . B
1 0 1 B
1 1 0
_____________________________________
A B A+B NOR
_____________________________________
0 0 1 A
0 1 0 F=A+ B
1 0 0 B
1 1 0
_____________________________________
© Emil M. Petriu
… and more GATES
XOR
A B A ⊕B
_____________________________________
0 0 0 A
0 1 1 F = A ⊕B
1 0 1 B
1 1 0
_____________________________________
A B A ⊕B EQU or XNOR
_____________________________________
0 0 1
A
0 1 0 F = A ⊕B
1 0 0 B
1 1 1
_____________________________________
© Emil M. Petriu
GATES … with more inputs EXAMPLES OF
GATES WITH
THREE INPUTS
0 1 1 A
0 0 0 0 F =A.B.C
0 0 1 0 1 1 0 B AND
0 1 0 0 1 1 0 C
0 1 1 0 1 1 0
1 0 0 0 1 1 0
1 0 1 0 1 1 0 A
F = A+B+C
1 1 0 0 1 1 0 B OR
1 1 1 1 1 0 0 C
__________________________________________________________________ ___________________ ___________________
A A
F =A.B.C F = A+B+C
B NAND B NOR
C C
© Emil M. Petriu
Logic Gate Array that Produces an Arbitrarily Chosen Output
A B C
F= A.B .C + A.B .C
A B C F + A.B .C + A.B .C
________________________________________
0 0 0 0
0 0 1 0 A.B .C
0 1 0 1
0 1 1 1
1 0 0 0 A.B .C
1 0 1 1 F
1 1 0 0
1 1 1 1 A.B .C
_________________________________________
A.B .C
“Sum-of-products”
A B C
form of the logic circuit.
© Emil M. Petriu
A B C
BOOLEAN ALGEBRA
“ Proof ”:
AND rules
A.A= 0 0 0 0 0 0
0 .A=0 0 0 1 0 0
1.A=A 0 1 0 0 0
A.B =B.A 0 1 1 0 0
A . (B . C) = (A . B) . C 1 0 0 0 0
A . (B + C) = A . B + A . C 1 0 1 1 1
1 1 0 1 1
1 1 1 1 1
A.B =A+ B
© Emil M. Petriu
BOOLEAN ALGEBRA … continued
OR rules
A B C A + B.C (A+B) . (A+C)
_____________________________________________________________________
A+A=A 0 0 0 0 0
A+A=1 0 0 1 0 0
0 +A=A 0 1 0 0 0
1+A=1 0 1 1 1 1
A+B=B+A 1 0 0 1 1
A + (B + C) = (A + B) + C 1 0 1 1 1
A + B . C = (A + B) . (A +C) 1 1 0 1 1
1 1 1 1 1
A+B =A. B
© Emil M. Petriu
DeMorgan’s Theorem
© Emil M. Petriu
Simplifying logic functions using Boolean algebra rules
A B C
Sum-of-products form of the logic function:
A.B .C
A.B .C
F
A.B .C
A.B .C
A B C
A B C
© Emil M. Petriu
Simplifying logic functions using Boolean algebra rules … continued
F = AB( C + C) + AC ( B + B)
A B C 1 1
F = AB + AC
A.B
F
A.C
A A
© Emil M. Petriu
Simplifying logic functions using Karnaugh maps
© Emil M. Petriu
Simplifying logic functions of 4 variables using Karnaugh maps
A B C D F
(0) 0 0 0 0 ...
(1) 0 0 0 1 ...
AB
(2) 0 0 1 0 ...
(3) 0 0 1 1 ... 00 01 11 10
CD
(4) 0 1 0 0 ...
00 0 4 12 8
(5) 0 1 0 1 ...
(6) 0 1 1 0 ... 01 1 5 13 9
(7) 0 1 1 1 … 11 3 7 15 11
(8) 1 0 0 0 …
(9) 1 0 0 1 … 10 2 6 14 10
(10) 1 0 1 0 …
(11) 1 0 1 1 …
(12) 1 1 0 0 …
(13) 1 1 0 1 …
(14) 1 1 1 0 …
(15) 1 1 1 1 ...
© Emil M. Petriu
Simplifying logic functions using Karnaugh maps … looping
A B C F AB
(0) 0 0 0 0 C 00 01 11 10
(1) 0 0 1 0
0 0 1 0 0
(2) 0 1 0 1
(3) 0 1 1 1 1 0 1 1 1
(4) 1 0 0 0
(5) 1 0 1 1
(6) 1 1 0 0
(7) 1 1 1 1 AB AC F = AB + AC
© Emil M. Petriu
Simplifying logic functions using Karnaugh maps … more looping
© Emil M. Petriu
DeMorgan’s
Theorem Equivalent Gate Symbols
A A.B A A+B
A.B =A+ B =
B B
A A+B A A. B
A+ B =A. B =
B B
© Emil M. Petriu
NAND gate implementation of the “sum-of-product” logic functions
F
A F
A A
© Emil M. Petriu
ADDING BINARY NUMBERS
The binary
Adding two bits: 0+ 0+ 1+ 1+ number 10 is
0 1 0 1 equivalent to
__________ __________ __________ __________
the decimal 2
0 1 1 10
Truth table Carry Sum
Inputs Outputs (over)
A B Carry Sum
A
0 0 0 0 Sum
0 1 0 1 B
1 0 0 1
1 1 1 0
Half-Adder
circuit Carry
Sum = A + B
Carry = A . B
© Emil M. Petriu
Adding multi-bit numbers:
108D + 0 1 1 0 1 1 00 + A7 A6 A5 A4 A3 A2 A1 A0 +
90D 0 1 0 1 1 0 10 B7 B6 B5 B4 B3 B2 B1 B0
____________________________________
Carry In = 0
A7 B7 A6 B6 A5 B5 A4 B4 A3 B3 A2 B2 A1 B1 A0 B0
Carry Out
A B A B A B A B A B A B A B A B
CO CI CO CI CO CI CO CI CO CI CO CI CO CI CO CI
S S S S S S S S
S7 S6 S5 S4 S3 S2 S1 S0
© Emil M. Petriu
Full Adder
A B Carry In 1 1 0 1 0
0 1 0 0 1
CO CI 0 1 1 1 0
1 0 0 0 1 AB CO A .B
S
1 0 1 1 0 CI 00 01 11 10
1 1 0 1 0 0 0
Sum 0 1 0
1 1 1 1 1
1 0 1 1 1
B. CI A . CI
S = A . B . CI + A . B . CI + A . B . CI + A . B . CI
C = A . B + B . CI + A . CI
© Emil M. Petriu
HEX-TO-7 SEGMENT DECODER
This examples illustrates how a practical problem is analyzed in order to generate
truth tables,and then how truth table-defined functions are mapped on Karnaugh maps.
B3 B2 B1 B0 Four-bit
S1 7-segment display to allow
_________________________ “machine” the user see the natural
(0) 0 0 0 0 representation representation of the
of the hex S6 S7 S2
(1) 0 0 0 1 digits
hex digits.
(2) 0 0 1 0
(3) 0 0 1 1 S5 S4 S3
(4) 0 1 0 0
(5) 0 1 0 1
(6) 0 1 1 0 Binary outputs; when
such a signal is = 1 then
(7) 0 1 1 1 the corresponding segment
(8) 1 0 0 0 S7 S6 S5 S4 S3 S2 S1 in the 7-segment display
(9) 1 0 0 1 is on (you see it), when the
7 SEGMENT signal is = 0 then the
(A) 1 0 1 0 segment is off (you can’t
(B) 1 0 1 1 HEX see it).
(C) 1 1 0 0
(D) 1 1 0 1
(E) 1 1 1 0
(F) 1 1 1 1 The four-bit representation
B3 B2 B1 B0 of the hex digits
(0) 0 0 0 0 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2
(1) 0 0 0 1
(2) 0 0 1 0 S5 S3 S5 S3 S5 S3 S5 S3 S5 S3
S4 S4 S4 S4 S4
(3) 0 0 1 1
(4) 0 1 0 0 S1 S1 S1 S1 S1
(5) 0 1 0 1
(6) 0 1 1 0 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2
(7) 0 1 1 1
(8) 1 0 0 0 S5 S4 S3 S5 S4 S3 S5 S4 S3 S5 S4 S3 S5 S4 S3
(9) 1 0 0 1
(A) 1 0 1 0 S1 S1 S1 S1 S1
(B) 1 0 1 1
(C) 1 1 0 0 S6 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2
S7
(D) 1 1 0 1
(E) 1 1 1 0 S5 S3 S5 S4 S3 S5 S4 S3 S5 S4 S3 S5 S4 S3
(F) 1 1 1 1 S4
S1
B3 B2 B1 B0
_________________________ S1 = 0+2 +3+5+6+7+8+9+A+C+E+F
(0) 0 0 0 0
S2 = 0+1+2+3+4+7+8+9+A+D
(1) 0 0 0 1 B3 B2
(2) 0 0 1 0 S3 = 0+1+3+4+5+6+7+8+9+A+B+D
(3) 0 0 1 1 B1 B0 00 01 11 10
S4 = 0+2+3+5+6+8+9+B+C+D+E
(4) 0 1 0 0
(5) 0 1 0 1 S5 = 0+2+6+8+A+B+C+D+E+F 00 0 4 C 8
(6) 0 1 1 0 01 1 5 D 9
S6 = 0+4+5+6+8+9+A+B+C+E+F
(7) 0 1 1 1
(8) 1 0 0 0 S7 = 2+3+4+5+6+8+9+A+B+D+E+F 11 3 7 F B
(9) 1 0 0 1
(A) 1 0 1 0
10 2 6 E A
(B) 1 0 1 1
(C) 1 1 0 0 As we are using ad-hoc “binary-hex logic”
equations, (i.e. binary S… outputs as functions
(D) 1 1 0 1
of hex variables) it will useful in this case to have
(E) 1 1 1 0 hex-labeled Karnaugh map, instead of the usual 2-D
(F) 1 1 1 1 (i.e. two dimensional) binary labeled K maps. This
will allow for a more convenient mapping of the
“binary-hex” logic equations onto the K-maps.
© Emil M. Petriu
Hex-to-7 segment
B3 B2 S1 B3 B2 S2
Mapping the ad-hoc “binary-hex
logic” equations onto Karnaugh maps: B1 B0 00 01 11 10 B1 B0 00 01 11 10
00 1 0 1 1 00 1 1 0 1
01 0 1 0 1 01 1 0 1 1
B3 B2
11 1 1 1 0 11 1 1 0 0
B1 B0 00 01 11 10
10 1 1 1 1 10 1 0 0 1
00 0 4 C 8
01 1 5 D 9
11 3 7 F B B3 B2 S3 B3 B2 S4
10 2 6 E A B1 B0 00 01 11 10 B1 B0 00 01 11 10
00 1 1 0 1 00 1 0 1 1
S1 = 0+2 +3+5+6+7+8+9+A+C+E+F 01 01
1 1 1 1 0 1 1 1
S2 = 0+1+2+3+4+7+8+9+A+D
11 1 1 0 1 11 1 0 0 1
S3 = 0+1+3+4+5+6+7+8+9+A+B+D
10 0 1 0 1 10 1 1 1 0
S4 = 0+2+3+5+6+8+9+B+C+D+E
© Emil M. Petriu
Hex-to-7 segment
B3 B2 S5 B3 B2 S6
B1 B0 00 01 11 10 B1 B0 00 01 11 10
B3 B2 00 1 0 1 1 00 1 1 1 1
B1 B0 00 01 11 10 01 0 0 1 0 01 0 1 0 1
00 0 4 C 8 11 0 0 1 1 11 0 0 1 1
01 1 5 D 9 10 1 1 1 1 10 0 1 1 1
11 3 7 F B
10 2 6 E A
B3 B2 S7
B1 B0 00 01 11 10
00 0 1 0 1
S5 = 0+2+6+8+A+B+C+D+E+F
01 0 1 1 1
S6 = 0+4+5+6+8+9+A+B+C+E+F
11 1 0 1 1
S7 = 2+3+4+5+6+8+9+A+B+D+E+F
10 1 1 1 1
© Emil M. Petriu
SYSTEMS of LOGIC FUNCTIONS 2- bit Comparator
A1 A0 B1 B0 F1 F2 F3
(0) 0 0 0 0 1 0 0
(1) 0 0 0 1 0 0 1 Compare two 2-bit numbers:
(2) 0 0 1 0 0 0 1
(3) 0 0 1 1 0 0 1
(4) 0 1 0 0 0 1 0 A=B F1 = Σ (0,5,10,15)
(5) 0 1 0 1 1 0 0
(6) 0 1 1 0 0 0 1 A>B F2 = Σ (4,8,9,12,13,14)
(7) 0 1 1 1 0 0 1
(8) 1 0 0 0 0 1 0 A<B F3 = Σ (1,2,3,6,7,11)
(9) 1 0 0 1 0 1 0
(10) 1 0 1 0 1 0 0
(11) 1 0 1 1 0 0 1
(12) 1 1 0 0 0 1 0
(13) 1 1 0 1 0 1 0
(14) 1 1 1 0 0 1 0
(15) 1 1 1 1 1 0 0
© Emil M. Petriu
2- bit Comparator
© Emil M. Petriu
2- bit Comparator
A<B F3 = Σ (1,2,3,6,7,11)
A1A0
A1 A0 B1B0 00 01 11 10
00 0 0 0 0
B1 B0 00 01 11 10
01 1 0 0 0
00 0 4 12 8
11 1 1 0 1
01 1 5 13 9
10 1 1 0 0
11 3 7 15 11
10 2 6 14 10
F3 = A0B1B0 + A1B1 + A1A0B0
© Emil M. Petriu
2- bit Comparator
A1 A0
A>B F2 = Σ (4,8,9,12,13,14) B1 B0 00 01 11 10
00 0 4 12 8
A1A0
01 1 5 13 9
B1B0 00 01 11 10
11 3 7 15 11
00 0 1 1 1
10 2 6 14 10
01 0 0 1 1
11 0 0 0 0
10 0 0 1 0 F2 = F1 + F3
A1A0 F1+F3
A1A0 F1 A1A0 F3
B1B0 00 01 11 10
B1B0 00 01 11 10 B1B0 00 01 11 10
00 1 0 0 0
00 1 0 0 0 00 0 0 0 0
01 1 1 0 0
01 0 1 0 0 01 1 0 0 0
11 1 1 1 1
11 0 0 1 0 11 1 1 0 1
10 1 1 0 1
10 0 0 0 1 10 1 1 0 0
© Emil M. Petriu
2- bit Comparator F1 = (A0⊕B0) • (A1 ⊕ B1)
F2 = F1 + F3
F3 = A0B1B0+A1B1+A1A0B0
B1 B0 A1 A0
A1 ⊕ B1
F1 = (A0⊕B0) • (A1 ⊕ B1)
A0 ⊕ B0
F2 = F1 + F3
F3 = A0B1B0+A1B1+A1A0B0
© Emil M. Petriu
A B C
3-to-8 Decoder
F0
A B C F0 F1 F2 F3 F4 F5 F6 F7
F1
(0) 0 0 0 1 0 0 0 0 0 0 0
(1) 0 0 1 0 1 0 0 0 0 0 0 F2
(2) 0 1 0 0 0 1 0 0 0 0 0
(3) 0 1 1 0 0 0 1 0 0 0 0
(4) 1 0 0 0 0 0 0 1 0 0 0 F3
(5) 1 0 1 0 0 0 0 0 1 0 0
(6) 1 1 0 0 0 0 0 0 0 1 0 F4
(7) 1 1 1 0 0 0 0 0 0 0 1
F5
F6
F7
© Emil M. Petriu
E A B C
3-to-8 Decoder (74 138)
F0
A B C E F0 F1 F2 F3 F4 F5 F6 F7
(x) x x x 1 1 1 1 1 1 1 1 1 F1
(0) 0 0 0 0 0 1 1 1 1 1 1 1
(1) 0 0 1 0 1 0 1 1 1 1 1 1 F2
(2) 0 1 0 0 1 1 0 1 1 1 1 1
(3) 0 1 1 0 1 1 1 0 1 1 1 1
(4) 1 0 0 0 1 1 1 1 0 1 1 1 F3
(5) 1 0 1 0 1 1 1 1 1 0 1 1
(6) 1 1 0 01 1 1 1 1 1 0 1
F4
(7) 1 1 1 01 1 1 1 1 1 1 0
F5
F6
F7
© Emil M. Petriu
BCD-TO-7 SEGMENT DECODER
S1 B3 B2 B1 B0
_________________________
B3 B2
S6 S7 S2 (0) 0 0 0 0
B1 B0 00 01 11 10
(1) 0 0 0 1
S5 S3 (2) 0 0 1 0 00 0 4 x 8
S4
(3) 0 0 1 1
(4) 0 1 0 0 01 1 5 x 9
(5) 0 1 0 1 11 3 7 x x
(6) 0 1 1 0
(7) 0 1 1 1 10 2 6 x x
S7 S6 S5 S4 S3 S2 S1 (8) 1 0 0 0
7 SEGMENT (9) 1 0 0 1
(x) 1 0 1 0 “Don’t Care” states/situations.
BCD (x) 1 0 1 1 As it is expected that these
(x) 1 1 0 0 states are never going to occur,
(x) 1 1 0 1 then we may just as well use
(x) 1 1 1 0 them as fill-in “1s” in a
B3 B2 B1 B0 (x) 1 1 1 1 Karnaugh map if this helps to
make larger loopings
© Emil M. Petriu
BCD-to-7 segment
S1 S1 S1 S1 S1
S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2
B3 B2 B1 B0
_________________________
(0) 0 0 0 0 S5 S3 S5 S3 S5 S3 S5 S3 S5 S3
S4 S4 S4 S4 S4
(1) 0 0 0 1
(2) 0 0 1 0
(3) 0 0 1 1 S1 S1 S1 S1 S1
(4) 0 1 0 0
(5) 0 1 0 1 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2 S6 S7 S2
(6) 0 1 1 0
(7) 0 1 1 1 S5 S4 S3 S5 S4 S3 S5 S4 S3 S5 S4 S3 S5 S4 S3
(8) 1 0 0 0
(9) 1 0 0 1
(x) 1 0 1 0
(x) 1 0 1 1
(x) 1 1 0 0 S4 = 0+2+3+5+6+8+9
(x) 1 1 0 1 S1 = 0+2 +3+5+6+7+8+9 S5 = 0+2+6+8
(x) 1 1 1 0
S2 = 0+1+2+3+4+7+8+9 S6 = 0+4+5+6+8+9
(x) 1 1 1 1
S3 = 0+1+3+4+5+6+7+8+9 S7 = 2+3+4+5+6+8+9
© Emil M. Petriu
B3 B2
BCD-to-7 segment
B1 B0 00 01 11 10
00 0 4 x 8
S1 = 0+2 +3+5 01 1 5 x 9
+6+7+8+9
11 3 7 x x
10 2 6 x x S2 = 0+1+2+3
B3 B2 S1 +4+7+8+9
B1 B0 00 01 11 10
00 1 0 x 1 B3 B2 S2
B1 B0 00 01 11 10
01 0 1 x 1
00 1 1 x 1
11 1 1 x x
1 1 x x
01 1 0 x 1
10
11 1 1 x x
10 1 0 x x
S1 = B3 + B2B0 + B1
S2 = B3 + B2 + B1B0 + B1B0
+ B2B1 + B2B0
© Emil M. Petriu
BCD-to-7 segment
B3 B2
B1 B0 00 01 11 10
00 0 4 x 8
01 1 5 x 9
11 3 7 x x
S3 = 0+1+3+4+5+6+7+8+9 S4 = 0+2+3+5+6+8+9
10 2 6 x x
B3 B2 S3 B3 B2 S4
B1 B0 00 01 11 10 B1 B0 00 01 11 10
00 1 1 x 1 00 1 0 x 1
01 1 1 x 1 01 0 1 x 1
11 1 1 x x
11 1 0 x x
10 0 1 x x
10 1 1 x x
© Emil M. Petriu
B3 B2
BCD-to-7 segment
B1 B0 00 01 11 10
00 0 4 x 8 S7 = 2+3+4+5+6+8+9
01 1 5 x 9
B3 B2 S7
11 3 7 x x
B1 B0 00 01 11 10
10 2 6 x x
00 0 1 x 1
01 0 1 x 1
S5 = 0+2+6+8 S6 = 0+4+5+6+8+9
11 1 0 x x
B3 B2 S5 B3 B2 S6 10 1 1 x x
B1 B0 00 01 11 10 B1 B0 00 01 11 10
00 1 0 x 1 00 1 1 x 1 S7 = B3 + B2B1
01 0 0 x 0 01 0 1 x 1
+ B1B2 + B1B0
11 0 0 x x 11 0 0 x x
10 1 1 x x 10 0 1 x x
R= 0 Q =1
Q R= 1 Q =0
R
S =1 Q =0
S R Q Q S =1 Q =1
0 0 1 1 Weird state
0 1 1 0 Set state
1 0 0 1 Reset state
1 1 Q Q Hold state Q =1
R= 0 Q =0
R= 1
© Emil M. Petriu
D (Transparent) Latch
S
D
Q
Enable D Q Q
0 x Q Q
Q 1 0 0 1
R 1 1 1 0
Enable
© Emil M. Petriu
D Latch
S
D Enable D S R Q Q
Q
0 0 1 1 Q Q
0 1 1 1 Q Q
Q 1 0 1 0 0 1
R 1 1 0 1 1 0
Enable
1
Enable
0
1
D 0
1
S 0
1
R 0
Hold 1
Q 0
© Emil M. Petriu
Latch 1 Latch 2
Synchronous D Flip-Flop
D1
D D Q D Q Q
Positive-Edge
D Q
-Triggered
Enab. Q Enab. Q Q D Flip-Flop
CLK
Q
CLK
EN1 EN2
1
D Din* Input data D may change
0
1
CLK 0
1
EN1 Latch 1 is Latch 1 is Holding Latch 1 is Transparent
Transparent 0
1
D1 D1 = Din* Changed input data D enter Latch 1
0
1
EN2 Latch 2 is Holding Latch 2 is Transparent Latch 2 is Holding
0
1
Q Q = D1 = Din* 0
The state of the flip-flop’s output Q copies input Positive-Edge-Triggered
D when the positive edge of the clock CLK occurs D Flip-Flop
© Emil M. Petriu
Synchronous D Flip-Flop
Connection diagram
of the 7474 Dual
Positive-Edge-Triggered
D Flip-Flops with Preset
and Clear.
1 2 3 4 5 6 7
Q3 Q2 Q1 Q0
0 1 2 3 4 5
CL
4-Bit BINARY COUNTER 15 6
14 7
CK CL
3 13 12 11 10 9 8
Q = Σ Qi 2i .
i=0
1
CK
0
1
CL 0
Q 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6
© Emil M. Petriu
Synchronous 4-bit Counter
DECIMAL BINARY STATE OF FLIP FLOP INPUTS
STATE THE COUNTER (for the next state)
Q3 Q2 D3 Q3 Q2 D2 Q3 Q2 D1 Q3 Q2 D0
Q1 Q0 00 01 11 10 Q1 Q0 00 01 11 10 Q1 Q0 00 01 11 10 Q1 Q0 00 01 11 10
00 0 0 1 1 00 0 1 1 0 00 0 0 0 0 00 1 1 1 1
01 0 0 1 1 01 0 1 1 0 01 1 1 1 1 01 0 0 0 0
11 0 1 0 1 11 1 0 0 1 11 0 0 0 0 11 0 0 0 0
10 0 0 1 1 10 0 1 1 0 10 1 1 1 1 10 1 1 1 1
© Emil M. Petriu
Synchronous 4-bit Counter
Q3 Q2 D3 Q3 Q2 D2
Q1 Q0 00 01 11 10 Q1 Q0 00 01 11 10
00 0 0 1 1 00 0 1 1 0
01 0 0 1 1 01 0 1 1 0
11 0 1 0 1 11 1 0 0 1
10 0 0 1 1 10 0 1 1 0
Q3 Q2 D1
Q3 Q2 D0
Q1 Q0 00 01 11 10
Q1 Q0 00 01 11 10
00 0 0 0 0 D1 = Q1. Q0 + Q1. Q0 D0 = Q0
00 1 1 1 1
01 1 1 1 1
01 0 0 0 0
11 0 0 0 0 11 0 0 0 0
10 1 1 1 1
10 1 1 1 1
© Emil M. Petriu
Synchronous 4-bit Counter CL CK
Q0
D Q
CLK Q0
Q
R
D0 = Q0
Q1
D Q
D1 = Q1. Q0 + Q1. Q0
CLK Q1
D2 = Q2. Q0 + Q2. Q1 + Q2. Q1. Q0 Q
R
CLK Q2
Q
R
Q3
D Q
CLK Q3
Q
R
© Emil M. Petriu