Professional Documents
Culture Documents
Algorithmic State Machines (ASM) : ECE124 Digital Circuits and Systems
Algorithmic State Machines (ASM) : ECE124 Digital Circuits and Systems
Algorithmic State Machines (ASM) : ECE124 Digital Circuits and Systems
State Box.
Decision Box.
Page 1
The state box is equivalent to the state bubble in a state diagram; it represents one
state of the system.
Moore machine outputs (those outputs that depend on the current state of the
system) can be shown inside of the box.
State Name
Binary Code
Moore Machine
Outputs
Page 2
The decision box represents a choice (conditional expression) that depends on one or
more inputs to the circuit (control unit).
0 (false)
Conditional
Expression
1 (true)
Page 3
The conditional output box allows for specifying outputs that depend on both the
current state and the current inputs.
Mealy Outputs
(Conditional
Outputs)
Page 4
Comments
If the ASM Chart does not have any conditional output boxes, then the ASM Chart is
describing a Moore Machine.
If the ASM chart does have conditional output boxes, then the ASM Chart is describing
a Mealy Machine.
Also, when we have outputs, we only need to label the output values (in either a state
box or a conditional box) when the outputs are 1. If not shown, we can assume the
outputs are 0.
Page 5
Design of a clocked sequential circuit from an ASM chart is the same as from a state
diagram in so far as we start by generating a state table.
We determine the number of states from the number of ASM state boxes.
We use the ASM conditional output boxes, ASM state boxes and ASM decision
boxes to determine output values.
We use decision boxes to determine the next state from the current state.
Of course, once we have a state table, we are pretty much go to go using what we
have talked about previously in the course.
Page 6
S0
A=1
00
G=1
S0
S1
S2
<<<-
00
01
10
S1
01
A=1
S2
W=1
10
Z=1
Page 7
S0
00
A=1
G=1
S1
01
W=1
A=1
S2
10
Z=1
Page 8
A few comments:
There is an extra arrow shown entering into S0. This is the reset signal, so S0 is
the initial state.
Page 9
ASM Charts are closely tied with hardware if we use DFF and one-hot encoding We
can go directly from an ASM Chart to a circuit!!!
Page 10
State Box becomes a DFF. Any specified outputs can be implemented later using
extra logic.
Entry
State Name
Entry
Binary Code
D
Moore Machine
Outputs
Exit
Exit
Page 11
Entry
Exit0
Entry
Exit1
Exit0
Exit1
Page 12
We simply tap off the signal and feed it to other circuitry to generate outputs.
Entry
Exit1
Entry
Exit1
Page 13
Entry0
Entry1
Exit
Entry0
Entry1
Exit
Page 14
00
A=1
D
G=1
S1
01
W=1
A=1
S2
10
Z=1
Page 15
Suppose we need to design a circuit that has two, n-bit inputs and one 2n-bit output.
The output is the product (multiplication) of the inputs.
We did see a combinatorial circuit for this operation the binary array multiplier.
We want to build the circuit in a different way (use only 1, n-bit adder rather than an
array of adders).
Page 16
We shift the multiplicand to the left (if multiplier bit is non-zero) and add.
Page 17
Rather than shifting the multiplicand to the left and adding, consider shifting the
partial product to the right and adding:
Page 18
To multiply 2, n-bit numbers we need to ADD and SHIFT n times. We can skip some
ADD operations if the multiplier bit is 0.
Page 19
load1
n-1
clear
load2
multiplicand
ceil(log(n))
en
strt
valid
load1
multiplier
ld
down counter
n-bit register
zero
dec
load1
control
cout
clear
n-bit adder
shift
din
sum
load2
lsb
n
d
dout
din
shift
dout
din
dout
lsb
n
product
Page 20
S0
clear=1
load1=1
strt
MUL0
valid=1
0
lsb
1
load2=1
MUL1
dec=1
shift=1
Page 21
Page 22