Asm
Asm
,:June,2003,
Dri.,3orl_,,
_1. |:.rpl:r irr dirt:r s1,stt-rn dcsig... r,.,.
(RGPY Bhopal, [)ec., 200:
4. llorv will you construct equi'. al ,;'ASM chart
for Mealy and Moore nrachine ? Exptair,
tlris taking with examplcs of Nleal.t ir..' Moore state diagr ant.(RGpV
Bhopul, Jtme; 200,\
2.
'
''
200(
/. = ,.llJ +. ("1)
(rr) It'rvc ca. put rvrrorc cxllrc.ssirl, irr co'clition box.
(l)
Il
rJL:rt*\._'-
j.
";)
(o)
Flg.7.B't
.o)
L
of
- -'
-- l0l0
:
5' obtain a state diagram for a Moore circuit which produce output I rvhen
it detects the I
sequence I l0l . Overlapping sequOnces arc allowed.
Also consiruct an SM .t
urt fo,
----.'
-"-"'-'
'-' ti,t
"'r._
"':r. jii
givencircuit.
I
I
I
'l
L-I
t
I
4. A path through
5. ASM chart
an
for
i
!
Column tr
Synrbol
j
l.
-oO'-lI
State box
(A)
2. Decision box
Gf)
rl
I =-
3. Conditionalbox
(q
,.)
rl
,.,
Y
-\
4. ASM block
TRUE/FALSE
l. AnAsM
2
'
state box is a diamond shapcd box with tnre and falsi branches.
algorithm ? Explain.
$Cf Y Bhopal, Dec.,2002)
E)(ERCTSES-7
0BJECTIVE TYPE QUESTt0l,tS
l. Thc statc of the system is reprcsr:r.. .a by
box
box
(a) Decision
(c) Condirional
conditionarbox
(c)ASM
Sequentialcircuit
program
(a)
(c) Soflware
@) conrbinarionarcircuit
(rf Both (a) and (6).
(rro
,rrO
(c)
j:lj::::::1i:1ryo..'s
(c) Randonr proccss
("),;i(6),
box
block
(a) State
(c) Dccision
box
srare box
lo
rrcnx,ry
menr,ry
Fftt H
l.
THE
ErAl{KS
tr'
.l t
lr,.
tL
(6)t;;;i;;
(did;;mory.
ri.
I
t,
L,
z """"""
F
Ya
0it
[r
I
-'l
.l
I,
Tt.
ASM chart
l)
l'
+r
lo
diagrams
ASM charts may have one or more
cquivalent form.
ASM chart contain'implicit timing
information.
It is often easier to understand the operation
of a digital systcnr by inspection of thc SM
ASM charts.
State diagran$ are unique.
State diagram is not concerned rvith tirne
relationship.
State diagram contain less inforn'ntiort
as compared to n SM cltart.
clurt.
It ttsc nrorc conrpotlctlts tltatt statc diagrattl
conrpared to n SM cltart.
Statc diagratl$ are lcss crror prollc.
Flow chnrt
l(' r 8rc
flip'
..xfi0
number
'i
ed.lf
l. Flow
tlpe of systcm.
Thble 7.14
ROl\t address
Nlicroinstruction
Comrnents
R, e-0
Clear R2 counter
R, +- R,, Carry +- 0
lf (Z= l) then go to
Done
ifR,
=6
external address
3
R, e-crcR,
If
frz
(carry = 0) then go ro 3
eR, +l,goto9
Ifcarry = l, increment
-
R2.
Solulion.
X -Y -C.l,,li -.-
lnpul
lnput
0
C--ll
Ftg.7.80
Two n-bit registers Xand Iare loaded with external inputs. On the start signal Xand.Ir-c
compared.lfx> r'aflip'flopCistobesettot.lfx<Iaflip-hopListobesettol.IfX=lr,a
fl.^,.
flop f is to be set to l. It is assumed that the bic ofXand-lrare respectivel y
Xn_tXn_2...,..Xi,
Initially, clear all flip-flops and thc sequcnce counter C is ser to a nurnber 'a'equal
to numblr
of bits in thc external inputs Xor Y. First MSB of Xond I. namelyXn-1
and yn_1 arcconpared ,t
ffi
11.5.,
Teble 7.13
ROII{ address
Microinstruction
Comnrcnts
<-0;C +- 0
B +- (00001010)2
A+
A+ B
B+B-l
DccrementB
If (B * 0) then go to 2
C<_A
if
B+0
Exanrple 7.37.ll'ritc the mictoprcgramfor the/low chart given in Fig. 7.79for counting
tlrc nuntber of I s in register R 1
Start (Addrcss 8)
Rn-
R2+ l
F19.7.79
be
I
t
I
C.A* 0
B + A{ul:ipticand
Q * Mulriplier
P ._n
tfl[,!n;"oo
C,A*A+ts
Prtx.lucr in
A,()
Fi1.7.77,
Z=A,IJ+AB,
]'hc ASM clrrrt of circuit is shown
bclow
ilJ,
!
trl
Ir
:-l
t
i
(Fig' 7'75)'
The state diagram of above ASM chart (Fig. 7 .74) is given below
7=O '
t
I
Z=l
Fi1.7.75
ouputs Tg, Tb
their
label
and
flip-flops
diagram revels the input functions..
Choose four p
?n2
Dru=S'To+ZTt
D7,=STn
D,.
T, +
Z'T'
Dr, =7,
't'lrc logic diagranr is sltown in Fig' 7'76'
s'
7.
T.l
z'
t;
T1
I
a. d its
:
p'
;ined
Ft,9.7.76
is shown
inFig'7
'77 '
Initial Statc
AC-P*
0
0
n
A <-Alll
(l -- C.'rr
C--0
lhilld
as'follows:
'ir
CAgani
andlig,7.74is cxptal
'
i'
Trble 7.12
B
Initial value
ll
l0t0
Shift-
First cycle
LJ
l0l0
lll0
0lll
0lll
l0l0
m
m
l0l0
Second cycle
0l0l
001
l0l0
lill
mll
r0l0
0lll
l0l0
mt
tm
lmt
lml
Add
I
shift )
Add
)
shift ,
l0t0
llm
l0l0
Add I
)
sfiift J
Third
r1
ri
cy.l" , ,
Fourth cyclq.
'
e,
ru
| {l
+'L
,lr- t
|ffi
t'i{rl
,!
AR._ Multiplier
BR*
Pp
Muttiplicand
Alt
0's
Pt--Px+ 8n
AR- Ar. - I
,n"n[)n'U'li"o
Solutlon. ThcASM chart of binary multiplicr is shown in Fig. 7.74. Initially, thc multiplier is
rr Q and the multiplicand is in B. Rcgistcr and corry flip-flop C urc clearcd to zcro tnd thc
rqucnce counter P is set to a binary number 'a'cqual to number of bits in the multiplier. The
(ontrol usc one extcrnal signal ',S' to start the opcrotion. If S - 0, no action occurs and systcm
tmains in an initial state ,S9 when S = l, control goes to state ln1.
Multiplicand
,.t
tr.. -
ron
1;
Present state
Next strte
Qr
Qz
oi
0
0
NIUX
Input conditions
a:
hfl-lX Inputs
NILIX I
MIIX2
,s
00
0l
s'
t0
00
z'
z
z'
None
E'
E
E'
.s
.l
0l
I
I
ffi
't'l
Tl/
rri
s
0
I t,tuxz
t.'l
t-
TheASMchartofcircuitisshown
u'figl.tZ.
is decremented by
l.
il
l.-r
ldntflf,f
".ll
'(
as
.J
-.;an
ir'u
Example 131. Design
the ASM
chartfor JKflip-Iop.
ching
is
Q(+l)= tOfO+RQ0
i,
l
I
,J
,l
I
l
:l
I
Q(ttl) -
F19.7.69
R 1 for
R1*lnput
Rr- Alll's
Rr<- Rt+l
R2 is incremented bY
l.
F19.7.70
Norv rve considcr that cnrcrgency vehicle is coming. I{ere we willglow red for NS as r*,eli
s
for EW rvltcn enlergency vehiclc is present. Secondly, rve rvill allorv output )', so that u,e
;r
<
provide atrdio sound, so that other witl come to know about entergency vehiite. At each
switching
rve n'ill check per emergency signal (8"). Therefore, ASM chart will
be
Rcd
Red
EW
N.S
EW
NS
Crccn
Yellow
t:
L.
ft
t,
{t
F19.7.68
:
i
I
r_
t-l
I
,i
l)uring the data system designing, designcr should consider the fiollowing points.
l.
Cost: depending on the nature of the systerq the designer must sclect the most economical
solution for the givcn systenl
L Efficiency
re
i. e.
fast response
tirne.
()..
3. System should be reliable and must have some securiry measure to protect the sensitive
data in protected location.
,l
l1
'ts
,l
computation.
The block diagram is shou'n in Fig. 7.67 which indicates that horv a digital system control
tlrc physical systeft.
in
F19.7.67.
Exanrplc 7,30. Devalop ASM chartlor trottrc signal controller ut thc intt'r:;eclion. The
bc ONfor 30.tcc arul yellox, light should be ON for l0 scc. l'laka
ltnvislon for oil cntugancy vahiclc lo pass through hy stopping truttrc d rcquirad,
(RGPV Bhopul, Junc, 2006)
s;'
Solutlon. First wc will tske scqucncc of traffic. Wq won't considcr cmcrgcncy condition.
thcreforc our tralTic signolling schemc is os follows :
1
- ReC
' I 30t..
NS - GreenJ
(a) EW
tat
llcr
(D)
sw -.Red
(c)
rw - Yellowl
)I 5
,psi
n8
J)sec
- Greenl ru
^^ sec
NS - Red J
ihe
e''tl
si-
-Red
(.ft gw
)tt'
NS -y.llo*J
NS
nor
:1
g.
ith"L
ri ls
'
(e)
rw - Yellowl
NS-Red J)sec
(rEw-Red
l )tt'
-
NS -Yruo*J
l.
(fixed network).
4. With nticroprogramming nuny additions and changes are rnade by simply changing the
nucroprogram in the control tlremory. A small change in the hardwired (fixed nefwork)
approach may lead to redesigning the entire system.
7.8.-
Data systenr processes the data and produce the required output. Each dara systenl consists
of controller and data processor.
The relationship between control and the data processor i1 a data systenl is shorvn in
Fig.1.66.
lnputs
l:rtcln.rl
lnputs
l);ttit l'roc'csstlt
--
Outputs
l.
Z
'
:''
!,
t
i
*,
It
Given the word description of the requirement obtain an algorithm necessary for solving a
design problern Algorithm may be in the form of flow chart, ASM chart, state diagr"- ot
table. orHDL.
!,j
!,.
L'I
From the algorithm determine the various components required for designing, such as the
size and number of flipflops needed to store the inf6rmation and the kind of operational
unit such as adder conparaton etc., which af necessary to perform the required processing:.
{t
-l
3. Generate the timing diagnm which will conbol the sequence of different steps ofatgorithm
A timing diagram clarifies the timing sequence and other relationships among thelarious
control signals in the subsystern
t
tl
t!
1"',
I
t$
rN
i :'
&in?'
?
.t
rTI lll
"t
'
7.7,6.
i
I
nr,.rnol
conrrol
f
[_
Control
lrurtclirln
lricltl
Contrtll .Sign:rls
Flg. 7.65 A mlcroprogrammod controllor'
MBI{ of
ClvlBR (Control Menory Bttllcr Ragtsitri,'t'tt CMllR functions tltc sntttc as thc
rctricvcd fronr
rhc main mcnpry. It is bosicsttya taictr, on.l o.t os I buffcr for thc nticroitrstructiotts
thc control rncmory. Each microinstnrction will hovc thrcc distinct ficlds
Conditiorr selects
Branch address field
Control function field.
The condition select
'l
I
t:
l'
input of the
of the multiplexer will be l. The output of the MUx is connected to the load / Inc
active and
microprogramcounter (MpC). If the output of the MUX is true, then load input will be
field of the
rhe MpC will be loaded with the uidrrs specilied in the branch address
will be active and
microinstruction. If the output of the MUX is false, then increment input t t"t I
field gives the
the MpC will point to thc next microinstnrction to be executed. Aconhol function
values of the conhol signals.
the
MpC (Mtcruprogrsm Counter).. The tlpical functio'n ofthe MPC include incrementing
a computed
current address by one, transmitting .n r*ir-ally specified address, generating
'branch ad&ess, or speciffing an initial address.
according
Exlernal condirlon select MIJX.. This MUX selects one ofttre external conditiors
to the contents of the condition select ficld of the microirutruction'
The conparison of a microprogramnrd controller with respect to a controller implemcnted
as a
Exampfc 7.29. Design the ci,rtuol hgic c{Fig. 7.61 using pLA.
Solution. 'l'lrc statc lahlc corl(..3rr,:rrling to thc ASM chart
lhblc
7. 10.
Table.7.l0
Prescnt State
Ncxt State
Qr Qz
Q*rQ'z
00
00
0l
0l
00
0l
l0
ll
00
lt
t0
00
t0
rl
ll
ll
lt
t0
l0
l0
Inputs
Outputs
xy
0x
lx
To
Tt T2
T3
1000
1000
0100
0t00
0001
0001
0001
0010
00t0
0010
xQ
xl
0x
lt
l0
0x
l0
tl
l'lblc 7.1I
I'rotluct lcrnr
I
2
3
4
5
6
7
8
l0
. Input.r
l2
34
.f,'
h Qz t'
000
0 0 l0 I -0
0 I -l
ll0
l I lt
I I l0
I 0 0l0
l0
l0
ll
Ou(puts
123456
Qf Qf ro
l-tlll-
ll
r r
3'
.l
2
PT.A
46
F19.7.64
t-
l-
l-l-
2l
r'2 r'r
tll
l-
r't
I -l
,l
tt
rl
pnEnffii
-.1.--
to the next state and outputs in the state table. The numbcr of states detennines the number
flip-flops for the sequence register.
tl
of
The following example demonstrates the procedure for designing the conrrol logic rvith
PLA.
-)To
lr,
I
rl-
-,T.,
il
-, _;r3
I
Table.7.8
;
!
Present State
Nert State
Qr Qz
hQz
I
-l
for
I
,I
Inputs
Outputs
.ryz
00
00
0xx
ToTtT2
1000
00
0l
lxx
1000
0l
tt
xlx
0100
0l
0t
x0x
0100
ll
00
ll
0l
xxl
l
I
I
I
I
,
It
I
It
,le fronr
h I)[.A
0.
00
t0
itrons.
00 r
Solutlort. 'l'hc I'LA progrsnl tablc can bc obtaincd dircctly frorrr the statc tlblc witout thc
nccd for sirnplilication proccdurcs. Thc PLAprogrom tablc is givcn iq'l'ablc 7.9.
Trblc 7.9
Product
ternr
Outnuts
Innuts
QrQzx
(.
00
, inputs
00
rt .fthe
'om the
te tabte
itrcs no
tinus to
0l
l-
0l
ll
n't
ll
,1i
lftfi
, ^lor-
carc
n rdto
'L.rt are
ui'alent
t23456
QrQzToTlT2z
I
I
I
I
I
lI
I
2l
NIUX
srI
0
I
2
3
Ft1.7,62
's
.tlrcASM uslng P!4. 'l'hc dcsign ofa I'}LA control rcquircs tlat rvc obtain rhc storc tablc fror:
chart of thc circuit.'Ihc biock diagramofrhc pl.l\controlis
shown i1l;ig. 7.63.^I-heF t
nlcthod is supcrior to o RoM if ttrc statc tablc contoins largc
nunrbcr of don,t carc conclitioru.
7
'7
Oulput$
Flg.7.6s.
The state table gives essentially all the information rcqufued
for obtaining the pLA prog{,:m
table' The PLA progftlm table is a list ofproduct terms, one for
each row in the state table, infur
and their corresponding outputs. For eacch product
tenq the inputs are marked with l. 0 q-,(dash)' A I in the input colurnn specifies u p.tt
from the corresponding
inputioilffil;lj;
AND gate that forms the'product term. A 0 in the input column specifies
a path from thc
c-oresponding complement input to the input of the nNO gate.
The ,X,s in the state ta' lc
.'designate
don't-care conditions and inpry no connection for the pLA.
A .-'(;;;J
ililU
PL,A.
""1','
to;;'ifiir;
I
t
c .tft
tr
1
.l
_Ir.
,-){-
'o
-Tr
- l-T'
-T1
Flg.7.6l
7.61 shorvs att
Thc cquivalcnt ASM chart of Fig .7 ,60 hai four blocks-onc for coch statc. Fig.
SM chart for tltc statc diagrum of Fig. 7.60.
Trble 7.7
i
I
I
't Jz)
.:
Prcscnt State
Next Statc
hQt
00
00
0l
0l
Qr Qz
ll
ll
ll
l0
l0
l0
00
0l
ll
l0
00
ll
l0
00
l0
ll
Input C6ndltlons
MUX lnputs
Mtxl
MT.D(2
ry * xy'
=x
xy
xy'
ry'+ry
x)'
xy
=x
x'
x
v'
x'
ry
xy'
x'
The MUX inputs from the table are used in the conhol imptementation of
Fi
g.7 .59.
0
I
MUX
',
3
sr-
so
0
I
MUX2
Ftg.7.S9
If xnrrrplc
x.0
00
xt
t=l
I=l
aQ
,A-
x=l
I=0
Ftg.7.60
(a) Draw the equlvalent ASM chart, leaving the state boxes empty.
(b) Design the control using nultiplexers,
(RGPI, Bhopal, June, 2007)Solution. (a)
,l
,'|
1:Effi'
rnntr0l
I
.l
peption
I
,t
,
I
F19.7.58
'isa
'gister.
: .rlly)
of the
'r iion
It ,!the
L.Y,
Present State
Qr
Qz
00
00
00
0l
0l
0l
l0
l0
ll
ll
Next Stete
Trble7.6
Input Conditlons
Qr Qz
l0
0'l
ll
l0
0l
ll
t0
00
tl
00
x
x.'
y'
MUX Inputs
Mtxl
,+x'!
*x* y
MTIX2
x'Y * x'Y'
x'
--
x'v
x
x * x'y'
x'y
-x*'l'
x'y'
r''
x'Y * x'Y'
=r'
x'
x'
x
t
Example 7 '25' The state diagran, of a control unir is
b),the oneflip-flop per state nrethod.
shorvtr
in 'Fig.
'6' 7.56.
"-"' Design
tlte contrri
,Z=0
h=0
D7t
To + z'
Drz =
Tt
Tz
D7r=zT2
Dt't
Tl +
Ta '
F19.7.57
tn
il;;'
"dlla,\
*.rrv intro
lrtla\r rgvgl
,:;:il::
*:ffi liiffi:1?'i:::l*::""*"l*Trif-T:":,tTt:-:i"_'ry:F-i[-n;;;;;;ili,
ffi il:i:i::T"_1fjj'^linputsandarsotlrheserectioiri",;;?;;;ffi i:ffi ;#il"iu{l
iny uts
nn* re termine iffi ;,i, ffi ff
11H ;t;T::Hl'"l"" givin
f IrIl
;1n:1s The
f
in'thosM
chart. in order to crarify,r,, pror.i*"'.;fffi:.,'ili
L:Xffjrr:,t:gg:ru
fo
lo wing design exanples.
is
*t
srate value.
11e-
de
il
MC2X,
,l
6l
I
I
I
I
-t
:l
i
I
1i
9'EFtii
- !_;
rii .,iri*r,.. i
' ..
Dro=x'7'6-77
Df,
T(l
Dr'- = Tr
l:
l:,
a
Di =Ts
D; = Tt+ Tr,'
The logic didgrarn is shorvn in Fig. 7.55.
lr
ii
It
-!
t,
'a
I
I
''q
'l
li
I
1
I
I
I
j.!
control
gular
,inbc
re necd
.l
munl
srln of
stale
'I
'I
.-J
'I
\
n..nd
is
tc
AND
ntot
'arr1 wc
clcar clk
F19.7.55
7'33
m
QrQo
QrQo
000t il
t0
000t
il
t0
Dr = x'Qr'Qo
Do=x+Qr'Qo
Ft,1.7.52
D1 : x'71
Dg= x
rvhere
Q6 and
T1.
Tz: Qt Qz
F19.7.53
3.
Uslng onc fllp-flop per strtc. iiiir #ilt"d uscs one flip-flop per stare in rhc contrft I
scquential circuit. Eoch flip-flop represcnts o statc ond only one flip-flop is sct at any particul;
i
time, white all others are clearcd. The advantage of this method is sirnplicity with which it can t :
.
designed. The control unit logic can be derived directly from thc state diagram without the need l
of state or cxcitation tables. The rnain disadvantage of this method is 0rat it uses a maximu ,
.nurnber of flip-flops. Considet some specific examples that demonstrate the detailed design 0.li
conbol'units by this
I
7.7
method.
Example 7,24. A control unit has two inputs x ary! y and eight states. TIte controf rro;:ij
diagram is shown in Fig. 7.54. Design the control using eight
*=9r-
Y=
Dltip-flops.
n"i
il
I
F19.7.54
i*';,'
ltr.l
rI
,lrl
rffi
l-l:lrl
To =
Qo'
Tl=Q:
To = Qr'Qo
Fig.7.50
The logic diagram of the control is shown in Fig. 7.51
F19.7.51
7,7,2,
Uslng D fllp-flops snd dccodcr. Thc nuin advontage of this nrcthod is that wc con
drrcctly obtain thc input functions from the statc tablc without the nccd of an cxcitation tablc.
'llris is bccsusc thc next state is the samc as thc input rcquirement for thc D flip-flops. Then,
tnstead of using the flip-flop outputs as the present state condition, we nright as wcll usc the
output of the decoder to supply this information, for that insert a decoder at the output of thc flipflops to obtain the necessary outputs. Now realize the conhol unit using gates, flip-Ilops and decoder.
Examplc 7,23, Design lhe contrcl unit whose state table is given in Table 7.3 using logic
g,iltcs, Dflip-flops and decoder.
Solution.
Teble.7.5
Present State
Syntol
Prcsent
State
hQo
To
To
T1
T1
T2
T2
00
00
0l
0l
ll
ll
Input
Flip-tlops
. Inputs
Next
Statc
Qr
Output
'
Qo
D1 Do
To
TtT2z
000
0 00
100
100
I
o
I
I
0r0
0ll
trtl
Tablc. T-3
Present
Present
State
State
Synrbot
Input
hQo
Next
State
.r
Qt
Output
ToTtT2
Qo
00
0l
tt
0l
00
0t
lablc. 7 4 shorv lhc. excitatiorr
rable ol.rhc nitnolrm
t000
1000
0100
0 I 0'0
00t0
00tl
li iI
'Iirbte 7.4
I'rcsenl Stnte
0.0
00
0
I
0l
l.
tl
0
I
000t il
t0
0'
4 Kr Jo Ko
oxox
oxtx
0
I
lxxO
0X;0
xlxt
xlx0
00 0t tt
t0
Jt = r'Qo
Kt=l
00 0t lt
t0
Joo'
simitarty, the ttuee sinplified
outpur 0x1,1;1i
To- Qo'
Tt - Qt' Qo
*,
000t
il
t0
It = r'Qr
9r%
Tz'Qt
Flipfloplnpurs
00
0t
It
0t
00
0l
0t
Ncrt Strte
Uslng JK flip-flops. The following procedure can bc used for connoller dcsi
:d.i,e.
7.7,1.
rhm
using JK flip-flops
The first step is to assign binary values to each state in lhe ASM chart.
a list of prescnt slnlcr.
2. .Obtain the state table for a controller. A state table for a controller is
llrc
inputs, their corresponding next states and ouputs. The inputs are taken frttttt
to tlr
conditions in the decision boxes of the ASM chart. The ouputs are equivalcnt
l.
'rt $e
l"ons
3en
r uits
)utl'ef
3c,th
rl
' iy
r'.rry,
r. -:
of
dware
not
ls not
l^vc a
v l,cr,
0r
'l'o
t) ..
ttv
t/0
(\z----
vl
f* \
T1
-*_-1.|r
\
(Y()
\i./
ttcd
l,-kccl
o/()
I
: rory I
I
torrgcr
'
F19.7.47
QrQo'0
QrQo= 0t
rt
of
;1 tern
ts
letailed
F19.7.48
QlQs=
ll
t'
Gencrally an algorithm rvill contain a number of procedural stcps which are rcsult-oriented
i.e.
depcndcnt on results of prcvious steps. A convenilnt method foi presenting
hardware atgorithr
is a flow chart. Flow charts are uscful in the hardware design oidigital
slystem. It convert the
given word information to an information diagram that enumerates
ih.. r.qu.nce of operationtogether rvith the conditions necessary for their execulion. A special
flow chart that has beer
developed specifically to define hardware algorithm is cailed an
ASM chart.
Firntrvare algoritlinr. Firmware consists of programs that are included in
digital circuit ,
during their manufacture. Firmware is used u'hen ttre programs
must be retained in case of pog,e. \
failure and rvhen programs are not expected ro ue ctrariged. The
microprogram facilitates thg
irnplementation of hardlare and is therefore, called firmware to
distinguistr i-t from software.
A microprogrammed computer has its centralprocessing unit intplemented primarily
by a
RoM rather than by discrete logic. Each nrenrory location in tlris Rolv{, c:rllecl
a control nremorl
holds a nricroinslrttctiott, the torvest leve[ instruction a conrpqtcr
can exe,:r(c. A sequence o
ttticroinstructions is knot',rt as a nricroprogranr or finnrvare.
A firnlvare is rpitlg,ay btt*,een hardrvare
attd softrvare' Wc'cart cottsider nticroprogranrnring as softn'arc
lha-t cap irrrpler'c.'t frrnctio's no
prescttt in thc hardrvarc. Microprogran$ can be ctranged
in trvo \\,ays. ll'rlrc ct'rptrolrrrcnrory is no,
RoM. tltc ttscr catt rvrilc il llelv scqucncc of nricroiristnrctions inro it. 'l'lrc
c.rrrputcr.ury lravc a
progl'atll tlt:tt catt altcr thc ttticroprograttt stureil in thc conrrol
nrclrory. llsu:rlly,5or'cver
ttticr.Pr.gra.Ls ilrc clrl'gctl by clrnngi'g thc co'trol r'crrxrry.
Itt a ltorizotttllltticrtlittstruclion (l:ig.7.46), cach controtsigrral
witlirr r6c CI,U is rcprcsc.tcr'
b;,' nttt ltit in thc cotltrol lickl, In attotltcir lbrnr
of nricroprogranrnring, callcct vcrtical or plckc<rrricroprograttttttittg scvct'al cotttrol sign:rls arc cncodcct into
a srrurllcr
of bits.
vcrtical ttticroitlstntction tlttts ltas thc aclvarrtflgc of dccrcasing 'urrrbcr
thc sizc of co'trol nlcnlor)
j]lllf:L:'111.9:::1':rpl"ving cliso<lvarrtagc of-rlccrcascc ncxiuility, sincc it is no longci
possiblc to havc irrdividual
to cach corrtrol point.
'cccss
T,T.
coNTRoLtER
DE'TGN
Fis'7'46
''-
tt
,!
,el
:j
tt. ')
Solutlon.
hd
,:
)"
--l
I
I
l:
t:
i:
-;--J
--l
t.
Up-down
counlcr
Ft,g.7.45
In thc Fig.7.45,
I no onc
M = Mode select
M :0 fer up counter.
M = I for down counter.
1,6.
The most challenging and creative part ofthe design ii the establishment of design objectives
rnd the formulation of algorithms and procedures for achieving the given objectives. This task
(rnnot be automated and require the mental reasoning of a lluman designer. Dcsigner cannot
r, r
:nul
:hn
ntl
fan
.1.
Tbe algori0rm is stated by a finite nunber ofwclldefined procedural steps. Thts an algorithm
n o procedtue that specifies a finite sct of steps which if followed give the solution to a problern
Hrrdwrre rlgorlthnu Hardware algorithms arc used to specify thc control sequence and
.hta processing tasls of a digital systern A hardware qlgorithm is a finite number of wclldefined
pocedural steps that specifies how to inplenrnt a problem with a given piece of equipnrnt.
Exanrple 7.20. Draw the ASM chart of a 2 bit up-tlown couttter *,ith
eilcrnal reser inpur.
Solution. when up is high, count sequence is up i.e. 0 - I -2-3-0..... and when up
is low, the
countcr $'ill count-down" i.e.3 '2 ' | ' 0 - 3..... . As the counter must
reset back to initial state .,00,,
when external reset input is high.
l
-t
.t
Lint 3',,
o
l.in[.5
Att-to
t
i
F19.7.43
Tlrc next statc and output equations using thc state sssignmcnt
Ss,AB -001 SyAB -01;.12,
Output
Z = 18"N,
linl
A+
1.t
AB-ll;Sj,AB - l0;arcgivenby
ofl
(,,{+) is
=Vgx+M+@
a linl I
2
lin&
lanl
=X(B+B)
: )(,
(ldernpotent law)
Norv to form SM chart from abovc state diagranr, for each states draw state boxcs. Now afier
each state boxes put the inputX in decisi,,n box. Put the output in conditionalbox in patl where
it will I and connect next state links. Fig. l.';J .''rorvs an SM chart for the state diagram given in
Fig.7.39.
Ouput Z :
BX (from link 4)
= ABX+ABX+ABX
link I
lin! 2
lin! 3
= |EX + /gX + \AX + ABF (lndc.mpotent
larv)
= 786+B)+ oXG+ el
=17+B)X
'l'hc ncxt sratc
ofl
(ul+) is
+ ARX = IIX
'+ 47oX
linl I
linl l
I;ig. 7.41 shows tlrc rcalization of SM clrarr.
ct(rcx
clock
F19.7.41
7.19. Draw the ASM chart of a sequence detector to detect the input sequencQ
.. . . ^ Ptltple
" I 10". Derive the next state and output equations by tracing link poths on
the ASM tiort.
I
Solutlon.
t
I
t
I
F/ig.7.42
F
ilE;
-.i,,1'1
Ncxt, rvc will realize the SM chart using D flip-flops and logic gates.
r state
i'rill
t
_l
clock
Fig.7.38
Exanrple 7.18. A sequenrial cirruit has one input and one olttlrut, giles oulPut I wltttt il
r(,ceir.es input I followittg u .sting d tt'o or lltree const'culit'e irynl 0. I)tuv' ttntl rculi:t' tltc Sll
churt usittg Dflip-flo1ts ttnd logic gatas.
Solutiott.
0/(l
.S,,
|/0
f'l
,l
vl
rj
F19.7.39
Link
I
I
.1
:l
_t
Link 2
9i
I
I
I
I
I
s2
I
I
I
Link
4:
Flg.7.40
v0
Fig.7.36
Now to form SM chart front Fig. 7.36, foieach shtes drarv state
boxes. Nowafter each star
boxes put the inputxin decision box. Put thc ouput in
conditional output
r -- box
---- in path where it r,,i;
I and connect next state links.
! Alt=g1
,l..
t,
output
z=ABX(fromtink5)
ofl
(l+)
l'
Fts'7'37'
:
t
is
srate
ofg (B+) is
ti*t
= ZEx +
1ax
fnit
+ ZaX + ABX
= 7x(E + q+ BX(Z+ A)
=7x+BX
.l
'I
-)
v,wr ffi
fiqput
'l 'lnce
:
I
t'
t;
).
)
i
It
,l
;
I glven
(,i
pul
| (Fig
Flg.7.Qs
'
aircl one
oulprtt z. Outpttt z
I,
i/'total
Exemple 7.16. A sequence recognizer has h+'o inputs (x and y) andone output (z). If input
sequetrce of pairs xy = 11,00,10 the output v'ill be l. Draw the AStl chart of a sequence
recognizer.
'
Solution.
Fig.7.33
We rvill solvc thir problenr by first constructing a statc diagranr 'l'he statc diagranr for giver.
sequence recognizcr is shorur in Fig. 7.33.
Norv to forruASA{ clr:rrt for cach statcs draw onc statc box. Norv alicr clch stiltc boxcs pu
thc inputs in dccision box. I)ut thc output in conditional output box in paths rvhcrc it will I (Fig
7.34). Conncct thc neet statc by link by inspccting statc diajrant as sltowrr in l;ig. 7.34..
F19.7.34
f-
-:,
t
tl
,.|
y'os
ph
I
scquence
ttce of pairs xy =
01,0t,tt.00.
0l,0t.tt.
00
.::';fi:;-T..:'::::::."i::rl!,
;:tJil.
i'put i'ttccisitlrt
ffl1lil'i;,i;,i.-ij i:!;l;itr'a
r-\(}
\Ys
--r
I
t-
--"1:{;.
I.
t.
L-
:'
I
L,
(
I
I
D-;7
t1l+
,\,
7.32 (a).
1o,/
t/o
;,
il
,r5
6
,.q
tate
'm
.,1 wl1
Solution.
.t
'I
lr
Ir
I
a-
F19.7.29
S,.'
t7
tl
F19.7.30
state
Table 7.1 shows the transition table for Fig. 7 .26. Table 7.2 gives the corresponding state
table for Tablc 7.1. Wc have madc the state assignment Q = 0 for S9 and Q = I for 51.
Teble 7.2
Present state
0l
l0
ll
so
So, o
So, I
So,l
.11, 0
.Sl
sg, I
51, o
51, o
St,
nFig.7 .27.
I t/0
lt/t
00/0
0t/l
t0/l
tu0
l/0
00/t
F19.7.27
To drive SM chart frorn Mcaly state diagranr, fornt 2 statc boxcs for cach statc 56 and 51.
Aflcr caclt state box put input in dccision box and put corrditiorral output box in thc path wherc
Mcaly outputs arc l. Fig. 7.28 givcs thc corrcspondirrg SM chart for a givcn circuir.
r
I
I
t'
..
t
(
I
I
I
I
F19.7.28
'',,wsynchronoussequentials7stemhg'tnoinputsXandYandoneoutputZ'',
wh.en
the sumfr the inputs b a nultiple of 3. the outpuit ls tnte, otherwise
it
is
false.
Driw th\,
t,l
'-.t
_Ll
l( .tYfl
.i..
"
.Ss:Initialstate
ifS= I then
Rtelnput,{
-rd''.
Ra
Input 8.
Go to 51.
if
S = 0 then go to S9.
.S1 : R,a
52 : If (Bonow = 0) then go to Ss
I
I
If(Bonow: l) then
'
I
Rl
Go to
-.rut
)t)
(2's conplement of
R,a
Sg.
Exarnple 1.13. A sequcntial circuit has oneflip-tlop Q ; ttt'o ittltut x, und y; and onc output,
S. lt cortsist of afitlt adder cirait connected to a Dflip-flop, as slnv'n in Fig. 7.'26. Drive the
stute tuble and slutc diagram of the scquential circuit.
x
Ft,9.7,28
Draw the equivalent ASM chart, leaving the state boxes empy'.
I
Solutlon.
Table 7.1
Present state
i
._J
,I II
a
0
0
0
-l
I
I
L-l
l.
t.
I
Inputs
.ry
00
0l
l0
ll
00
0l
l0
ll
Nert state
Output
.t
Rl <- Rt-
Ra
R.1
artt! R6 ant!
Solulion.
2003)
InitillSrarc
Rrr*
lnPutA
Rs--lnpu
fa*Ra
+ 2's complemenr of Ru
Ftg.7.2S
;,.ffi
\'
.tl'lll
a
- ,a !
Solution.
a^*?
-"-\
qx
TE z( + ?
)
I
I
,l
_Link 3
Ex
rl
*I
&-? Qx
TrtrzV$.
ed,\H 1F
ax
drTqX
oo\
-o\ o-l
.-,
?Y=pqx
F19.7.22
outputT'- PQX
Using thc rcalization stcps givcn in scction 7.5, wc frnd that thc conditional
rincc thc o-nly link, path tlrrougM tttttt witfi PQ = I I and takcs thc X = I bronch'
a state B that has
Thcrc arc tluee link paths (lobelcd link 4, link 2, link 3), which tcnninatc in
X=}branch ond temrinates on a state Cin
0 - l. Link I starts with a present slate PQ= 01, takcs
paths'
ilrict e = l.Therefore, the ncxt-state equation for Q thts has 4 terms corrcsponding to the 4 link
Ig
Epex +pox
Gffi@riltrmr
+PAx *
paYt,I
;=
P=
l,
so
PQX
assignment as
Next state .quuffii of e can be simplified with k-rnap using the unused state
r don't care condition.
.Pa
00 0l ll
rl
3l
F19.7.23
e' =Fg+Fx
+QX
l0
0.
@-
E xarrple
to state grapht.
o\
s,lrrtlo''
'l'trc givcn
sM clrart r,rr l ,,1',1 lolr-on.^for
each sratc. J6 is rhc srarring
It has orrc irrpur ,\'ond output
srare.
z uri o.,tprt is l onry in ,iot. s3.
If 'll = 0 is statc sg' z = 0 and
thc ncxt state is J9 itself,
If k = l,
-0, thc next statc is J1 .
If'li-0i'state s2'z=0andthcnextstateisJgwhile
In
forx=l,z=0,thenextsrateis.s2.
{r, ifx=
Jff:'**;:rffijil;ft*:l'jl
I
I
(.
r-7\
nplffi{'
A, PQ = 00; B, PQ = 0l
; C, pg 11.
Derive the nexr sh? and
ourpir equati,
oy rracng link paths on
the equatiotu
the isM chsrt.
oni.iirf),on
r.uo,io,u anc!
thrn aron-ti;';;;'u-u"u,r
rhe net*ork;;:o{;::'::^':!o::tu .on
the
t
logic gati.
sinptifi
-]t. f,Vft
'!
when'
t' 'arl
.".r,
7. t
8 to SM chart.
o/
iii.a
-t
tl
i--_i
I
I
Fig.7.18
Solution.
I
I
I
I
1
I
I
I
I
ll
-J
I
I
I
..)
'I
t, rt
F19.7.19
Form 4 states boxes for cach state and after each state box put input in decision box and put
conditional output box in the path whereMealy ouputs are I . Fig. 7.19 shows an SM chart for thc
state graph of Fig. 7. I 8.
Solution.
ltl
0
Fig.7.16
!IT.JT{I COP
-,
(.
(
I
Fi,1.7.17
ff;li:':fil ;}1:1,:1:ll'*i"'^t"5*::?]:*''ne
ofFig. 7.16.
i],F[ii'i.
I
/@nn
r-l
-l'
Insecondcase(Fig.7.l3(D))theoutputis l'= |
=t
or8:l,C-0'
Y = BC+AE+ABe
llcnce
= AE+BUe +C'l
= AE+ BQ+C)
=tr+ BC
i
i
I
,frich
is the same
Hence
X and Y are
14icolly equivalent
t^----
@DrawanASMcharttodescribeameaIystatemachinethatdeteclsasequence
i!,, lotot
,r..
"-t
Fisl
1,.,^.1. .'leaal
, i
I
Ftg.7.14
'lb dcrivc SM cSart fronr Mcaly starc ctiagram, form thrcc statc boxcs for cuch statc l, B and
(.. Aftcr cach stntc box put input in iccisiorr box and put conditiorul output box in thc puth wltcre
lrtcrly ourputs arc l. fig. 7. f5 gir.r thc corrcsponding SM chori for I givcrt dctcctor.
F19.7.15
ffi
Solutlon.
[:xit
Patlr 2
F19.7.12 An SM block
Output Q is alrvays I , so it is placcd in thc statc bo.rcs sincc it do not dcpcntl on i1put. 1.,
7,12 shows thc rcquired SM block with two exit path.
1
I
Errnrpfc 7.6, Figurc 7,13 kt) and 7.13O), represeilts an ASM chartsfor tv'o boolc
function X ond Y show th,ot'thc
F:ft h -:',4-
twtt
tLWlty,cWtg&
(a)
hJ.
:
ore,
F19.7.13
= I andC- I Hencc
:i:i:,:,
:l
I
tit
Ouput Z is always l, i.e. it is not a function of input variables (A, B, C), thereforc.put
',rrtput Z in state box. Ouput ll/ is I ifl A and B are both I else f l/ is 0.
lf
C=l
the
ifC= 0orA=0andcxitpath
,l rs taken.
4Sj!chart.
s ,>\ ,/'
rr
Solution.
*, ,[i;Ht*m
of Fig. 7. 10.
Example 7.5. Construcl an ASM btock that has 3 input l,ariables (A, B, C) 4 ttutlttrt
wriobles (P Q, R, S) aud 2 exit paths. For this block, output Q is alv'ays I, cuul P is I iJJ' I " 0.
tt A and B are 0 or if(A = I ond C J q,R = / and uit path 2 is taken. IfA and C ara I or
Jl-= 0 and B - l),.S = / and exit path.l ts taken.
tt'
I
,,r,.ln""tl':;
ill ;tS fJ
Fig.7.8
li'j:'.TIi
'i'!,t,',;i.[1','..'.'i'f
f j13:T,q.l:::::r,rvir
be .r ,regardrcss
rr,*,rruc or
,?.,i';,i"i,1;;:;;1;;,,:,Ttk* 3,'ff::i,*"-rl':,j;lliiit'J"l;[:'ji:iiilJ],;i':I#
,,,
;:,,; il ;::fi.),:,,: :;nH:ii:j:;,1,i,:
J:;:llTll"Ii3
If D is 0 ttrcn outpuf::will
bc .l
llxnn:otc 7.3. Coust^tct
Y z), und
t''
:fif, ":.0
y'c-'ior,4 -0,x^w.t1
iinae:itpattt
2 is takcti,
I
/)It'l
r.-r
t
.l
rti
.!
:
'l
I
!'e
,ffi
rlif
l..._
4. For each of these link paths, find a tcrm that is t when th'e link path is followed. For
example, to *ritc the cxpression for next statc of 8, we consider link path I n'hich is start in
stateZp(AB =01), takes theX= I branch, andends instate ZOUB = I l), so the next state
of8 has atermA'BX.
t.f
: l.
..I I
ii
Link Path
rbi
;l
il',rl
.{
:
t
..r
I
v()
ll
I
i
I
I
a
l'
illg
I
I
.rlc
Fig.7.6
4. The expression for thc next state of Q is formed by OIting togetltc'r all the tcnl$ fotrnd
stcp 3.
5.
6.
Sinrilarly, thc cxprcssion for output can bc rcad dircctty fronr the ASN'l cltlr t.
Find o sinrplilic4 cxprcssion for output and ncxt-strtc cquatiotrs rvith a t-tturll trsittg thc
unuicd statc ossignmcnt as n dott't carc condition'
thc ASM
in
ctnrtforlollowlngfitnctiott,
i,f
Z=A+B'C
Solutlon.
.l
l.r
ty.
J-r
.l
t!
I
''0'
nd
Flg.7.7
+
placed in the
ASM chart for Z = A *B,C contain onlylne state box. Condition A B'C is
decision box and Z in conditional output box.
is placed
Errmple 7,2, Draw flttjWhartforfoltowingfunction, deach input variable
in the decision
box.
Z-
| if AB t AC= l. Ilence, Z= A (B + C)
= AB + )g
in
'
iil
l.
7.4.
CONVERSION OF A STATE
DIAGRAM TO AN ASAA CHART
*,,."l|X,ll:ilff::*ilu|1ji:'T;"'diagram
exacrrv
rs
ormachine, bur
ce
rrair'
*r.,
nrusr be ronowed
ftil;,il;i'ffT,',ilTifilifialil;;ff' ;.
arrcJ
folowi'g
.
l.
boxcs.
o' botl
r1c starc
l.
rodilil
boxes.
steps.
t
I
'i I
in the state boxes since they
do not depend on the input. ii
3. After each state box put
I,
the input in decision box.
L,
4' Depending on varue of input
connect the path to next
state box.
[-r
ll
REAIfZATfON OF ASi,l
Lii
CHARTS
Realization ofASM charu
u', ri-it., to the rnethods used
to rearize state diagrarn
t'ft
I
ut
ihe
tn,
or*i
r#rq*,ion for a nip-nop irgares
fr1,-"rffif;:"ffj;" "n
and
e
7,5.
*'l
"i.ri",
l'
'nd
tl
I
I
I
Branch 2
f
I
I
-1
,l
,l
-'l
tl
AIJ
tt'l
.l
Fls.7.a (b)
IJ
tl )
cj
il
7,9,
EQUIVALENT AsM
CHARTS
'
I'
'
',
ASM charts arc not uniquc, it nray havc nrorc tltan onc cquivalcnt fornr Fig. 7.5 shorvs tlrrcc
cquivalentASM charts for conrbinutional nctwork Z-A $ ! q.
I
;
Zo A (8 + Q
|
ASM chart for cornbinational network contain only onc state box. The output Z= | if A =
arrd either I or Cequal to l, as shown in Fig. 7.5 (c).
Fig.7.5 (D)shows an equivalent ASM chart in which Z- | if either AB = | o: AC= l'
_ _ -__ ,.,^e.rr,tc)
::]D,ffi'I;|r,Tj,;: j::*:j:n:n1b."_
wl$
il;"'.;;';,Hffi:i:;rgnals. The
'i
(iii) cottctitiottat
A.Fo,irli't"ffIl,ii!;il.
bo-v.
is sh.orv'
'urptit
Fig. 7.3 is a rectangurar
bo'x rvith curved ends' It
contain conditional oufput t;r;.
conditionar ourpur crepcrcrs
(he state of the systc'nt
borrr
and the inputs. T}erefoie th. .on,litional
output signals are solrretinrc.s
knowrt as Mealy outputs. A conditional
outpur nrusr follorv a tlecisitln
bo.x.
i'
,.
(ltlnrlit ional
()ulpui l.lsr
0,,.[?;';.,:;:lillTi[{f-i,firon,
.,
.r
I
li
,, ,,1,?fiff:
"
ch and tink
poth.
Apat;'ft'"rrflfilrilTlck
L,
rrom enrrancc ro exit is
rererred ro
(l
tl
t:
I
I
.t
i -.-l
//
r-\
/ ''r
to VHD|
tl
rj
-
.-1
rt
ATGORITHMIC STATE
'{
rl
il
n:
I q --t
;l t
|
r.,D
_l
t
I
I
l
i
!
I
i
d
I
i
state
rrlvarttagcs.
l.
.J
tI
I
i
I
1
{I
II
.5
I
I
:l../
rl I
I
.,
;: il;,;r*';;;
scqucntial circuits'
rhc opcration of both combinational ond
.ori.,
' :#ilffi;
in'more
givenASM chartrnay be implcmented in hardware
7.2.
ltt'
CHART
PRINCIPAL COMPONENT OF AN ASIA
At
a state box' It is a rectangular box'
(f) stateDox. The state of the system irreprcsentedby
hand corner the state
is siro*,
rhe top left-hand.o*., the name of rtui,
state box, the output signals are listed'
whili::*::ij,ltn,
.,rr,,,i"t
"i;;i";;:wt,ttii,rtt
Stote Assignnrcnt
OutPut Llst
i,
r,.i
luo:1*
'aat
or Rcgister OPcntion