0% found this document useful (0 votes)
136 views9 pages

ASM Charts in Digital Logic Design

This document discusses Algorithmic State Machine (ASM) charts, which are essential tools for designing digital systems and control circuits. It outlines the components of ASM charts, such as state boxes, decision boxes, and output boxes, and explains their significance in visualizing algorithms and facilitating hardware implementation. Additionally, it provides examples of ASM charts for various digital applications, emphasizing their advantages over conventional flowcharts in terms of timing and operational clarity.

Uploaded by

Mohd Anas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views9 pages

ASM Charts in Digital Logic Design

This document discusses Algorithmic State Machine (ASM) charts, which are essential tools for designing digital systems and control circuits. It outlines the components of ASM charts, such as state boxes, decision boxes, and output boxes, and explains their significance in visualizing algorithms and facilitating hardware implementation. Additionally, it provides examples of ASM charts for various digital applications, emphasizing their advantages over conventional flowcharts in terms of timing and operational clarity.

Uploaded by

Mohd Anas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

10

Algorithmic State Machine Chars

LEARNING OBJECTIVES
After studying this chapter, yoU will know about: control logic in
Usefulness of algorithmic state machine (ASM) charts in the design of
digital machines.
ASM chart.
" Elegance in writing the Boolean function by inspecting the
the interconnecions.
" The Differences between Data processor and Control circuit and
" Differences between conventional flow chart and ASM chart.
on the
" The importance of using the various design techniques for control depending
complexity.
" Convenfional design using gates.
Design using Multiplexers
" PLA Control.

Just as a flow chart serves as a useful aid in writing software programs, Algorithmic State M anda
casy-tl
charts help inthe hardware design of digital systems. ASM charts provide a conceptually simple fr
algonithm
visualise method of implenenting algorithms used in hardware design. For example, Add Shift at
ASMcharts
multiplication of two numbers, Shift-Subtract algorithm for obtaining division, and so On. networksinany
advantageously used in the design of the control unit of acomputer and, in general, controlmustbeobservad
digital systems. ASM charts look similar to flow charts but differ in that certain specific ules which
usefiultool
in constructíng them. An ASM chart is equivalent to a an
state diagram or state graph. Itis
leads directly to hardware realisations. involves
formersequential
It is ncccssary atthis stage to distinguish and "control". The but
not merely addition, subtraction, between "data processing" operations
complementation., and such other combinational
ALGORITHAIC STATE MACHINE CHARTS 275
such as
oprations, shifing and counting as wcll. The control part of asystem has to take care of the timing and
prpersequencing of the various operations involvcd. It has to neccssarily provide clock
pulses and move the
Systemfrom one state to the othcr where ccrtain prcdcsigned
opcrations are performedin cach state. Control
constitutes the heart of any digital system such as the digital computer. An ASM chart is a useful tool in
designing control circuits which are invariably sequcntial circuits containingflip-flops.

10.1 COMPONENTS OF ASM CHART


CM charts are constructed from ASM blocks. For each state of agiven machine, there will be one ASM
iock. An ASM block COmprises the following components.
1 State Box The state bOX 1S represented by a rectangle. The name of the state is written in a circle to
the left of the state box and the binary code assigned to the state is indicated outside on the top right
the box. These are
side of the box. The outputs, if any, associated with the state are written within
clearly Moore type outputs.
diamond-shaped symbol with true and false
2, Decision Box The decision box is represented by a
the diamond indicates a condition
written inside
branches. A Boolean variable or input or expression
to take.
which is evaluated to determine which branch rounded
Output Box The conditional output box is represented by a rectangle with
3. Condional inputs
oval within which the outputs that depend on both the state ofthesystem and the be
corners or by an addition may also
These are Mealy type outputs. Át times, some operations like
are indicated.
indicated which involve register transfers.

00
1 2
b
So

Conditional utput Box


eci ion Box
State Box

ASM CHARTS
INTRODUCTORY EXAMPLES OF
TO.2
Mod-
Example 1-Mod-5 Counter earlier chapter. Look at the state diagram of
discussedin an states are nowrepresented
Recallthe synchronous sequential machinesstate diagramisshownin Fig. 10.1. Theinputsindicatedi adjacentto
Scounter. An ASM chart cquivalenttothe the
arrows but
Transitions are stillrepresented by and false branches. In the state graph, we
by state boxes instead of 1nodes. boxes withtrue the ASMchart, Mealy type
by decision comma. In
arrows in the state diagram arereplaced using a separator slash or indicated withinthe state
with inputs type outputs are
had indicated the outputs along output boxes and
Moore
in conditional
Outputs are now indicated every clock pulse, x is
box itself. named S, through S4. For
which has five state boxes then the machine remains in the same state,
as
the ASM chart
lake a look at to the next
state; if 0,
Sensed. If 1, then the machine goes
276 SwiTCHING THEORY AND LOGIC DESIGN

000

001

S,

1
010

011

S3

1
100

SA

Figa 10.1 ASM chart for Mod-5 counter


ALGORITHMIC STATE MACHINE CHARTS 277

depictedbya rcturn branch. Allthis happens in the same clock cycle. When the machinc is in state SA, on the
oCCUrrenceof the clock pulse, if xis 1, the machine produces an output pulsc indicated as Zand goestothe
ial state S,. Note specially that all this happens simultancously during the same clock cycle, that is, the same
cockpulse period. Remember that the states are assigncd binary names using three [Link]-flops. The
Focus now on synthesis. Earlicr, we synthesised using T-flip-flops. Let us, now, use D
excitation D,
oder is advised to appreciate the elegance in synthesis with ASM charts. With Dflip-flops, the
indicated on the ASM chart,
kns to be thesame as the next state variable Y Observing only state assignment
- 000, 010, only. Hence, using
ae notice that the next value Yo has to become 1 for the present states, yyi Yo
Aecimal codes and remembering that 6, 7 never occur, we get

D,- Y,-x0.2)+o6.6D
outputs by merely inspecting the ASM chart.
Similarly, we obtain expressions for all the excitations and
D,- Y,-x.)+Xos.69)
D,- Y,-o+Xo66]
Z-x4)+o6.67)]
excitations. If the input x is
that the input x is ANDed with each of the expressions for the 1.
Notice
circuit counts the number of clock pulses in the duration when x is at level
exclusively provided, then the the clockpulses are counted
Sometimes, x is not provided, in which case
In other words, x enables the counter.
every five clock pulses.
moduio-5 and an output pulse is produced for
1/0

O/0

O/0

S3 1/0 S1

O/0 1/0

1/ S2

Fig:: 10.2 Sequence detector for 0101: overlapping sequences allowed


278 SwTCHING THEORY AND LoIc DEsIGN

Example 2--Sequence Detector


carlier chapter. The reduccd
We designeda scquence detector for the scqucnce 0101 in an state diayram (aso
called state graph) is given in Fig. 10.2for thc purpose of reference.
It is fairly simple to draw an cquivalcnt ASM chart for a given statc diagram and
chart is shown in Fig, 10.3. Notice that the ASM chart has four state boxes. It has four vice-versa.
decision
The ASM
branches coresponding to the arcs in the state diagram for x -1 or 0. It has onc conditional boxes and
output box

00
By inspection
o=Yo=xy{yo + xyf Yo
=Y, =xy(Y, +xyYo

01

(
X
1

11

10

S3

Fig 10.3 ASM chart for sequence 0101 detector


ALGORITHMIC STATE MACHINE CHARTS 279

n'Pondingtothe output 'Z' becoming '1' if input x =1 whcn the machine isin state S, and a clock pulse
Noticethat there are four ASM blocks, cach containing one state box associated with one or more
aUS. and conditional output bOxes. It is important to note that ASM charts have timing
teisionboxes
msderations
sin contrast with the flowcharts Used by programmers. Allthe operations associated with astate
ASM block and they have to be performed at the same timein one clock pulse period.
formone
hox
synthesis. Take anote of the binary values, y, Yo assignedto the states S,. S,, S, Sy, f we
Focus nowon
tousetwo Dflop-flops, the excitation table is identical tothe transitiontable and D, -Y, In this ASM
decide
notethat the next state
variable Yo becomes 1in S, and S,. The corresponding present states are So
chart,
=00).and S (yiyo =01) and transition occurs ifx
= 0andx=1 respectively. Thus, we may write the
0Wo
expressionsforrexcitations by inspection as
follows.
D,= Yo=xyíy6 +xyíyo
respectively.
becomes 1for S, and S, onx=1fronm S,and x =0from S,
Note that Y
D, - Y-xy6y, +x'y;Yó
obtain the expression for Z.
By similar reasoning, we
Z=xyiyo
consisting of two D flip-fops is left to the reader.
Drawing the actual logic circuit
Example 3-Serial Adder concepts on ASM
an earlier chapter to reinforce the
presented in
example, let us use serial adder reference.
As a third
reproduced in Fig. 10.4 for the purpose of
charts. The state graph is
AB =11 =0
S 01 0
00 0 10 0
. S0
01 0 11 1
10 1

00 1

graph of serial adder


LFig: 10.4 State
same behaviour withprimitive
describiung the and B
equivalent to the stategraph depending on the values ofA
the ASM chart four exit paths state. Compare
g. 10.5 shows algorithmic chart. Notice the mergeinto one entry pathforeachre-cntry paths to
steps; hence, it is called an Noticethat allthe
paths
thhe other state and
three
binary tree. path to hence there
arranged in the form ofa state, there is an exit
assume 00, 01, 10and ll and
cach
example. Noticein the sttate are as
now with the state graph. From A Bcan graph
different values that in this
itsclf. This is because there are themhappento bere-entry paths
four
state.
Correspondingly,there
of to each can be
must be as many exit paths-three which mergeinto one cntrynumberof path
inputs is large,the state graph
paths usualBy
that there are fourincomingchart. Notice specially that if the unwicldy. The decision boxes are
many branches in the A^M too can become inputs, we have to
that the ASM chart primitive steps. As we have two
quite complex and it follows
algorithmic procedure conprising
binary as Weaim at an
280 SwTCHING THEORY AND LoGIc DsIGN

y=0

S0)

B B

1 1o
y=1

B 1
B

Fig 10.5 ASM chart of serial adder

Clock CK.
S
A Full
Adder
B Combinational
Circuit Co ()

FF
CK

Structure of a serial adder


AGORITHMIC STATE MACHINE CHARTS 281
four cxit paths from cach state. If we provide a
shor
aposition decision bOx with a
to specify uniquely what the machine should do for function like A'B. we should bein
structureshown in Fig, 10.5. both the
The advantage of an ASM chart is possibilities Oor 1. We prefer the binary
e
Sualisethe various operations and
their time relationships. that it helps the designer to
conceptually
synthesis of the circuit Byinspcction of the ASM chart, we
needto have only one notethatthere are onlytwo states S, and S
andhhence we flip-flop. If we choose a Dlip-flop, Dis
entrypathsinto each state. For the only flip-flop, Dbecomes 1for state
easilysynthesised looking at the
entryinto S,. Hence, by inspection and tracing the paths indicated by
S,.There are four arrows confluent on
given below. Remember that yis the present state variable of the
arrows, we write the expressíon for D
onlyflip-flop.
D=y'AB+yAB' +yAB +y¤'B
HO1TAUMOD T= AB +By +Ay4HDAM TAT2 DIMO21
Bya similar reasoning, the state S,is characterised by y=0. The coresponding excitation is D. There are
four paths confluent on the entry into S,. By inspection and tracing the paths, we may write
D'=y"AB' +y"AB'+y" A'B +y" AB'
o o A B +A'y +By
Note The reader is advised to check consistency in the expressions for Dand D'.
There are four conditional output boxes. Remember that the output Z is the sum bit to be produced
serially. Tracing the corresponding paths, it is easy to write the expression forZ.
ot bes y'(A'B+AB) + y(A'B +AB)ita avoz
= A By
Notice that expressions Z and D are same as those for sum S and output carry Co of full adder. The
structure is shown next to the ASM chart.

10.3 SALIENT FEATURES OF ASM CHART


interesting and useful
Ler Us put at one place all the important features of ASMcharts before we take up some
applications presented next.
the decision boxes and conditional
I. Each ASM block contains exactly one state box together with
Output boxes associated with that state.
exit paths. All entry lines have to be
b An ASM block has exactly one entrance path and one or more
For every valid combination of input
merged and only one entry line to be shown for each state.
to a unique next state. It is possible
Variables, there must be exactly one exit path defined which leads
iat several paths may merge into one exit path.
the machine is in that particular state
D. An ASM block describes the machine operations during the time
state associated with a given ASM
(USually oneclock pulse period). When a digitalsystem enters the
(logical 1), The conditions associated
block, the outputs indicated within the state box become truc
followed through the
with the decision boxes areevaluated to determinc which path or paths to be
become
ASM block. Ifa conditionaloutput box is encountered along a path, the corresponding outputs
282 SwITCHING THEORY AND LOGIc DESIGN

true. Al this happens during one clock period and the next clock pulse takes the machine to the nos
state as indicated by the exit path.
4. A path through an ASM block from entrance to exit is referred to as a link path.
5. Internal feedback withinan ASM block is not permitted. Even so, following a decision box or
conditional output box, the machine may re-enter the same state.
6. While a flow chart gives the order in which various operations are to be performed to achieve a given
task, it has no rcfercncc to clock periods or statcs of a machinc. In an ASM chart, all thc opcrations
in the
such as evaluating conditions given in the decision boxes and giving the outputs as indicated
period; they
state box or conditional outputbOxes associated with a block are performed in one clock
within the samce ASM block.
are done simultancously even though they are indicated at different places

Common questions

Powered by AI

In handling a sequence detector for sequence "0101", an ASM chart represents each stage of the sequence as a state box, with decision boxes managing transitions based on input values. When the input matches the expected bit in the sequence (e.g., "0" followed by "1"), the ASM transitions to the next state. If a mismatch occurs, the sequence resets, highlighting paths for true/false transitions . This structured representation, with each state and transition managed within the clock cycle, facilitates quick synchronization with input, enhancing system responsiveness. The clear separation of states and conditions allows for efficient fsm control, ensuring rapid recognition of desired sequences while minimizing error propagation .

ASM charts ensure proper timing and sequencing by requiring that all operations associated with a state happen within a single clock cycle, leveraging a structured format where decisions and outputs are time-bound and synchronized with the system clock . This is crucial because it allows digital systems to maintain precise control over state transitions, which are pivotal in complex systems where timing is critical, such as in automatic decision making and real-time processing. By structuring operations to execute simultaneously within a clock cycle, ASM charts prevent timing errors and ensure coherent system operations .

The main components of an ASM chart include the State Box, Decision Box, and Conditional Output Box. The State Box, represented by a rectangle, names each state and shows its associated outputs, contributing to the representation of Moore type outputs. The Decision Box, depicted as a diamond shape, indicates a condition evaluated to decide which branch to take, thereby facilitating conditional flow control of the system. The Conditional Output Box, represented by a rounded rectangle or oval, indicates outputs dependent on the state and inputs, representing Mealy type outputs. These components collectively ensure that all the necessary operations for a given state are completed within a single clock cycle .

ASM charts allow digital systems to perform operations like addition and subtraction by specifying these processes in conditional output boxes and state boxes, which link state transitions with operational instructions. The chart structures the sequence of required operations (e.g., loading of operands, performing arithmetic operations, and storing results) to be executed within clock cycles, synchronizing these operations with system control commands. This ensures that each operation executes in precise sequence with necessary control logic, facilitating seamless transitions from one operation to another. The chart's ability to integrate complex sequential operations into a control system underpins its utility in control circuits .

ASM charts differ from conventional flow charts in that they are specifically used for hardware design of digital systems, providing a conceptually simple method for implementing algorithms in the form of state diagrams or state graphs. Unlike flow charts, which organize tasks without respect to clock periods or machine states, ASM charts include specific rules that must be observed, such as representing sequential operations and state transitions, which aid in clock cycle-based control logic design . Flow charts primarily organize procedures or tasks sequentially, but ASM charts integrate operations to be performed within a single clock period, making them suitable for hardware timing considerations .

Utilizing ASM charts in control unit synthesis allows for a structured and intuitive approach to designing complex digital systems. These charts enable the visualization of the interplay between states, inputs, and outputs, offering a clear representation of system logic that can be directly translated into hardware components. By dividing system operations into manageable ASM blocks, designers efficiently allocate resources and optimize timing, crucial for enhancing system performance. Moreover, ASM charts facilitate the integration of complex sequences of operations, such as decision-making and branching, within control units, which simplifies design complexity and reduces errors during implementation .

Using D flip-flops in ASM chart synthesis provides a straightforward and intuitive synthesis flow because the excitation D is directly set as the next state variable, simplifying the transition equation derivation. In contrast, T flip-flops require more complex manipulations for state toggling. D flip-flops align better with ASM charts' state assignments, reducing the complexity of excitation equations and allowing clear representation of next state conditions directly from the ASM chart, leading to more efficient implementation . Its simplicity results in easier circuit design and debugging, crucial in large and complex digital systems .

ASM charts handle multiple input combinations in state transitions by specifying explicit exit paths for each possible combination of inputs. This comprehensive handling ensures that every input scenario leads to a unique next state, maintaining system stability and predictability. By accounting for all potential states and inputs, the chart prevents undefined behavior, thereby enhancing reliability. This meticulous mapping of inputs to state transitions ensures no input is neglected, safeguarding the system against race conditions and logical ambiguities that could arise if states were not explicitly defined .

Conditional output boxes in ASM charts play a strategic role by allowing outputs that depend on both the system's state and its inputs, thus integrating real-time decision-making into digital system control. These output boxes facilitate the creation of Mealy type outputs, where the output can change in the same cycle as the input condition for a state change, making the system more responsive and dynamic. This design supports efficient utilization of hardware by allowing modifications and immediate output adjustments based on input evaluation, crucial in high-speed applications where execution and response times need to be optimized .

Having only one entrance path in an ASM block is significant as it ensures a single point of control where the system can enter a state, aiding in deterministic control flow and coherence in operation execution. This constraint simplifies the design by minimizing potential entry states, preventing unintentional state merging or state misalignments. It enforces structured logic that aligns with clock cycles, ensuring all transitions and operations happen orderly and predictably. This predictability is crucial in digital systems design, which often requires strict synchronization to maintain error-free operations during state transitions .

You might also like