Sequential Circuits (2)
- Prof. Usagi
Sequential Circuits (2) Prof. Usagi Recap: Combinational v.s. - - PowerPoint PPT Presentation
Sequential Circuits (2) Prof. Usagi Recap: Combinational v.s. sequential logic Combinational logic The output is a pure function of its current inputs The output doesnt change regardless how many times the logic is triggered
triggered — Idempotent
2
Recap: Combinational v.s. sequential logic
Sequential circuit has memory!
Boolean Algebra function with only Boolean Variables as their inputs
Finite-State Machine
3
Recap: Theory behind each
cannot avoid the “intensional” 1,1 inputs
memory
4
Recap: 4-different types of bit storage
Positive-edge-triggered D flip-flop
5
Q Clock Data Q
6
Recap: Clock signal
0ns 10ns 20ns 30ns 40ns 50ns 60ns 70ns 80ns 90ns
7
Outline
8
Which is the most likely circuit realization of Life on Mars
9
S0 S1 S2
0/0 0/0 1/1 0/0 1/0 (A) input (D)
Combinational Circuit
input
(B) 1/0
Combin ational Circuit
input
D Flip- flop D Q CLK
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
(C)
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
Poll close in
Which is the most likely circuit realization of Life on Mars
10
S0 S1 S2
0/0 0/0 1/1 0/0 1/0 (A) input (D)
Combinational Circuit
input
(B) 1/0
Combin ational Circuit
input
D Flip- flop D Q CLK
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
(C)
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
We need memory We have 3 states — 2-bit memory We still need input for transition
11
Sequential Circuit Design Flow
Life on Mars
12
S0 S1 S2
0/0 0/0 1/0 1/1 0/0 1/0
Current State Next State, Output Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1
State Diagram State Diagram input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
Life on Mars
13
S0 S1 S2
0/0 0/0 1/0 1/1 0/0 1/0
Current State Next State, Output Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1
State Diagram State Diagram State Assignment
S0 00 S1 01 S2 10
input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
Life on Mars
14
S0 S1 S2
0/0 0/0 1/0 1/1 0/0 1/0
Current State Next State, Output Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1
State Diagram State Diagram State Assignment
S0 00 S1 01 S2 10
State Truth Table
State\Input
1 00 01, 0 00, 0 01 10, 0 00, 0 10 10, 0 00, 1
input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
combinational circuit that provides inputs for the flip-flops in the sequential circuit. How many rows are there in the excitation table of Life on Mars?
15
Excitation Table
input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
Poll close in
combinational circuit that provides inputs for the flip-flops in the sequential circuit. How many rows are there in the excitation table of Life on Mars?
16
Excitation Table
input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
Life on Mars
17
State Truth Table
State\Input
1 00 01, 0 00, 0 01 10, 0 00, 0 10 10, 0 00, 1
Excitation Table
NextStateOput StateInput
D1 D0 y 000 001 010 011 100 101 110 111
input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK 1 1 1 1 X X X X X X
Life on Mars
18
State Truth Table
State\Input
1 00 01, 0 00, 0 01 10, 0 00, 0 10 10, 0 00, 1
Excitation Table
NextStateOput StateInput
D1 D0 y 000 1 001 010 1 011 100 1 101 1 110 X X X 111 X X X
K-Map — D1 0,0 0,1 1,1 1,0 1 D1 = x’Q0+x’Q1 K-Map — D0 0,0 0,1 1,1 1,0 1 D0 = Q0’Q1’x’ K-Map — y 0,0 0,1 1,1 1,0 1 y = Q1’x input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
1 X 1 X 1 X X X X 1
x y
Circuit — Life on Mars
19
D1 = x’Q0+x’Q1 D0 = Q0’Q1’x’ y = Q1’x
D Flip- flop D Q0 D Flip- flop D Q1
Clk input
Combin ational Circuit
D Flip- flop D Q
D Flip- flop D Q CLK
20
Canonical Form: Mealy and Moore Machines
21
C1 C2
y(t) S(t) Clk x(t)
C1 C2
y(t) S(t) Clk x(t) yi(t) = fi(x(t), S(t)) yi(t) = fi(S(t)) Mealy Machine Moore Machine Result only depends on the current state Result depends on both input and the current state
Si Sj
input/output
Si Sj
input
Si(t+1) = gi(x(t), S(t)) Si(t+1) = gi(x(t), S(t))
pattern recognizer of “001”.
22
Moore or Mealy? — Life on Mars
Poll close in
C1 C2
y(t) Clk x(t) Moore Machine
C1 C2
y(t) S(t) Clk x(t) Mealy Machine
pattern recognizer of “001”.
23
Moore or Mealy? — Life on Mars
C1 C2
y(t) Clk x(t) Moore Machine
C1 C2
y(t) S(t) Clk x(t) Mealy Machine
implement pattern recognizer “001”?
24
Moore machine for Life on Mars
C1 C2
y(t) Clk x(t) Moore Machine
Poll close in
Si Sj
input
implement pattern recognizer “001”?
25
Moore machine for Life on Mars
C1 C2
y(t) Clk x(t) Moore Machine
Si Sj
input
① Identify distinct (Next State, y) pair ② Replace each distinct (Next State, y) pair with distinct new states ③ Insert rows of present state = new states ④ Append each present state with its output y
26
Conversion from Mealy to Moore
Current State Next State Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1 Current State Next State Output Input 1 S0 S1 S0 S1 S2 S0 S2 S2 S3 S3
① Identify distinct (Next State, y) pair ② Replace each distinct (Next State, y) pair with distinct new states ③ Insert rows of present state = new states ④ Append each present state with its output y
next states with respect to present state S3?
27
Conversion from Mealy to Moore
Current State Next State Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1 Current State Next State Output Input 1 S0 S1 S0 S1 S2 S0 S2 S2 S3 S3
Poll close in
① Identify distinct (Next State, y) pair ② Replace each distinct (Next State, y) pair with distinct new states ③ Insert rows of present state = new states ④ Append each present state with its output y
next states with respect to present state S3?
28
Conversion from Mealy to Moore
Current State Next State Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1 Current State Next State Output Input 1 S0 S1 S0 S1 S2 S0 S2 S2 S3 S3 S1 S0 1
① Identify distinct (Next State, y) pair ② Replace each distinct (Next State, y) pair with distinct new states ③ Insert rows of present state = new states ④ Append each present state with its output y
29
Conversion from Mealy to Moore
Current State Next State Input 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1 Current State Next State Output Input 1 S0 S1 S0 S1 S2 S0 S2 S2 S3 S3 S1 S0 1
State tables for C1 and C2
30
C1 C2
y(t) Clk x(t) Moore Machine
Current State Next State Output Input 1 S0 S1 S0 S1 S2 S0 S2 S2 S3 S3 S1 S0 1
00 01 10 11
State y 00 01 10 11 1
C2 C1
CurrentState-Input
D1 D0 000 1 001 010 1 011 100 1 101 1 1 110 1 111
State tables for C1 and C2
31
C1 C2
y(t) Clk x(t) Moore Machine
Current State Next State Output Input 1 S0 S1 S0 S1 S2 S0 S2 S2 S3 S3 S1 S0 1
00 01 10 11
State y 00 01 10 11 1
C2 C1
CurrentState- Input
D1 D0 000 1 001 010 1 011 100 1 101 110 1 111
K-Map — D1 0,0 0,1 1,1 1,0 1 1 1 1 D1 = x’Q1’Q0+Q1Q0’ K-Map — D0 0,0 0,1 1,1 1,0 1 1 1 1 D0 = Q0’Q1’x’ + Q0Q1x’ + Q0’Q1x’ K-Map — y 1 1 1 y = Q0Q1
32
The delay is determined by the “critical path”
33
C0 B0 A0 C1 B1 A1 C2 B2 A2 C3 B3 A3 Cout0 O0 Cout1 O1 Cout2 O2 Cout3 O3 C4 B4 A4 Cout4 O4 Available in the very beginning Only this is available in the beginning
2-gate delay
not (except the c0).
34
CLA (cont.)
A0 B0 A1 B1 A2 B2 A3 B3 O0 O1 O2 C0 Cout
Carry-lookahead Logic C1 C2 C3 G0 P0 G1 P1 G2 P2 G3 P3
O3
FA FA FA FA C1 = G0 + P0 C0 C2 = G1 + P1 C1 Gi = AiBi Pi = Ai XOR Bi C3 = G2 + P2 C2 C4 = G3 + P3 C3 = G1 + P1 (G0 + P0 C0) = G1 + P1G0 + P1P0C0 = G2 + P2 G1 + P2 P1G0 + P2 P1P0C0 = G3 + P3 G2 + P3 P2 G1 + P3 P2 P1G0 + P3 P2 P1P0C0
35
CLA v.s. Carry-ripple
Win! Win! Area-Delay Trade-off!
36
The basic idea
37
C1 C2
y(t) S(t) Clk x(t) Mealy Machine
C1 C2
Clk ai Si bi Feed ai and bi and generate si at time i. Where is ci and ci+1? ci ci+1
Excitation Table of Serial Adder
38
ai bi ci ci+1 si 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Excitation Table of Serial Adder
39
ai bi ci ci+1 si 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
ai bi si
D Flip- flop D Q
40
41
–Rick Warren
"A lie doesn't become truth, wrong doesn't become right and evil doesn't become good, just because it is accepted by a majority."
42
–Benjamin Franklin
Honesty is the best policy
43
44
–William Shakespeare
Better three hours too soon, than one minute too late.
45
–Sir John Lubbock
In truth, people can generally make time for what they choose to do; it is not really the time but the will that is lacking.
46
–Prof. Usagi
Don’t over-commit
47
Midterm
48
10 20 30 40 50 60 70 80 90 100 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67
Average: 79
Weighted Total — what really decides your final grades
49
10 20 30 40 50 60 70 80 90 100 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67
A+ A, A- B+, B, B- C+, C, C- Final Exam
We drop: 2 lowest reading quizzes 1 lowest lab 1 lowest assignment 25% attendance
F
5.2-5.4
50
Announcement