Professional Documents
Culture Documents
Part-2
2B: 1, 2, 3, 4
Contents of Part-2
Sequential Circuits Registers Memories CAD for digital circuit: Basic VHDL Digital Integrated Circuits: Basic and Applications
2
Sequential Circuits
A Short Review of Part-1 Synchronous Sequential Circuits - Introduction - Analysis and Design - Examples - Homework - Conclusion
3
Objectives
Sequential
4
Part-1 Review
In the latter part of the 19th century, George Boole, a philosophers and mathematicians, suggested that logical thought could be represented through mathematical equations.
At least one Boolean variable, At least one Boolean operator, and At least one input from the set {0,1}.
is shown at the right. To make evaluation of the Boolean function easier, the truth table contains extra (shaded) columns to hold evaluations of subparts of the function.
9
With this in mind, we always want to reduce our Boolean functions to their simplest form. There are a number of Boolean identities that help us to do this.
11
12
13
14
15
16
is:
17
In order to eliminate as much confusion as possible, designers express Boolean functions in standardized or canonical form.
18
We note that this function is not in simplest terms. Our aim is only to rewrite our function in canonical sum-of-products form.
21
They correspond directly to their respective Boolean operations, as you can see by their truth tables.
23
25
27
30
31
32
33
34
Sequential Circuits
Combinational logic circuits are perfect for situations when we require the immediate application of a Boolean function to a set of inputs. There are other times, however, when we need a circuit to change its value with consideration to its current state as well as its inputs.
These circuits have to remember their current state.
41
Sequential Circuits
Asynchronous
Inputs Combinational Circuit Memory Elements Outputs
Synchronous
Inputs Combinational Circuit Flip-flops Clock Outputs
Sequential Circuits
As the name implies, sequential logic circuits require a means by which events can be sequenced. State changes are controlled by clocks. A clock is a special circuit that sends electrical pulses through a circuit. Clocks produce electrical waveforms such as the one shown below.
43
Sequential Circuits
State changes occur in sequential circuits only when the clock ticks. Circuits can change state on the rising edge, falling edge, or when the clock pulse reaches its highest voltage.
44
Sequential Circuits
Circuits that change state on the rising edge, or falling edge of the clock pulse are called edgetriggered. Level-triggered circuits change state when the clock voltage reaches its highest or lowest level.
45
Sequential Circuits
The behavior of sequential circuits can be expressed using characteristic tables or finite state machines (FSMs).
FSMs consist of a set of nodes that hold the states of the machine and a set of arcs that connect the states.
Moore and Mealy machines are two types of FSMs that are equivalent.
They differ only in how they express the outputs of the machine.
Moore machines place outputs on each node, while Mealy machines present their outputs on the transitions.
46
47
SR Latch
0 0
Latches
S R Q0 0 0 0 Q 0 Q 1
Q=Q 0
Initial Value
Latches
SR Latch
0 1
S R Q0 0 0 0 0 0 1 Q 0 1 Q 1 0
Q=Q 0 Q=Q 0
Latches
SR Latch
1 0
S 0 0 0 R 0 0 1 Q0 0 1 0 Q 0 1 0 Q 1 0 1
Q=Q 0 Q=0
Latches
SR Latch
1 1
S 0 0 0 0 R 0 0 1 1 Q0 0 1 0 1 Q 0 1 0 0 Q 1 0 1 1
Q=Q 0 Q=0 Q=0
Latches
SR Latch
0 0
S 0 0 0 0 1 R 0 0 1 1 0 Q0 0 1 0 1 0 Q 0 1 0 0 1 Q 1 0 1 1 0
Q=Q 0 Q=0 Q=1
Latches
SR Latch
0 1
S 0 0 0 0 1 1 R 0 0 1 1 0 0 Q0 0 1 0 1 0 1 Q 0 1 0 0 1 1 Q 1 0 1 1 0 0
Q=Q 0 Q=0 Q=1 Q=1
Latches
SR Latch
1 0
S 0 0 0 0 1 1 1 R 0 0 1 1 0 0 1 Q0 0 1 0 1 0 1 0 Q 0 1 0 0 1 1 0 Q 1 0 1 1 0 0 0
Q=Q 0 Q=0
Q=1 Q = Q
1 0
Latches
SR Latch
1 1 0
S 0 0 0 0 1 1 1 1 R 0 0 1 1 0 0 1 1 Q0 0 1 0 1 0 1 0 1 Q 0 1 0 0 1 1 0 0 Q 1 0 1 1 0 0 0 0
Q=Q 0 Q=0
Q=1 Q = Q Q = Q
Latches
SR Latch
S R 0 0 1 1 S 0 0 1 1 0 1 0 1 Q Q0 0 1 Q=Q=0
No change Reset Set Invalid
Q R 0 Q=Q=1 1 1 0 0 Q0 1
Latches
SR Latch
S R 0 0 1 1 0 1 0 1 Q Q0 0 1 Q=Q=0 Q Q=Q=1 1 0 Q0
Invalid Set Reset No change No change Reset Set Invalid
S R 0 0 1 1 0 1 0 1
Controlled Latches
SR Latch with Control Input
C S R 0 1 1 1 1 x 0 0 1 1 x 0 1 0 1
Q Q0 Q0 0 1 Q=Q
Controlled Latches
D Latch (D = Data)
C D Timing Diagram
C D 0 x 1 0 1 1
Q Q0 0 1
Controlled Latches
D Latch (D = Data)
C D Timing Diagram
C D 0 x 1 0 1 1
Q Q0 0 1
Flip-Flops
Controlled latches are level-triggered
C
CLK
Negative Edge
Flip-Flops
Master-Slave D Flip-Flop
D D D Latch C (Master) Q D D Latch C (Slave) Q Q
Master
Slave
CLK CLK
Q Master Q Slave
Flip-Flops
Edge-Triggered D Flip-Flop
D Q
Q Positive Edge
Q CLK
D Q
Q
Q Negative Edge
Flip-Flops
JK Flip-Flop
D = JQ + KQ
K Q
Flip-Flops
T Flip-Flop
T J Q T D Q
D = JQ + KQ D = TQ + TQ = T Q
D 0 1 J 0 0 1 1 T 0 1
Reset Set
Q No change Toggle
D 0 1 J 0 0 1 1 T 0 1
Q(t+1) = D
Q(t+1) = JQ + KQ
Q Q(t+1) = T Q
K 0 J 1 1 1 Q 0 0 0 1
Q(t+1) = JQ + KQ
R 0
D CLK Q(t+1) x x 0
Q R Reset
Q R Reset
R 0 1 1
D CLK Q(t+1) x x 0 0 0 1 1
Q CLR Reset
Q CLR Reset
Q CLR Reset
Example AB=00
x D Q Q A
D CLK
Q Q
Q Q
A 0 0 0 0 1 1 1 1
t
B 0 0 1 1 0 0 1 1
x 0 1 0 1 0 1 0 1
A 0 0 0 1 0 1 0 1
t+1
B 0 1 0 1 0 0 0 0
t
y 0 0 1 0 1 0 1 0
D CLK
Q Q
A 0 0 1 1
t
B 0 1 0 1
A 0 0 0 0
B 0 0 0 0
t+1
A 0 1 1 1
B 1 1 0 0
y 0 1 1 1
t
y 0 0 0 0
D CLK
Q Q
Present State
input/output
A B 0 0 0 1 1 0 1 1
A B A B 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0
y 0 1 1 1
y 0 0 0 0
0/0 0/1
00
1/0
10
x
Q Q
D CLK
Q Q
01
11
1/0
A 0 0 0 0 1 1 1 1
x 0 0 1 1 0 0 1 1
y 0 1 0 1 0 1 0 1
A 0 1 1 0 1 0 0 1
A(t+1) = D = A x y A
01,10 00,11 0 01,10 1 00,11
J K CLK
Q Q
K = B x A K =Ax B
0/0
00
0/0 1/0
01
1/1
1/0
0/1
1/0
0/0
The Moore model: the outputs are functions of the present state only (Fig. 5-20).
The outputs are synchronous with the clocks.
Moore
I/P x 0 1 0 1 0 1 0 1 Next O/P State A B y 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 1
For the same state state, the output changes with the input
For the same state state, the output does not change with the input
11/1
10/0
1 0
State diagram
State Reduction
State: a a b c d e f f g f g a Input: 0 1 0 1 0 1 1 0 1 0 0
Output:
0 0 0 0 0 1 1 0 1 0 0
Only the input-output sequences are important. Two circuits are equivalent
Have identical outputs for all input sequences; The number of states is not important.
State diagram
Equivalent states
Two states are said to be equivalent
For each member of the set of inputs, they give exactly the same output and send the circuit to the same state or to an equivalent state. One of them can be removed.
State: Input:
Output:
a 0 0
a 1 0
b 0 0
c 1 0
d 0 0
e 1 1
d 1 1
d 0 0
e 1 1
d 0 0
e 0 0
State Reduction
The checking of each pair of states for possible equivalence can be done systematically using Implication Table. The unused states are treated as don't-care condition fewer combinational gates.
State Assignment
State Assignment To minimize the cost of the combinational circuits. Three possible binary state assignments. (m states need n-bits, where 2n > m)
State Assignment
Any binary number assignment is satisfactory as long as each state is assigned a unique number. Use binary assignment 1.
Design Procedure
Design Procedure for sequential circuit
The word description of the circuit behavior to get a state diagram; State reduction if necessary; Assign binary values to the states; Obtain the binary-coded state table; Choose the type of flip-flops; Derive the simplified flip-flop input equations and output equations; Draw the logic diagram;
State A B S0 0 0 S1 0 1 S2 1 0 1 1 S3
S /1 3 1 1
S /0 2
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
x 0 1 0 1 0 1 0 1
A 0 0 0 1 0 1 0 1
B 0 1 0 0 0 1 0 1
y 0 0 0 0 0 0 1 1
0 S /0 0
1 S /0 1 0 0 1
S /1 3 1 1
S /0 2
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
x 0 1 0 1 0 1 0 1
A 0 0 0 1 0 1 0 1
B 0 1 0 0 0 1 0 1
y 0 0 0 0 0 0 1 1
B 0 0 1 0 A 0 1 1 0 x B 0 1 0 0 A 0 1 1 0 x
B
y (A, B, x) = (6, 7) =AB
0 0 0 0 A 0 0 1 1 x
Q(t) Q(t+1) 0 0 0 1 1 0 1 1
D 0 1 0 1
Design of Clocked Sequential Circuits with JK F.F. Example: Detect 3 or more consecutive 1s
Present Input State Next State Flip-Flop Inputs
Synthesis using JK F.F. J (A, B, x) = (3) A d JA (A, B, x) = (4,5,6,7)
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
x 0 1 0 1 0 1 0 1
A 0 0 0 1 0 1 0 1
B JA 0 0 1 0 0 0 0 1 0 x 1 x 0 x 1 x
KA JB KB x 0 x x 1 x x x 1 x x 1 1 0 x 0 1 x 1 x 1 0 x 0
Design of Clocked Sequential Circuits with JK F.F. Example: Detect 3 or more consecutive 1s
Synthesis using JK Flip-Flops
J = B x K = x A A J =x B K = A + x B
B 0 0 1 0 A x x x x x B 0 1 x x A 0 1 x x x
B x x x x A 1 0 0 1 x B x x 1 1 A x x 0 1 x
Design of Clocked Sequential Circuits with T F.F. Example: Detect 3 or more consecutive 1s
Present Input State Next State F.F. Input
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
x 0 1 0 1 0 1 0 1
A 0 0 0 1 0 1 0 1
B 0 1 0 0 0 1 0 1
TA 0 0 0 1 1 0 1 0
TB 0 1 1 1 0 1 1 0
Design of Clocked Sequential Circuits with T F.F. Example: Detect 3 or more consecutive 1s
Synthesis using T Flip-Flops
T = A x + A B x A T = A B + B x B
B 0 0 1 0 A 1 0 0 1 x
B 0 1 1 1 A 0 1 0 1 x
Sequential Circuits
111
Sequential Circuits
This is an ASM for a microwave oven.
112
Inputs
Outputs
Storage Elements
20
Combinational Success depends only on the values, not the order in which they are set.
Sequential Success depends on the sequence of values (e.g, R-13, L-22, R-3).
State
The state of a system is a snapshot of all the relevant elements of the system at the moment the snapshot is taken. Examples: The state of a basketball game can be represented by the scoreboard. Number of points, time remaining, possession, etc. The state of a tic-tac-toe game can be represented by the placement of Xs and Os on the board.
DANGER
MOVE RIGHT
3-118
State bit S 1
3-119
In S1 0 0 1 1 S0 0 1 0 1 Z 0 1 1 1 Y 0 0 1 1 X 0 0 0 1 0 1 1 1 1
Whenever In=0, next state is 00.
S1 X 0 0 1 1
S0 S1 S0 X 0 1 0 1 0 0 1 1 0 0 1 0 1 0
3-120
Master-slave flipflop
3-121
Conclusion
Computers are implementations of Boolean logic. Boolean functions are completely described by truth tables. Logic gates are small circuits that implement Boolean operators. The basic gates are AND, OR, and NOT.
The XOR gate is very useful in parity checkers and adders.
Conclusion
Computer circuits consist of combinational logic circuits and sequential logic circuits. Combinational circuits produce outputs (almost) immediately when their inputs change. Sequential circuits require clocks to control their changes of state. The basic sequential circuit unit is the flip-flop: The behaviors of the SR, JK, and D flip-flops are the most important to know.
123
Conclusion
The behavior of sequential circuits can be expressed using characteristic tables or through various finite state machines. Moore and Mealy machines are two finite state machines that model high-level circuit behavior. Algorithmic state machines are better than Moore and Mealy machines at expressing timing and complex signal interactions. Examples of sequential circuits include memory, counters, and Viterbi encoders and decoders.
124