Professional Documents
Culture Documents
FF
Clear
CLK
Preset
Example: T Flip-Flop
CLK
Clear
Preset
Q
Equal to 1
because of Preset
Goes to 0 because
of toggle
Goes to 1 because
of toggle
Goes to 0 because
of Clear
4
Synchronized Adder
The D flip-flop is the simplest of all the flip-flop
D stands for delay because Q will be simply equal to D at the clock edge
Lets say we want to create a synchronized adder that give A+B at the edge
of the clock;
We simply give the result to a D flip-flop
X1 X0
S2
Y1 Y0
Adder
S1
S0
Clk
Clk
Q
S2
D
Q
Clk
Q
S1
D
Q
Clk
Q
D
Q
S0
5
Exercise
a)
b)
c)
Q+
1
1
D = JQ + KQ
a)
We fill the truth table of the
JK flip-flop and we make D
equal to Q+ .
D stands for delay flip-flop
because Q will be equal to D.
KQ J
0
Exercise
a)
b)
c)
T = D xor Q
Q+
b)
Exercise
a)
b)
c)
CE
Q+
1
1
T = CE.D.Q + CE.D.Q
= CE (DQ + DQ)
= CE (D xor Q)
c)
We fill the truth table of the
D flip-flop with clock enable.
We then fill the values of T to
have the correct Q-to-Q+
transitions.
DQ
CE
0
Q is updated
throughout the
clock level
Q is updated at
the edge only
In the book:
The positive and negative level trigger elements are called latches
The positive and negative edge trigger elements are called flip-flops
Review
Examples and Exercises
Decoder Expansion
Smaller decoders can be used to build larger decoders.
e.g. using two 2-4 decoders we can build a 3-8 decoder or
using two 3-to-8 decoders we can build a 4-to-16 decoder
7-Segment Display
a b c d e f g
0 0 0 0
1 1 1 1 1 1 0
0 0 0 1
0 1 1 0 0 0 0
0 0 1 0
1 1 0 1 1 0 1
0 0 1 1
1 1 1 1 0 0 1
0 1 0 0
0 1 1 0 0 1 1
0 1 0 1
1 0 1 1 0 1 1
0 1 1 0
1 0 1 1 1 1 1
0 1 1 1
1 1 1 0 0 0 0
7-Segment Display
a b c d e f g
10
9
X
1 1 1 1 0 1 1
X X X X X X X
11
X X X X X X X
12
X X X X X X X
13
X X X X X X X
14
X X X X X X X
15
X X X X X X X
a = S m(0, 2, 3, 5, 6, 7, 8, 9 ) + S d ( 10-15 )
b = S m ( 0,1, 2, 3, 4, 7, 8, 9 )+ S d ( 10-15 )
c = S m( 0,1, 3-9 )+ S d ( 10-15 )
d = S m ( 0, 2, 3, 5, 6, 8, 9 )+ S d ( 10-15 )
e = S m ( 0, 2, 6, 8 )+ S d ( 10-15 )
f = S m ( 0, 4, 5, 6, 8, 9 )+ S d ( 10-15 )
g = S m ( 2, 3, 4, 5, 6, 8, 9 )+ S d ( 10-15 )
Output a
a = S m( 0, 2, 3, 5, 6, 7, 8, 9 )+ S d ( 10-15 )
x3x4
x1x2
00
00
01
a = x1 + x3 + x2 x4 + x2 x4
01
11
10
11
10
12
13
15
11
f(x1,x2,x3,x4)
14
10
Output b
B = S m( 0, 1, 2, 3, 4, 7, 8, 9 )+ S d ( 10-15 )
x3x4
x1x2
00
01
11
00
01
11
X
12
10
1
3
1
4
B x2 x 3 x 4 x 3 x 4
10
13
15
1
8
14
X
11
f(x1,x2,x3,x4)
10
a = x1 + x3 + x2 x4 + x2 x4
b = x2 + x3 x4 + x3 x4
c = x2 + x3 + x4
d = x1 + x2 x3 + x3 x4 + x2 x4 + x2 x3 x4
e = x2 x4 + x3 x4
f = x1 + x2 x3 + x3 x4 + x2 x4
g = x1 + x2 x3 + x2 x3 + x3 x4
Encoders
Performs the inverse
operation of a decoder
Has 2n input lines and n
output lines
The output generates
the binary code
corresponding to the
input value
Encoders can be
implemented directly
from the truth table
using OR gates
2n
Inputs
Encoder
Combinatio
nal Logic
Circuit
n
Outputs
21
Examples of Encoders
Octal to Binary Encoder
Only one input
has a value of 1
at a time
What If D3 and
D6 are both 1s
at the same
time?
An encoder
needs to
establish
priority
22
Examples of Encoders
Priority Encoder
Is an encoder that includes
a priority function, which
resolves the issue of having
two active inputs at the
same time
If two input are active at
the same time, the input
with higher priority takes
precedence.
D3 has the highest priority,
then D2 , D1, and D0.
Inputs
Outputs
D0 D1 D2 D3
Priority Encoder
Determining Boolean expressions for the 4-to-2 priority
encoders outputs
24
Multiplexers
26
S
D0
D1
Y
D0
function table
Truth table
S
0
0
0
0
1
1
1
1
D1
0
0
1
1
0
0
1
1
Y = D0S + D1S
D0
0
1
0
1
0
1
0
1
Y
0
1
0
1
0
0
1
1
S
0
1
Y
D0
D1
S
D1
28