Professional Documents
Culture Documents
Memory
Devices
Inputs
Primary Inputs
State variables
Outputs
Output variables
Next state variables.
Synchronous Sequential Circuits
Clock is used to ensure occurrence of event (change
of state) at a specified instant of time.
Asynchronous Sequential Circuits
Clock
10/0
X 01/0 10
X/0 01
00/0 00
11/1 00/1 11 00
11/0 11
Y Z Y/1 Z/0
01/0 01
01/0 01
10/0 10
10/0 10
PS NS PS NS Output
AB AB S
00 01 11 10 00 01 11 10
x x/0 z/0 x/0 y/0 x x z x y 0
y x/0 y/0 x/1 y/0 y x y x y 1
z x/1 z/0 x/0 z/0 z x z x z 0
Input B
Output S
CLK
Present
State X Y X Z X X
Input A
Input B
Output S
3 00/0
00/0
11/0
Overall
Minimize the number of Sate Variable changes as
you move through the state diagram.
01 1 01 1
11 1 1 11 1
10 10 1
w1 = x1 x 2 y 2 + x1x 2 y1y 2 w 2 = x1 x 2
x1x2
00 01 11 10
y1y2
00
01
11
10 1
BY INSPECTION OUTPUT z = x1 x2 y1 y2
x1 y1
y2 z
W2 Q W1 Q
x2
Q
Clock
Timing Diagram
CLK
Present
1 1 2 3 4 1
State
Input x1
Input x2
Output z
State Diagram
10
01
11
01,10,11
1/0
01
11 01 5/1
00
10
11
10 2/0 00
01
00
00
00 3/0
11 10
4/0
State Assignment
Present State Next state (A+B+C+) Output
ABC XY z
00 01 11 10
000 001 000 000 000 0
001 011 000 000 000 0
011 011 000 010 000 0
010 001 000 000 110 0
110 001 000 000 000 1
00 x x x x
01 1 x x x x
C
11 1 1 x x x x
B
10 1 0 0 0 0
Y Y
+
B = Cx y + BCxy + ABC xy
+
C XY
A=0
X
A=1
X
BC 00 01 11 10 00 01 11 10
00 1 x x x x
01 1 x x x x
C
11 1 x x x x
B
10 1 1 0 0 0
Y Y
C + = xy
DA QA Z
QA
DB QB
QB
X
Y DC QC
QC
clock
Timing Diagram
CLK
Present
State 1(000) 1(000) 2(001) 3(011) 4(010) 5(110) 1(000)
ABC
Input x
Input y
Output z
S0/Za
0 1
X
S1/Zb
0 1
X
S2/Zc
0 1
X
Z1 Z2
State Box
• It represents one state of the ASM.
• The sequential machine resides in a state box
for one state time (one clock cycle).
• It consists of a state name, state assignment
code and state output (Moore).
• State box has a single exit/entry point unlike to
a state node in state diagram.
Entry
Exit Path
1 0
S1
x1
x2 Z2
Z1
many
S2 exit S3 S4
paths
S1/Z1
0 1
X1
Z2
0 1
X2
S2 S3
S1/Z1
0 1
X2
1 1
X1 X1
0 0
Z2 Z2
S3
S2
S0/ S0/
0 0
X1 X1
1 1
S0/Z0
1 1 1
X1 X2 X3
0 0 0
Z1 Z2 Z3
Q
0
zero out 0
1 0
J
one out 1
0 1
K
S0/Za
1/0 0/Z1
00
0/0
1/0
S2/Zc
S1/Zb
0 1
1/Z2
0 1
0 1
00
S0/Za
0 1
X
01
S1/Zb
0 1
X
11
S2/Zc
0 1
X
Z1 Z2
Link-Path-2
• Starting state 01, takes X=1 branch & ends at state 11.
Link-Path-3
• Starting at state 11, takes X=1 branch and ends in
state 11.
Overall B+ = A'B'X + A'BX + ABX
For Next State: Consider State Variable A.
• Two link paths terminate at S2 state
Moore Outputs
Za = A'B'; Zb = A'B; Zc = AB
Conditional Output
Final Result = 0 1 0 0 0 1 1 1 1
Counter-P Register-B
log2n
n
G(Go) Zero Detect
Parallel
Cout Adder
Z n n Multiplier
Control
Unit Q0 Shift Shift
C
Register-A Register-Q
n
0
ACC: Product Out
Control signals
IDLE
0 1
G
C ← 0; A ← 0
P ← n-1
MUL0
0 1
Q0
A←A+B
C ← Cout
C ← 0, C || A || Q ← sr C || A || Q
MUL1
P ← P-1
0 1 Multiplication Done
Z
MUL0 State
MUL1 State
• Decrement Counter P
• Four transfers take place
A(n-1) ← C;
A ← sr A;
Q(n-1) ← A(0);
Q ← sr Q;
IDLE
0 1
G
MUL0
MUL1
0 1
Z
T0
External
Input Decision Sequence
conditions Logic Register Decoder
Present Tn
State
State Table
Present State Inputs N. State Decoder
Name M1 M0 G Z M1+ M0+ IDLE MUL0 MUL1
IDLE 0 0 0 x 1 0 0
0 0 1 x 1 0 0
MUL0 0 1 x x 0 1 0
MUL1 1 0 x 0 0 0 1
1 0 x 1 0 0 1
1 1 x x x x x
2 Flip-flops : M1 M0
States 00, 01 and 10: IDLE, MUL0 and MUL1
DM0 = M0+
DM1 = M1+
Outputs: Initialize, Clear_C, Shift and Load
Initialize and Shift already available
Gates required for Clear_C and Load
Clear_C =
Load =
Outputs to
Inputs Datapath
Initialize
Go (G)
Clear_C
Z
Load
Q0
D Q A0 0
2-to-4 1
C Decoder Shift_dec
2
D Q A1 3
Clock
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity mult4X4 is
port ( Clk, St: in std_logic;
Mplier, Mcand:
in std_logic_vector(3 downto 0);
Done: out std_logic);
end mult4X4;
-- accumulator
signal ACC: std_logic_vector(8 downto 0);
-- Q0 is bit 0 of ACC
alias Q0: std_logic is ACC(0);
begin
D Q S2
D Q S3
Clock
Entry Entry X
1 0
X
Exit 1 Exit 0
Exit 0 Exit 1
Decision Box
© G.Khan Computer Organization & Architecture-COE608: ASM and Control Page: 47
One FF/State Implementation
ASM Transforming Rules
Entry
Entry
X
1
X
Exit 1 Output
Exit 1
Conditional Output Box
Entry 1 Entry 2
Entry 1 Entry 2
Exit Exit
Junction
IDLE
0 1
G
Initialize
Clear_C
MUL0
0 1
Q0
A←A+B
C ← Cout
(LOAD)
C ← 0, C || A || Q ← sr C || A || Q ; P ← P –1
MUL1 (Complex Shift)
0 1 Multiplication Done
Z
D Q
C G
Initialize
Clear_C
D Q Load
Q0
C
Z
Shift_dec
D Q
Clock