Sequential Digital Systems: The Synthesis: Pinit Kumhom
Sequential Digital Systems: The Synthesis: Pinit Kumhom
Pinit Kumhom
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 1 / 14
Outline
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 2 / 14
What are expected to be learnt after this learning session?
Be able to answer the following questions or describe the following terms from own
understanding.
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 3 / 14
FSM Specification: A FSM can be specified by describing its state transitions
and outputs at all of its states.
This can be in many forms such as state diagram, state/output table, ASM (Algorithmic
State Machine) Chart, HDL (Hardware Description Language)
AB
S 00 01 11 10 Z
INIT A0 A0 A1 A1 0
A0 OK0 OK0 A1 A1 0
A1 A0 A0 OK1 OK1 0
OK0 OK0 OK0 OK1 A1 1
OK1 A0 OK0 OK1 OK1 1
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 4 / 14
Steps for synthesizing a digital circuit of an FSM given its state diagram or
state/output table.
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 5 / 14
Illustration of FSM Synthesis Process
Step 1: Given a state diagram, construct the corresponding state/output table.
AB
S 00 01 11 10 Z
INIT A0 A0 A1 A1 0
A0 OK0 OK0 A1 A1 0
A1 A0 A0 OK1 OK1 0
OK0 OK0 OK0 OK1 A1 1
OK1 A0 OK0 OK1 OK1 1
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 6 / 14
Illustration of FSM Synthesis Process
Step 3: Choose how to represent the state (state encoding)
Assumming there are N states after the state reduction.
State Choose whether it is one-hot, almost one-hot or multiple-hots?
For one-hot state encoding,
▶ use 1 memory device to reprsent 1 state ⇒ N memory devices for N
states
▶ arrange the N memory devices in sequence
▶ the code 00 · · · 1 · · · 00, where 1 (the hot position) is at the i bit,
represents the state i.
For almost one-hot state encoding,
▶ Use the all zero code to represent the initial state.
▶ The remaining N − 1 states are encoded as one-hot encoding.
For multi-hot encoding, the choices are as follows:
▶ binary code
▶ minimal-change code (gray code)
▶ designer’s decomposed code
▶ random code(usually done by a synthesis tool)
and the number of memory devices n = ⌈log2 N⌉
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 7 / 14
Illustration of FSM Synthesis Process
Step 3: Choose how to represent the state (state encoding)
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 8 / 14
Illustration of FSM Synthesis Process
Step 4: Construct state transition from the state table by replacing all each state name
with its corresponding code.
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 9 / 14
Illustration of FSM Synthesis Process
Step 5: Choose type of memory device
Step 6: Construct excitation table
Choose JK Flip-Flop State Transition Table unused state specification
PS Input(AB)
PS Input(AB)
JK flip-flop’s Excitation q2 q1 q0 00 01 11 10
q2 q1 q0 00 01 11 10 001 −−− −−− −−− −−−
Change Excitation
q → q′ J K 000 100 100 101 101 010 −−− −−− −−− −−−
011 −−− −−− −−− −−−
0→0 0 − 100 110 110 101 101
q′2 q′1 q′0
0→1 1 − 101 100 100 111 111
1→0 − 1
110 110 110 111 101
1→1 − 0
111 100 110 111 111
q′2 q′1 q′0
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 10 / 14
Illustration of FSM Synthesis Process
Step 7: Synthesize the next-state logic using the excitation table from Step 6.
J0,K0 Excitation J0 in Karnaugh Map for q2 = ’0’ J0 in Karnaugh Map for q2 = ’1’
Input(AB)
PS Input(AB) PS Input(AB)
q2 q1 q0 00 01 11 10
q1 q0 00 01 11 10 q1 q0 00 01 11 10
000 0,− 0,− 1,− 1,−
100 0,− 0,− 1,− 1,− 00 0 0 1 1 00 0 0 1 1
101 −,1 −,1 −,0 −,0 01 − − − − 01 − − − −
110 0,− 0,− 1,− 1,− 11 − − − − 11 − − − −
111 −,1 −,1 −,0 −,0
10 − − − − 10 0 0 1 1
J0,K0
J0 = A PS Input(AB) PS Input(AB)
q1 q0 00 01 11 10 q1 q0 00 01 11 10
K0 = Ā
00 − − − − 00 − − − −
01 − − − − 01 1 1 0 0
11 − − − − 11 1 1 0 0
10 − − − − 10 − − − −
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 11 / 14
Illustration of FSM Synthesis Process
Step 5: Choose type of memory device
Step 6: Construct excitation table
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 12 / 14
Illustration of FSM Synthesis Process
Step 7: Synthesize the next-state logic using the excitation table from Step 6.
State Transition Table d0 in Karnaugh Map for q2 = ’0’ d0 in Karnaugh Map for q2 = ’1’
PS Input(AB)
PS Input(AB) PS Input(AB)
q2 q1 q0 00 01 11 10
000 100 100 101 101
q1 q0 00 01 11 10 q1 q0 00 01 11 10
100 110 110 101 101 00 0 0 1 1 00 0 0 1 1
101 100 100 111 111 01 − − − − 01 0 0 1 1
110 110 110 111 101
11 − − − − 11 0 0 1 1
111 100 110 111 111
10 − − − − 10 0 0 1 1
q′2 q′1 q′0
d0 = A PS Input(AB) PS Input(AB)
q1 q0 00 01 11 10 q1 q0 00 01 11 10
d1 =
00 0 0 0 0 00 1 1 0 0
01 − − − − 01 0 0 1 1
11 − − − − 11 0 1 1 1
10 − − − − 10 1 1 1 0
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 13 / 14
Illustration of FSM Synthesis Process
Step 7: Synthesize the next-state logic using the excitation table from Step 6.
State Transition Table d2 in Karnaugh Map for q2 = ’0’ d2 in Karnaugh Map for q2 = ’1’
PS Input(AB)
PS Input(AB) PS Input(AB)
q2 q1 q0 00 01 11 10
000 100 100 101 101
q1 q0 00 01 11 10 q1 q0 00 01 11 10
100 110 110 101 101 00 1 1 1 1 00 1 1 1 1
101 100 100 111 111 01 − − − − 01 1 1 1 1
110 110 110 111 101
11 − − − − 11 1 1 1 1
111 100 110 111 111
10 − − − − 10 1 1 1 1
q′2 q′1 q′0
Pinit Kumhom (vDeSi Lab, KMUTT) Sequential System Synthesis September 16, 2016 14 / 14