-- Introduction to Sequential Devices 04-710-302 Digital System Design I
description
Transcript of -- Introduction to Sequential Devices 04-710-302 Digital System Design I
-- Introduction-- Introduction to Sequential to Sequential DevicesDevices
- - 04710302 Digital Sy- - 04710302 Digital Syssss ssssss sssss ssssss s
2
OutlineOutline
Combinational Circuits vs. Sequential CircuitsCombinational Circuits vs. Sequential Circuits Flip-FlopFlip-Flop
Binary cell that can store one bit of information.Binary cell that can store one bit of information. Basic Flip-Flop CircuitBasic Flip-Flop Circuit Common Types of Flip-Flops: RS, JK, D, T.Common Types of Flip-Flops: RS, JK, D, T.
Mealy Machine and Moore MachineMealy Machine and Moore Machine Design Flow of Sequential SystemDesign Flow of Sequential System Synthesis and Optimization Synthesis and Optimization ExamplesExamples
3
Combinational CircuitsCombinational Circuits
A circuit is A circuit is combinationalcombinational if it computes a function if it computes a function which depends only on the current inputs applied which depends only on the current inputs applied to the circuit; to the circuit; for every input set of values, there is a unique output set of values. Acyclic circuits are necessarily combinationalAcyclic circuits are necessarily combinational Cyclic circuits can be combinational Cyclic circuits can be combinational
• in fact, there are combinational circuits whose in fact, there are combinational circuits whose minimal implementation must have cycles [Kautz minimal implementation must have cycles [Kautz 1970]1970]
4
Sequential CircuitsSequential Circuits
In a In a sequential sequential circuit, the output values may be circuit, the output values may be different for the same set of input values; the different for the same set of input values; the output depends on the current contents of output depends on the current contents of memory elements as well.memory elements as well. Feedback (cyclic) is a necessary condition for a circuit Feedback (cyclic) is a necessary condition for a circuit
to be sequential.to be sequential. Synthesis of sequential circuits is not as well Synthesis of sequential circuits is not as well
developed as combinational. (only small circuits)developed as combinational. (only small circuits) Sequential synthesis techniques are not really used in Sequential synthesis techniques are not really used in
commercial software (except maybe retiming). commercial software (except maybe retiming).
5
StateState เนื่��องจากเอาท์�พุ ตของ เนื่��องจากเอาท์�พุ ตของ Sequential Circuit Sequential Circuit นื่อกจากจะนื่อกจากจะ
ข��นื่อยู่��ก�บอ�นื่พุ ตปั�จจ บ�นื่แล้�ว ยู่�งข��นื่ก�บค่�าของอ�นื่พุ ตในื่อดี#ตข��นื่อยู่��ก�บอ�นื่พุ ตปั�จจ บ�นื่แล้�ว ยู่�งข��นื่ก�บค่�าของอ�นื่พุ ตในื่อดี#ตดี�วยู่ ดี�งนื่��นื่ การแสดีงเอาท์�พุ ตโดียู่ใช้�ตารางค่�าค่วามจร�งจะดี�วยู่ ดี�งนื่��นื่ การแสดีงเอาท์�พุ ตโดียู่ใช้�ตารางค่�าค่วามจร�งจะท์)าไดี�ยู่าก นื่�ยู่มแสดีงในื่ล้�กษณะของ ท์)าไดี�ยู่าก นื่�ยู่มแสดีงในื่ล้�กษณะของ ""สถานื่ะสถานื่ะ" " หร�อ หร�อ "State""State" มากกว�ามากกว�า
State State ค่�อ ช้ ดีของต�วแปัรสถานื่ะ ค่�อ ช้ ดีของต�วแปัรสถานื่ะ ((State Variables) State Variables) ซึ่��งซึ่��งม#ข�อม�ล้เก#�ยู่วก�บอดี#ตของวงจรเพุ#ยู่งพุอท์#�จะบ�งบอกถ�งการม#ข�อม�ล้เก#�ยู่วก�บอดี#ตของวงจรเพุ#ยู่งพุอท์#�จะบ�งบอกถ�งการท์)างานื่ของวงจรในื่อนื่าค่ตไดี�ท์)างานื่ของวงจรในื่อนื่าค่ตไดี�
ต�วอยู่�าง ในื่ร#โมตต�วอยู่�าง ในื่ร#โมต TV TV ท์#�ม#ปั 0มเล้��อนื่ช้�องข��นื่ท์#�ม#ปั 0มเล้��อนื่ช้�องข��นื่--ล้ง สถานื่ะของล้ง สถานื่ะของวงจรค่วบค่ มของวงจรค่วบค่ มของ TV TV ค่�อ ช้�องปั�จจ บ�นื่ โดียู่สถานื่ะนื่#�อาจเก2บค่�อ ช้�องปั�จจ บ�นื่ โดียู่สถานื่ะนื่#�อาจเก2บอยู่��ในื่ต�วแปัรสถานื่ะแบบไบนื่าร# อยู่��ในื่ต�วแปัรสถานื่ะแบบไบนื่าร# 7 7 บ�ต ซึ่��งเก2บค่�าไดี�ต��งแต�บ�ต ซึ่��งเก2บค่�าไดี�ต��งแต� 0 0 ถ�ง ถ�ง 127127
6
State Machine StructureState Machine Structure
7
CombinationalCombinational
SequentialSequential
Combinational Logic Circuit
x0x1
xn
z0z1
zm
Combinational Logic Circuit
Memory Elements
inputsoutputs
Logic CircuitsLogic Circuits
Sequential Logic Circuit
8
State Machine Structure State Machine Structure (continued)(continued) State Memory State Memory ค่�อ กล้ �มของ ค่�อ กล้ �มของ Flip-Flops Flip-Flops
จ)านื่วนื่ จ)านื่วนื่ n n ต�ว ใช้�เก2บค่�าสถานื่ะปั�จจ บ�นื่ ต�ว ใช้�เก2บค่�าสถานื่ะปั�จจ บ�นื่ (Current (Current State) State) ของวงจร โดียู่ค่�าสถานื่ะ ของวงจร โดียู่ค่�าสถานื่ะ ((State) State) ของของ
วงจรสามารถม#ไดี� วงจรสามารถม#ไดี� 22nn ค่�าค่�า - Flip Flops- Flip Flops ท์#�นื่�ยู่มใช้�ในื่ ท์#�นื่�ยู่มใช้�ในื่ State Memory State Memory ค่�อ ค่�อ Positive Positive
Edge-Triggered D Flip-Flops Edge-Triggered D Flip-Flops เพุราะง�ายู่ต�อการเพุราะง�ายู่ต�อการออกแบบ แล้ะสามารถท์)าไดี�ในื่อ ปักรณ�จ)าพุวก ออกแบบ แล้ะสามารถท์)าไดี�ในื่อ ปักรณ�จ)าพุวก PLDPLD
ในื่ ในื่ State Memory State Memory ส�ญญาณนื่าฬิ�กาถ�กปั5อนื่ให�ก�บ ส�ญญาณนื่าฬิ�กาถ�กปั5อนื่ให�ก�บ Flip-Flops Flip-Flops ท์ กต�ว ท์ กต�ว ((Synchronous Clock) Synchronous Clock) เพุ��อให� เพุ��อให� Flip-Flops Flip-Flops ท์ กต�วเปัล้#�ยู่นื่สถานื่ะตามส�ญญาณนื่าฬิ�กาท์#�ท์ กต�วเปัล้#�ยู่นื่สถานื่ะตามส�ญญาณนื่าฬิ�กาท์#�ปั5อนื่เข�ามาปั5อนื่เข�ามา
9
State Machine Structure State Machine Structure (continued)(continued)
Next-State Logic FNext-State Logic F ค่�อฟั�งก�ช้�นื่ท์างล้อจ�กท์#�ใช้�ค่�อฟั�งก�ช้�นื่ท์างล้อจ�กท์#�ใช้� ก)าหนื่ดีค่�าของสถานื่ะถ�ดีไปั ก)าหนื่ดีค่�าของสถานื่ะถ�ดีไปั ((Next State) Next State) โดียู่เปั7นื่โดียู่เปั7นื่
ฟั�งก�ช้�นื่ของสถานื่ะปั�จจ บ�นื่ก�บอ�นื่พุ ตขณะนื่��นื่ฟั�งก�ช้�นื่ของสถานื่ะปั�จจ บ�นื่ก�บอ�นื่พุ ตขณะนื่��นื่Next-State Logic = F(Current State, Input)Next-State Logic = F(Current State, Input)
Output Logic GOutput Logic G ค่�อ ฟั�งก�ช้�นื่ท์างล้อจ�กท์#�ใช้� ค่�อ ฟั�งก�ช้�นื่ท์างล้อจ�กท์#�ใช้�ก)าหนื่ดีค่�าของเอาท์�พุ ตของวงจรก)าหนื่ดีค่�าของเอาท์�พุ ตของวงจร
10
State Machine Structure State Machine Structure (continued)(continued)
Output Logic Output Logic แบ�งเปั7นื่ แบ�งเปั7นื่ 2 2 ช้นื่�ดีใหญ�ๆ ค่�อ ช้นื่�ดีใหญ�ๆ ค่�อ Moore MachineMoore Machine ค่�อ วงจรท์#�เอาท์�พุ ตข��นื่อยู่��ก�บ ค่�อ วงจรท์#�เอาท์�พุ ตข��นื่อยู่��ก�บ
สถานื่ะปั�จจ บ�นื่ของวงจรเท์�านื่��นื่สถานื่ะปั�จจ บ�นื่ของวงจรเท์�านื่��นื่Output Logic = G(Current State)Output Logic = G(Current State)
Mealy MachineMealy Machine ค่�อ วงจรท์#�เอาท์�พุ ตข��นื่อยู่��ก�บสถานื่ะ ค่�อ วงจรท์#�เอาท์�พุ ตข��นื่อยู่��ก�บสถานื่ะ ปั�จจ บ�นื่ของวงจร แล้ะอ�นื่พุ ตในื่ขณะนื่��นื่ ปั�จจ บ�นื่ของวงจร แล้ะอ�นื่พุ ตในื่ขณะนื่��นื่
Output Logic = G(Current State, Output Logic = G(Current State, Input)Input)
11
Characteristic EquationCharacteristic Equation
Characteristic Equation Characteristic Equation ค่�อ สมการท์#�ค่�อ สมการท์#�อธิ�บายู่สถานื่ะถ�ดีไปัของ อธิ�บายู่สถานื่ะถ�ดีไปัของ Latch/Flip-Flop Latch/Flip-Flop โดียู่โดียู่จ�ดีอยู่��ในื่ร�ปัของสถานื่ะปั�จจ บ�นื่แล้ะอ�นื่พุ ต เช้�นื่ จ�ดีอยู่��ในื่ร�ปัของสถานื่ะปั�จจ บ�นื่แล้ะอ�นื่พุ ต เช้�นื่ (Q(Q
* => * => เอาท์�พุ ตในื่สถานื่ะถ�ดีไปัเอาท์�พุ ตในื่สถานื่ะถ�ดีไปั)) S-R LatchS-R Latch Q* = S + R’.QQ* = S + R’.Q D LatchD Latch Q* = DQ* = D Edge-Triggered D Flip-FlopEdge-Triggered D Flip-Flop Q* = DQ* = D Edge-Triggered J-K Flip-Flop Q* = J.Q’ + Edge-Triggered J-K Flip-Flop Q* = J.Q’ +
K’.QK’.Q T Flip-FlopT Flip-Flop Q* = Q’Q* = Q’
12
Clocked Synchronous State-Clocked Synchronous State-Machine AnalysisMachine Analysis
การว�เค่ราะห� การว�เค่ราะห� => => เพุ��อให�ร� �พุฤต�กรรมของวงจรเพุ��อให�ร� �พุฤต�กรรมของวงจรจาก จาก Next-State Next-State แล้ะ แล้ะ Output FunctionsOutput Functions
ข��นื่ตอนื่ข��นื่ตอนื่ ก)าหนื่ดี ก)าหนื่ดี Next-State Next-State แล้ะ แล้ะ Output Output
FunctionsFunctions สร�าง สร�าง State/Output Table State/Output Table จากฟั�งก�ช้�นื่ท์��งจากฟั�งก�ช้�นื่ท์��ง
สองท์#�ไดี�สองท์#�ไดี� ((Optional) Optional) เข#ยู่นื่ เข#ยู่นื่ State DiagramState Diagram
13
Finite-State MachinesFinite-State Machines
เนื่��องจากต�วแปัรสถานื่ะม�กอยู่��ในื่ร�ปัของเล้ขเนื่��องจากต�วแปัรสถานื่ะม�กอยู่��ในื่ร�ปัของเล้ขฐานื่ ฐานื่ 2 2 ดี��งนื่��นื่ หากม#ต�วแปัรสถานื่ะ ดี��งนื่��นื่ หากม#ต�วแปัรสถานื่ะ n n ต�วจะต�วจะม#สถานื่ะท์#�เปั7นื่ไปัไดี�ท์��งหมดี ม#สถานื่ะท์#�เปั7นื่ไปัไดี�ท์��งหมดี 22nn สถานื่ะ สถานื่ะ จ)านื่วนื่นื่#�จะมากหร�อนื่�อยู่เท์�าใดี ก2ยู่�งเปั7นื่จ)านื่วนื่นื่#�จะมากหร�อนื่�อยู่เท์�าใดี ก2ยู่�งเปั7นื่จ)านื่วนื่ท์#�นื่�บไดี� จ)านื่วนื่ท์#�นื่�บไดี� ((Finite Number) Finite Number) ดี�งนื่��นื่ ดี�งนื่��นื่ จ�งนื่�ยู่มเร#ยู่ก จ�งนื่�ยู่มเร#ยู่ก Sequential Circuits Sequential Circuits อ#กอ#กอยู่�างหนื่��งว�า อยู่�างหนื่��งว�า Finite-State Finite-State Machines (FSM)Machines (FSM)
14
Two Output (Q and Q’)Two Output (Q and Q’) Various Ways to Feed Flip-FlopsVarious Ways to Feed Flip-Flops NOR Gate Flip-FlopsNOR Gate Flip-Flops
Basic Flip-FlopBasic Flip-Flop
QR
Q’S
1
2
S R Q Q’
1 0 1 0
0 0 1 0
0 1 0 1
0 0 0 1
S R Q Q’
1 0 0 1
1 1 0 1
0 1 1 0
1 1 1 0
QS
Q’R
1
2
NAND Gate Flip-FlopsNAND Gate Flip-Flops
15
RS Flip-FlopRS Flip-Flop
Three Inputs: Three Inputs: Clock Pulse: additional input to control when state is changing.Clock Pulse: additional input to control when state is changing. S(et) inputS(et) input R(eset) inputR(eset) input
Four States:Four States: Set state: Set state: S=1, R=0, CP=1S=1, R=0, CP=1 (Q=1, Q’=0)(Q=1, Q’=0) Reset state: Reset state: S=0, R=1, CP=1S=0, R=1, CP=1 (Q=0, Q’=1)(Q=0, Q’=1) Indetermined:Indetermined: S=1, R=1, CP=1S=1, R=1, CP=1 (Q=1, Q’=1)(Q=1, Q’=1) No change:No change: S=0, R=0, CP=1S=0, R=0, CP=1
S
R
Q
Q’
1
2
3
4
CPS>R
QQ’
16
ClockClock
Clock Clock หร�อ ส�ญญาณนื่าฬิ�กา หร�อ ส�ญญาณนื่าฬิ�กา เปั7นื่อ�นื่พุ ตแบบหนื่��ง ท์#�ปั5อนื่ให�ก�บ เปั7นื่อ�นื่พุ ตแบบหนื่��ง ท์#�ปั5อนื่ให�ก�บ
Sequential Circuits Sequential Circuits เพุ��อให�เพุ��อให� เก�ดีการเปัล้#�ยู่นื่สถานื่ะ ของ เก�ดีการเปัล้#�ยู่นื่สถานื่ะ ของ
วงจรวงจร ค่ ณสมบ�ต�ของส�ญญาณนื่าฬิ�กาค่ ณสมบ�ต�ของส�ญญาณนื่าฬิ�กา::
Active-High Clock: Active-High Clock: สถานื่ะสถานื่ะของวงจรเปัล้#�ยู่นื่ท์#�ขอบขาข��นื่ของวงจรเปัล้#�ยู่นื่ท์#�ขอบขาข��นื่ของส�ญญาณนื่าฬิ�กาของส�ญญาณนื่าฬิ�กา
Active-Low Clock: Active-Low Clock: สถานื่ะสถานื่ะของวงจรเปัล้#�ยู่นื่ท์#�ขอบขาล้งของวงจรเปัล้#�ยู่นื่ท์#�ขอบขาล้งของส�ญญาณนื่าฬิ�กาของส�ญญาณนื่าฬิ�กา
Note: โดียู่ปักต�แล้�ว ค่วามถ#�ของส�ญญาณนื่าฬิ�กาในื่อ ปักรณ�จ)าพุวก TTL แล้ะ CMOS จะอยู่��ระหว�าง 5 – 150 MHz
17
RS Flip-Flop (cont’d)RS Flip-Flop (cont’d)
Characteristic Equation:Characteristic Equation:Q(t+1) = F(Q(t), S(t+1), R(t+1))Q(t+1) = F(Q(t), S(t+1), R(t+1))
= = S + R’Q
SR = 0
Characteristic Table:Characteristic Table:
SS RR QQ Q(t+1)Q(t+1)
00 00 00 00
00 00 11 11
00 11 00 00
00 11 11 00
11 00 00 11
11 00 11 11
11 11 00 i.d.i.d.
11 11 11 i.d.i.d.
18
JK Flip-FlopJK Flip-Flop
Three Inputs: Three Inputs: CP: Clock PulseCP: Clock Pulse J: Set inputJ: Set input K:Reset inputK:Reset input
J>
K
Q
Q’
K
J
Q
Q’
CP
1
2
3
4
Four States:Four States: Set state: Set state: J=1, K=0, CP=1J=1, K=0, CP=1 Reset state: Reset state: J=0, K=1, CP=1J=0, K=1, CP=1 No change:No change: J=0, K=0, CP=1 J=0, K=0, CP=1 Complement:Complement:J=1, K=1, CP=1J=1, K=1, CP=1
19
JK Flip-Flop (cont’d)JK Flip-Flop (cont’d)
Characteristic Equation:Characteristic Equation:Q(t+1) = F(Q(t), J(t+1), K(t+1))Q(t+1) = F(Q(t), J(t+1), K(t+1))
= = JQ’ + K’Q
Characteristic Table:Characteristic Table:
JJ KK QQ Q(t+1)Q(t+1)
00 00 00 00
00 00 11 11
00 11 00 00
00 11 11 00
11 00 00 11
11 00 11 11
11 11 00 11
11 11 11 00
20
D Flip-FlopD Flip-Flop
Two Inputs: Two Inputs: CP: Clock PulseCP: Clock Pulse D: Set inputD: Set input
D’: Reset inputD’: Reset input
DQ
Q’
CP D> Q
Q’
1
2
3
4
Two States:Two States: Set state: Set state: D=1, CP=1D=1, CP=1 Reset state: Reset state: D=0, CP=1D=0, CP=1
Characteristic Equation:Characteristic Equation:Q(t+1) = F(Q(t), D(t+1)) = DQ(t+1) = F(Q(t), D(t+1)) = D
21
T Flip-FlopT Flip-Flop
One input JK flip-flopOne input JK flip-flop Two States:Two States:
No Change:No Change: T=0, CP=1T=0, CP=1 Complement:Complement:T=1, CP=1T=1, CP=1
Characteristic Equation:Characteristic Equation: Q(t+1) = F(Q(t), T(t+1)) = TQ’+T’QQ(t+1) = F(Q(t), T(t+1)) = TQ’+T’Q
T Q
Q’
CPT> Q
Q’
1
2
3
4
22
Excitation table: Excitation table: the reverse of characteristic table, the reverse of characteristic table, indicates how we should change flip-flop inputs to indicates how we should change flip-flop inputs to make the required state transition.make the required state transition.
SS RR QQ Q(t+1)Q(t+1)
00 00 00 00
00 00 11 11
00 11 00 00
00 11 11 00
11 00 00 11
11 00 11 11
11 11 00 i.d.i.d.
11 11 11 i.d.i.d.characteristic table
Q(t)Q(t) Q(t+1)Q(t+1) SS RR
00 00 00 xx
00 11 11 00
11 00 00 11
11 11 xx 00
excitation table
Excitation TableExcitation Table
23
Q(t)Q(t) Q(t+1)Q(t+1) SS RR
00 00 00 xx
00 11 11 00
11 00 00 11
11 11 xx 00
Q(t)Q(t) Q(t+1)Q(t+1) JJ KK
00 00 00 xx
00 11 11 xx
11 00 xx 11
11 11 xx 00
Q(t)Q(t) Q(t+1)Q(t+1) DD
00 00 00
00 11 11
11 00 00
11 11 11
Q(t)Q(t) Q(t+1)Q(t+1) TT
00 00 00
00 11 11
11 00 11
11 11 00
Flip-Flop Excitation TablesFlip-Flop Excitation Tables
24
State, State Reduction and AssignmentState, State Reduction and Assignment
A A statestate of a sequential circuit is defined by the binary of a sequential circuit is defined by the binary information stored in the memory elements (e.g. flip-flop).information stored in the memory elements (e.g. flip-flop). One flip-flop stores one bit, so m flip-flops can define at most 2One flip-flop stores one bit, so m flip-flops can define at most 2mm
states.states. Two states are Two states are equivalentequivalent if for any input, they produce the same if for any input, they produce the same
outputs and move to the same or equivalent states.outputs and move to the same or equivalent states.
State Reduction problemState Reduction problem: reduce the number of flip-flops : reduce the number of flip-flops in a sequential circuit.in a sequential circuit.
State Assignment problemState Assignment problem: assign binary values to states : assign binary values to states such that the cost of the flip-flop input functions is such that the cost of the flip-flop input functions is reduced.reduced.
25
(a) Completely specified circuit
(b) Incompletely specified circuit
1/1
1/0
1/01/0
0/0
0/0
0/- 0/0
0/0
0/0
1/1
0/-1/-
1/1
A B
C
D
AB
C
0 1x
A
B
C
D
D/0
D/0
D/0
D/0
B/0
C/0
B/0
A/1
0 1x
A
B
C
B/-
B/0
A/-
-/1
C/1
A/-
1/1
1/0
1/01/0
0/0
0/00/0
0/0
D
AB
C
26
Mealy and Moore ModelsMealy and Moore Models A sequential system is of A sequential system is of Mealy typeMealy type if output if output
values depend on both present states and values depend on both present states and inputs.inputs. Recall that a state is a combination of the memory Recall that a state is a combination of the memory
element’s content.element’s content.
A sequential system is of A sequential system is of Moore typeMoore type if output if output values depend only on the present states. values depend only on the present states. This does not mean that output is independent of the This does not mean that output is independent of the
inputs. Instead, the impact is through memory units.inputs. Instead, the impact is through memory units.
27
Sequential Circuit DesignSequential Circuit Design
Given: system descriptionGiven: system description Goal: logic diagram, Boolean function expressionGoal: logic diagram, Boolean function expression
1.1. System specificationSystem specification
2.2. State table/transition graph constructionState table/transition graph construction
3.3. State reduction/minimization State reduction/minimization
4.4. State assignment/encodingState assignment/encoding
5.5. Flip-flop selectionFlip-flop selection
6.6. Excitation/output table derivationExcitation/output table derivation
7.7. Logic simplification/minimizationLogic simplification/minimization
8.8. Logic diagram drawingLogic diagram drawing
28
Example: Example: Sequential System DesignSequential System Design
System spec. System spec. → state transition table/graph→ state transition table/graph Design a circuit with one input x and three outputs A,B,C. Design a circuit with one input x and three outputs A,B,C.
An external source feeds x one bit per clock cycle, when An external source feeds x one bit per clock cycle, when x=0, the outputs remain no change; otherwise, they x=0, the outputs remain no change; otherwise, they repeat the binary sequence: 0,1,3,7,6,4, one at a time.repeat the binary sequence: 0,1,3,7,6,4, one at a time.
AA BB CC AA BB CC AA BB CC
00 00 00 00 00 00 00 00 11
00 00 11 00 00 11 00 11 11
00 11 11 00 11 11 11 11 11
11 11 11 11 11 11 11 11 00
11 11 00 11 11 00 11 00 00
11 00 00 11 00 00 00 00 00
current state next statex=0 x=1 0/000
1/001SS11 SS22 SS33
SS44SS55SS66
1/011
1/111
1/1101/100
1/000
0/001 0/011
0/100 0/110 0/111
29
Example: Example: Sequential System DesignSequential System Design
State Minimization/ReductionState Minimization/Reduction Recall that two states are Recall that two states are equivalentequivalent if for any input, they produce if for any input, they produce
the same outputs and move to the same or equivalent states. We the same outputs and move to the same or equivalent states. We need only one state for all its equivalent states. Therefore, redundant need only one state for all its equivalent states. Therefore, redundant states can be removed and hardware (e.g. flip-flops) can be saved.states can be removed and hardware (e.g. flip-flops) can be saved.
00 10
1101
1/1
0/00/1
1/0
1/1 1/00/1
0/0
00
1101
1/1
0/0
0/1
1/0
0/01/1
1001 ==
30
Example: Example: Sequential System DesignSequential System Design
State Assignment/EncodingState Assignment/Encoding The goal is to assign binary values, each bit will be implemented by The goal is to assign binary values, each bit will be implemented by
one flip-flop, to states.one flip-flop, to states. Sequential binary assignmentSequential binary assignment::
SS11=001, S=001, S22=010, S=010, S33=011=011
SS44=100, S=100, S55=101, S=101, S66=110=110
Average bits to be changed:Average bits to be changed:
[(0+2)+(0+1)+(0+3)+(0+1)+[(0+2)+(0+1)+(0+3)+(0+1)+(0+2)+(0+3)]/12 = 1(0+2)+(0+3)]/12 = 1
Ad hoc binary assignmentAd hoc binary assignment:: SS11=000, S=000, S22=001, S=001, S33=011=011
SS44=111, S=111, S55=110, S=110, S66=100=100
Average bits to be changed:Average bits to be changed:
[(0+1)+(0+1)+(0+1)+(0+1)+(0+1)+(0+1)]/12 = 0.5[(0+1)+(0+1)+(0+1)+(0+1)+(0+1)+(0+1)]/12 = 0.5
0/000
1/001SS11 SS22 SS33
SS44SS55SS66
1/011
1/111
1/1101/100
1/000
0/001 0/011
0/100 0/110 0/111
31
Example: Example: Sequential System DesignSequential System Design
System spec. System spec. → state transition table/graph → state transition table/graph
→ → state minimization/encoding state minimization/encoding
→ → flip-flop selection flip-flop selection
→ → excitation/output table derivationexcitation/output table derivationInIn OutOut
AA BB xx AA BB TATA TBTB yy
00 00 00 00 11 00 11 00
00 00 11 00 00 00 00 11
00 11 00 11 00 11 11 11
00 11 11 11 11 11 00 00
11 00 00 00 00 11 00 11
11 00 11 00 11 11 11 00
11 11 00 11 11 00 00 00
11 11 11 11 00 00 11 11
CurrentState
NextState
00 10
1101
1/1
0/00/1
1/0
1/11/0
0/1
0/0
Flip-flop inputs
Q(t)Q(t) Q(t+1)Q(t+1) TT
00 00 00
00 11 11
11 00 11
11 11 00
32
Example: Example: Sequential System DesignSequential System Design
System spec. System spec. → state transition table/graph → state transition table/graph
→ → state minimization/encoding state minimization/encoding
→ → flip-flop selection flip-flop selection
→ → excitation/output table derivationexcitation/output table derivation
→ → logic simplification/minimizationlogic simplification/minimization
→ → logic diagram drawinglogic diagram drawing
Flip-flop input functions:Flip-flop input functions: TA = ATA = A B B TB = (ATB = (Ax)’x)’
Output:Output: y = Ay = ABBxx
T>
Q
Q’
T>
Q
Q’BACP
xy
00 10
1101
1/1
0/00/1
1/0
1/11/0
0/1
0/0