Beruflich Dokumente
Kultur Dokumente
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.
5. E.rplain the various blocks of'.a..SiU florvchart. 6. Explain analysis and syrthesis process of AStvl.
200(
' '' .
8. what are some of the advantages and disadvantages ofASM chart / 9. Ilorv an SM chart can be reatizc by using a MUX and pLA ?
10. Iixplai^ tlre c.'cept of microprogranl*ecl controlrer. PRO B LEM S l. Obrain thc ASM clmrt for ftrltorving lirnction
/. = ,.llJ +. ("1)
(rr) It'rvc ca. put rvrrorc cxllrc.ssirl, irr co'clition box.
(l)
2'. Cttttstrrrct ort.SM blobk thlt has 4 inPut varilblcs (A, IJ, C, D),3 outlluts (ll: A', ]), 2 cx( '.tt patlr.s, lrorthis blockoutput X is alrvays I orrtl = AD t.CD'arrcl l, = /,1J, .t CD,.
Il
rJL:rt*\._'j.
";)
(o)
Flg.7.B't
.o)
chart to describe a Mealy state machine that detects a sequence and that asserts a logical I at thc output during the last state of the seque'nc;.-
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 i ----.' '-' "'r._ -"-"'-' "': ji givencircuit. r. I
I
'l L-It
I
an
for
Columnl
ASM chart components
Column tr Synrbol
j
l.
State box
(A)
2. Decision box
-oO'-lI
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.
3. Execution of SM block is concunent process. 4. ASM charts are not unique. 5. AsM chart for combinational network contain ouly one state box.
E)(ERCTSES-7
0BJECTIVE TYPE QUESTt0l,tS l. Thc statc of the system is reprcsr:r.. .a by
(a) Decision (c) Condirional
box box
conditionarbox
(c)ASM
Sequentialcircuit program
,rrO
(c)
(rro
(0) concuncnr proccss
(rrf notr,
("),;i(6),
8. ASM chart for combinational network contain (o) no stare (rt;;. (c) two state box
box
lo
(rf) number of state box equal to number of literats. 9. The Moore output are ptaced in the (a) State box (6) &nditional box' (c) Decision box. (d)ASM block. microprogrammed conhoiler contror words fn l are hetd in (o) virtuat il.*ory (c) Conhol
F Ya
0it
tr't .l
tL
lr,.
rrcnx,ry menr,ry
Fftt H
l.
THE
ErAl{KS
(did;;mory.
:
(6)t;;;i;;
.
.
ri.
I
t,
L,
z """"""
[r
I
I
-'l
.l
Yn-t=l thenX< Y.lf Xn-l=Yn-t,tltenitisnot f = I and Ir-1 =0thenX>l'.lf Xn-, =0and p,rssible to decide at this stage wheth er X> Y or X < Y or X = L We shill both Xand l/ left by one t,rr alld compare the bits nroved into ,tn-1 and /r-1. C is a countcr used to count tlte numbcr of
rhi(is in registers Xand l'.
I,
Tt.
ASM chart
ASM chart is concented with digital system which may be combinational or sequential. ASM charts are more voluminous than state
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
State dia State diagram is conccrnecl only rvith sequential system State diagrams are less volirtlritlous llt:ttt
l)
l'
+r
lo
ASM charts.
State diagran$ are unique. State diagram is not concerned rvith tirne
It hrs a fcrv cotlll)otlenis. It is often diftlctrlt ttr tlcsigtt thc rlig,illl systcm by using statc cli;rgratll its
conrpared to n SM cltart. Statc diagratl$ are lcss crror prollc.
'l'lrc ASM chart spccifi.* ott thc stcps to bc codcd ond hclps to prcvcnt ontissions or crrors.
Flow chnrt
ASM charts are useful in hardwarc designing of digital systent ASM chart contain implicit timing information ASM chart is a horv chart that defines hardware algorithm
l. Flow 2
tlpe of systcm.
Flow chart is not conccrned with tinle relationship. 3. Flow chart describes the sequcnce of procedural steps and decision paths for any algorithm.. 4. Flow charts provide a clear overview of the any type of problem and its algoritlurr Ior solution. 5. It use r.norc components of different sizcs and shapes than ASM chart.
6. The terminal symbol'in flow chart shorvs the beginning, end or intemrption point in a prograrn 7. Flow charts are most probably unique itt nature.
l(' r 8rc
The threg principal cornponents of anASM chart are state box, decision box and conditional output box No such.symbols are used inASM charts.
flip'
ASM charts may havc or more equivalent form.
..xfi0
ed.lf
number
'i
Thble 7.14
ROl\t address
0
I
2
Nlicroinstruction
R, e-0
R, +- R,, Carry +- 0
lf (Z= l) then go to
external address
ifR,
=6
R, e-crcR,
4
5
If
(carry = 0) then go ro 3
frz
eR, +l,goto9
Ifcarry = l, increment -
R2.
Solulion.
X -Y -C.l,,li -.C--ll
lnpul
lnput
0
Ftg.7.80
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,
Two n-bit registers Xand Iare loaded with external inputs. On the start signal Xand.Ir-c
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
Teble 7.13
.
Microinstruction
A Comnrcnts Clear 8-bits registers A and C Load input to 8-bit register B 0
I
2
11.5.,
ROII{ address
<-0;C +- 0
B +- (00001010)2
A+
A+ B
B+B-l
If (B * 0) then go to 2
C<_A
4
5
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
tfl[,!n;"oo
C,A*A+ts
Prtx.lucr in
A,()
l)xanrple 7.35. Dnnv rlte ASlt{ cltortlrtr XOR gatc,. Solutlon. Wc knorv that output of XOR gatc is
Fi1.7.77,
Z=A,IJ+AB,
]'hc ASM clrrrt of circuit is shown bclow
:
.Exrmpre 736. write the nticrop,*trlli;'ira ,n, swn of an the lirst r0, I oit numbersfrom (00000001)2 to '"-- "'1 IOOOOtOtOlr. solutlon' The mi^croprogram is symbolic P* i, given below. The variou.adr.rr* ol RoM are listed in the nnt cotin'u tn oe se-cond colunri, the microirutruction that m,st b" rtir'., rt each address is given in symbolic forrn The comrneni, ir. used to clarify -.v uJls rv rrqrrry the register tran rfr tn slatenrcnts
ilJ,
!
trl
Ir
:-l
t
i
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 and label their ouputs Tg, Tb flip-flops the input functions.. diagram revels
Choose four p
?n2
Dru=S'To+ZTt D7,=STn
D,.
T, +
Z'T'
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
In state 2n3, register s C, A and Q.r, inro one conlpositc registe contents are shifted once to the right to obtain a new partial produit.
lhilld
'ir
CAgani
as'follows:
c
0
0
The procedure for multiplication using the circuit shown in Fig. 7.73
andlig,7.74is cxptal
'
i'
e,
Trble 7.12
m m
l0l0
0l0l
0 0 0
0
l0l0
l0t0
Initial value
ll
r1
First cycle
LJ
'
ri
l0l0
l0l0
r0l0
Second cycle
lill
0lll
mll
lmt lml
Third
cy.l" , ,
I
0
mt tm
llm
Add I ) sfiift J
Fourth cyclq.
ru
| {l
+'L ,lr- t
,!
|ffi
t'i{rl
AR._ Multiplier
BR*
Pp
Muttiplicand
Alt
0's
nrultiplier ont! da.rigtr thc conrol logic ulng one hot approoch, Exploln how lt di/fers from o convantlonal flow chart ?
ASM
,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 Qr
Qz
Next strte
Input conditions
oi
00 0l
hfl-lX Inputs
NILIX I
a:
s'
.s
MIIX2
,s
I
I
0 0
0 0
I
I I
0
I I
t0 00
I
z' z
I 0 None
z'
I
0 I
0
I I
.l 0l
E' E
ffi
E'
NIUX
't'l s
0
I
I t,tuxz
3
rri
/
Tl/
. theErrmple 733' Draw an ASM chartfof'f l,!i", ,ircuit that tnurtipries nvo binarynr^brrrl, by repeated addition
melhod.
t.'l t-
solutlon' The system consists of,fu".r:.gisters.-r{4, p4 register 84' the multiplier in register f^ *.d where multiplicand be in; Ap and tf,. prooui in'registelpn:il; conhol *., onr external input to start thr oprr.tioo *a o5 rr;t* ;;;t z is the output of a zero detection l] 's circuit' Adder circuit adds tbe contents gf t^,g 4. 'ilr value in z ischecked by the z,,rcf:; detection circuit
whenz{p becorrs zero after Ji,.n
TheASMchartofcircuitisshown
u'figl.tZ.
is decremented by
l.
il
{ -r l.ldntflf,f
ir'u
Example 131. Design
the ASM
".ll '(
.J
as
chartfor JKflip-Iop.
is
-.;an
ching
I
I
Q(+l)= tOfO+RQ0
The ASM chart of JK flip-flop is shown belorv.
i,
l
I
,J
,l
I
l
:l
I
Q(ttl) -
F19.7.69
Ilxnrnplc 7,32. A systcn contisting of two ragistars R 1 ancl R2 nui n fiip'llop E counts the rumbcr ol I I loaded inro R 1 ancl sets R2 that nuntben Draw the ASI'r chart for the syitents and design the control circuit MUX'
(RG PY BhoPal, Dec,, 2007)
Solutlon. The systcm consists of two registers R1 and R2 and a flip-flop E. The control uses one external input 'lto slart the operation and two stitus input 6 and Z. E is the output of the flip-flop andZ is the output of a circuitlhat
chccks contents of register
R 1 for
R1 is shifted one at a time to flip-flop 6. Tbe value in E is checked by the conEol, apd each time it is equal to l, register
R2 is incremented bY
l.
F19.7.70
r
I
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
EW
N.S
Rcd
Crccn
EW
NS
Red
Yellow
L.
t:
{t
ft t,
F19.7.68
:
i
i
t-l
I
r_
I
,i
l)uring the data system designing, designcr should consider the fiollowing points.
l.
re
Cost: depending on the nature of the systerq the designer must sclect the most economical solution for the givcn systenl
:
L Efficiency
tirne.
i. e.
fast response
()..
3. System should be reliable and must have some securiry measure to protect the sensitive data in protected location.
,l
'ts
l1
,l
,
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;'
tat
llcr
Solutlon. First wc will tske scqucncc of traffic. Wq won't considcr cmcrgcncy condition. thcreforc our tralTic signolling schemc is os follows :
(a) EW
(D)
sw -.Red
)I 5
,psi
)tt' NS -y.llo*J
n8
nor
i
;
(c)
rw - Yellowl
NS
-Red
J)sec
(.ft gw
ihe g.
e''tl
si-
ith"L
'
(e)
rw - Yellowl
ri ls
NS-Red J)sec
(rEw-Red
NS -Yruo*J
l )tt' -
l.
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.
Fig.1.66.
The relationship between control and the data processor i1 a data systenl is shorvn in
lnputs
l:rtcln.rl
lnputs
l);ttit l'roc'csstlt
--
Outputs
controltcr is a sPccial scqucntial .,r.,1',0;t1;l6r..riu., input fronr coch coprponcnts of t6c systctll lttd outcr irttcrfacc ond gcncratc thc control signals thlt control thc opcration to bc pcrftrrntccl by thc data proccssor. Tltc data proccisor part may bc o gcncral-pfirposc proccssor unit' or it rrray consist of individual rcgistcrs ond associoted digital functions. Design of a digital system can be dividcd into two categories, first part is design the data processor which stores the data in the flip-flops or register and second part is design a controller which control the corrcct operation of sequence to be performed Uy ttre data processor.
Before designing the data systerq designer should know very well, what the system works and what is the need for sptern In general design a data system involves the following steps.
:''
!,
t
i
It
*,
I
l.
Z
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. 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
1"',
I
tl t!
'
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$
rN
&in?'
.t
? rTI lll
i :'
'
"t
I\{icroprogrammed controller. In a microprogrammed controller, control words are lcld in a separate memory callcd the control memory. Each control rvord contains signals to uctivate one or more miciooperations when these words are rctrieved in a sequence a set of rrricroperations are activated that will complcte the desired task. The set of microoperations lrrricroinstructions) for the control of a computation sequence is called microprogram. Structure of a microgrammed controller. The structure of a typical morden
7.7,6.
i
I
nr,.rnol conrrol
f
[_
Control lrurtclirln
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
fie ld selects the
'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 lt t0 l0 l0
ll ll
xQ xl 0x lt l0 0x l0 tl
l'lblc 7.1I
xy 0x lx
Inputs
Outputs
To
Tt T2
T3
1000 1000 0100 0t00 0001 0001 0001 0010 00t0 0010
I'rotluct lcrnr
Ou(puts
Qf Qf ro
123456 ll
r't
r'2 r'r
I 2 3
t-
4
5
l-tllltll l-
I I
6
7 8
l0
r r
| 2l 3' 46
PT.A
l-l-
l-
I -l
.l
2
A
F19.7.64
,l
tt rl
pnEnffii
-.1.--
tl
to the next state and outputs in the state table. The numbcr of states detennines the number flip-flops for the sequence register. PLA.
of
a
The following example demonstrates the procedure for designing the conrrol logic rvith Exanrple 7.28. Derive the PLA program table Table.7.8.
;
!
-)To lr,
I
for
-,T., il -, _;r3
-l
I
rl-
Table.7.8
i I
I
,I
Present State
Nert State
Inputs
Outputs
Qr Qz
hQz
.ryz
0xx lxx xlx x0x X xxl X
0.
i
I
00 00 0l 0l ll ll
00 tt
ToTtT2 1000
l
I I
I , It
I
0l 0t 00 0l
I t
,le fronr
h I)[.A
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 Innuts
Outnuts
4 5
(.
QrQzx
I
v
0
t23456 QrQzToTlT2z
I
I
2 3
,1i
00 00 0l 0l ll ll
lftfi
, ^lor-
, inputs
rt .fthe
'om the te tabte itrcs no tinus to
l0 0
I I
I I
4
5
lI
I
n't
carc
n rdto
'L.rt are ui'alent
L
I
2l
3
NIUX
srI
0
I
2
3
uslng P!4. 'l'hc dcsign ofa I'}LA control rcquircs tlat rvc obtain . rhc storc tablc fror: tlrcASM 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
's
Ft1.7,62
Oulput$
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
conne-ction in the program table. The 0's in the output columrs also indicatc no connections to the OR gates within the
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; ililU
PL,A.
""1','
The conversion of the state table to a PLA program table is ycry e8sy. The don't clic conditioru in the input columrs and the 0's in the nextitate and output colu,urs are change<, ;o '-' (dash) i.e. no connection and all other entries remain the sanrc. rhr input cquivalent to the prescnt state and inputs in the state table. The outputs ortm pu are equiva[enr
to;;'ifiir;
I
c .tft
1
.l
I
tr
_Ir.
{,-)
'o
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.
Input C6ndltlons
MUX lnputs
i I
I
't Jz)
hQt 00 00 0l 0l
ll ll ll
Qr Qz
Mtxl
x'
x
0
MT.D(2
.:
l0 l0 l0
00 0l ll l0 00 ll l0 00 l0 ll
r
v
v' x'
ry xy'
ry * xy' =x
xy
x'
xy'
xy
ry'+ry
=x
x)'
The MUX inputs from the table are used in the conhol imptementation of
Fi
g.7 .59.
0
I
MUX
',
3
sr0
I
so
MUX2
Ftg.7.S9
If xnrrrplc
x.0
00
xt
aQ
t=l I=l
,AFtg.7.60
x=l I=0
(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
,t
I
,
I
I
F19.7.58
'isa
'gister.
'r '' has
chart ofFig. 7.58. The input conditioru listed in the table arc obtained from the decision boxcs in the ASM chart. Thc two colunur undcr MUX inputs in the table specify the input logic that must be applied to MUX. The MUX input fo, cach present state is dctermined from the input conditions *tln the next state of the flip-flop is equal to l.
: .rlly)
of the 'r iion It ,!the
L.Y,
Present State
Next Stete
Qr
00 00 00 0l 0l 0l l0 l0
ll ll
Qz
Qr Qz
tl 00
t0 00
l0 0'l ll l0 0l ll
x
x.'
y'
Mtxl ,+x'!
MUX Inputs
MTIX2
*x* y
x'Y * x'Y'
--
x'v
x
x * x'y'
x'
x'y
x'y' r''
x
-x*'l'
x'Y * x'Y'
=r'
0
t
x'
x'
x
t
Example 7 '25' The state diagran, of a control unir is b),the oneflip-flop per state nrethod. ,Z=0
shorvtr
tlte contrri
sotution. choose five Dflip-flops."iilot itneir outputs To,Tt,72, -- - u' ' r z" T3and ?"a. Inspecrion of the state diagram reveats the input hrnctions. ' " r
D7t
h=0
To + z'
Tt
Tz
Drz =
D7r=zT2
Dt't
Tl +
Ta '
F19.7.57
"d *. intro ,:;:il:: rrv lrtla\r rgvgl lla,\ *: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 11H ;t;T::Hl'"l"" givin in'thosM chart. in f nn* re termine iffi ;,i, ffi ff f IrIl ;1n:1s The uts to order crarify,r,, pror.i*"'.;fffi:.,'ili L:Xffjrr:,t:gg:ru fo lo wing design exanples.
is
*t
l"l:1.r-.u*rJiilti:lers. $r.:g:9_l-"qi. sares are reptaced by muttiptexer. rt is t H: :t-1t-"11 level contairu a.register r hold the pt.r.niuinary ;'; ;:; J#"'ffi ::::',',: :ff: 3:,T1 ! ::l ^' " thatts or MUX ;;i
j
tn
il;;'
a
srate value.
11e-
de
Errmple 7.26. Design the control whose ASM chort is given in Fig. 7.5g using rcglste4
and decoden
MC2X,
,l 6l
I
I
I I
il
-t
:l
i
I
9'EFtii - !_;
1i
rii .,iri*r,.. i
' ..
Dro=x'7'6-77
7'33
Df,
T(l
Dr'- = Tr
l:
l:,
(
lr
ii
-!
It
t,
'a
'l li
I
I
'' q
I
1
I I I
j.!
control gular
,inbc
re necd
.l
munl
srln of
t
'I
stale
'I
I
.-J
'I \
n..nd
tc
is
AND
'arr1 wc
ntot
clcar clk
F19.7.55
m
QrQo 0
I
000t il
0 0
QrQo
t0
000t
0
I I
il
0
I
t0
X
l
0
x x
0
I
Dr = x'Qr'Qo Ft,1.7.52
Do=x+Qr'Qo
Dg= x rvhere
T1.
Q6 and
Tz: Qt Qz
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
,
3.
F19.7.53
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
is specified in the state diagram and . i obtained from the conditionspecified in the directed lines going into a given flip-flopstateAND'! (logical and) with the previots flip-flop state. Iftbere arc more than one directed tine going into ,'l state, all conditions must be logicat Oifed. Using this procedure for the giveri st.i. Ai.t obtain the input functions.
i*';,'
lt r.l
rI
,l rl
rffi
l-l:lrl
To =
Qo'
To = Qr'Qo
Tl=Q:
F19.7.51
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.
7,7,2,
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
Input
Next Statc
Flip-tlops . Inputs
'
Output
To I
hQo
To To
T1 T1
x
0
Qr
0
Qo
D1 Do
0 0 0
T2 T2
00 00 0l 0l ll ll
I
0
I
0
I o
0 0
I I
I
I
I 0
0 0
I
0
0
I
0
I 0 I
0r0
0ll
The srate tabre corresponding to rhe AsM chart (Fig. Tablc. T-3
trtl
Present
State Synrbot
Present State
Input
Next State
hQo
.r
Qt
Qo
ToTtT2
li iI
I'rcsenl Stnte
'Iirbte 7.4
Ncrt Strte
Flipfloplnpurs
0
I
0
I
0
I
0l l. tl
t0
I
0t
0.0 00
I
00 0t It 0t 00 0l
00 0t tt
0
I
4 Kr Jo Ko oxox oxtx
lxxO 0X;0 xlxt xlx0
t0
000t il
0
I
0 0
000t
0
I
x x
x
x
il
I
t0
X X
I I
x
x
X X
0 0
0'
Jt = r'Qo
Kt=l
9r%
0
I
It = r'Qr
t0
00 0t lt
X X
0
I
x
Joo'
Tz'Qt
*,
:d.i,e.
7.7,1.
Uslng JK flip-flops. The following procedure can bc used for connoller dcsi
:
rhm
'rt $e l"ons
3en
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.
r uits
)utl'ef
3c,th
rl
present state of the connol. 3. Obtain the excitation table of the flip-flop inputs' 4. Find a simplified expression for ouput and the flip-flop inputs'
r'.rry,
r. -:
' iy
of
dware
5. Realize the control unit using gates and flip-flops' ln order the clarify the procedure, consider the following example. detcctttr tlrttt Exarnple 7,22. Drav,an ASI{ cltart ancl state diagram to describe a sequence detects a seqye,rce of " l0l ". Design the control unit using JK flip-tlop'
'l'o
t) .. ttv
\
t/0 (\z----
vl
T1 (Y()
f* \
\i./
-*_-1.|r
'
ttcd
o/()
I
l,-kccl
torrgcr
: rory I
I
F19.7.47
QrQo'0
QrQo= 0t
QlQs=
ll
of ;1 tern
ts
rt
F19.7.48
letailed
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
Nlicroinst ruct ion address Jump Condition Systenr Bus Control Signals Internal CPU Conrrol Signals
T,T.
coNTRoLtER
DE'TGN
Fis'7'46
''-
system controlter is a^spccial sequential circuit that receives input frorn each component, or j thc system and outer interface and ginerate the control signats that control the whole systern The subsequent sectiors of this chapier deal with rp..inr r*amplc tbat demonstrate tbe detailed -'..-r ewr'rt'':rucls lrrq sgratle11 dcsign of conuol unit.
,
tt
,!
,el
tt. ')
hd
I
,:
:j
Solutlon.
)"
--l
I I
l:
t: i:
--l
-;--J
t.
Up-down
counlcr
Ft,g.7.45
In thc Fig.7.45,
I no onc
r, r
:nul
:hn
ntl fan
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.
Erampfe 7,21, c'onstntct an ASM yTi;'if ,)src^ that counts rhe number of people in a room' People enler the roomfrom one ".digital dooi with a photocell that changes a signal x from I to 0 when the tight is interruited. They leave the room from a second door with a similar photocell with a signal y: Eoth x and y are synchrcn4ed with the clock, but thq may stay on or ofifor more lhan one clock'pulse piriod. Tie data-processorsubsystem consists ofon up-down counter with a display of lls contents.
l
-t
.t
Lint 3',,
o
l.in[.5
t i
Att-to
F19.7.43
Tlrc next statc and output equations using thc state sssignmcnt
Ss,AB -001 SyAB -01;.12, Output
AB-ll;Sj,AB - l0;arcgivenby
Z = 18"N,
linl
3
ofl
lin&
(,,{+) is
A+
1.t
=Vgx+M+@ a linl I 2
lanl
(ldernpotent law)
=X(B+B) : )(,
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)
r>+
= 786+B)+ oXG+ el
=17+B)X
'l'hc ncxt sratc
ofl
(ul+) is
clock ct(rcx
F19.7.41
Solutlon.
I
t
I
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
F/ig.7.42
F
-.i,,1'1 Ncxt, rvc will realize the SM chart using D flip-flops and logic gates.
ilE;
r state
i'rill
t
_l
clock
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.
)
Fig.7.38
0/(l
.S,,
|/0
f'l ,l
rj
vl
F19.7.39
Link
I
I
.1
9i
:l
_t
Link 2
s2
I I I
I I
I
I I
Link
4:
Flg.7.40
v0
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 box in path where it r,,i; r -- ---I and connect next state links.
Fig.7.36
! Alt=g1
,l..
output
z=ABX(fromtink5)
ofl
(l+)
is
Fts'7'37'
L
: t
I
l'
t,
L
.l
I
ofg (B+) is
'I
1ax
+ ZaX + ABX
= 7x(E + q+ BX(Z+ A)
=7x+BX
v,wr ffi
fiqput
-)
'l 'lnce
: I
t; ).
)
i
t'
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
-:, t tl
f-
,.|
y'os
ph
I
01,0t,tt.00. 0l,0t.tt. 00
.::';fi:;-T..:'::::::."i::rl!,
(RGPV Dltopal, Jurte 2004 by nrst consrucrine a sratc diagranr Fig. 7.31 gives
i'put i'ttccisitlrt
ffl1lil'i;,i;,i.-ij i:!;l;itr'a
Now lo fornr sM chart' for caclt statcs srate bo.xcs, our'ut i^ rrrc srarc rr..x. r)ur bo'r aticr caclt statc bo.x an.l conncct trrc statc'rrr by inspcctirg ti'k srarc. graprr 'c.rt tro't rbrst:rrc^ i,;i;,"n in rrig ?3;i;;'\rrccor'prcr..tsr,,,
;:tJil.
r-\(} \Ys
--r
I
--"1:{;.
I
L-
I. t.
t-
:'
L,
(
I I
D-;7
t
1
t1l+
,\, ;,
7.32 (a).
1o,/
t/o
il
,r5
6
,.q
'm
Solution.
.,1 wl1
tate
'I
.t
lr
I
Ir
a-
F19.7.29
S,.'
t7
tl
F19.7.30
input in decision box Ji"gra* The ASM chrrt is showu in Fig' 7'30'
NowtoformsMchart,forcachstatedrawstateboxsndput link by insPccting thc next state after each stttc box and connect the
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
o
so
.Sl
0l
So, I
51, o
l0
So,l
51, o
ll
.11, 0
sg, I
St,
nFig.7 .27.
00/0
0t/l
t0/l
00/t
F19.7.27
lt/t
0
l/0
tu0
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
(
I
t'
..
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
l( .tYfl -rd''.
_Ll
.i..
"
Input 8.
Go to 51.
if
l
I
S = 0 then go to S9.
.S1 : R,a
I I
I
If(Bonow: l) then
'
Rl
(2's conplement of
R,a
Go to
-.rut
Sg.
)t)
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
I
Draw the equivalent ASM chart, leaving the state boxes empy'.
Solutlon.
Table 7.1
Present state
i ._J
Inputs
Nert state
a
0
0 0
,I II
-l
I
I
L-l
l.
t.
I
.ry 00 0l l0 ll 00 0l l0 ll
Output
.t
0
0 0 0 I 0
I I
0
I
0 0
I
I I
[lxanrple 7.r2. Drart,art AStI rhrr,;:l:'f,!rr,,,, x,ittt 2.8 bit registc,rs perfonns the subtrrtctiort opentrio,tt 2ls1,,f 2 s c,otnpletttertt nethol,
R.1
artt! R6 ant!
2003)
Rl <- RtSolulion.
Ra
InitillSrarc
Rrr*
lnPutA
B
Rs--lnpu
fa*Ra
+ 2's complemenr of Ru
l
Ftg.7.2S
;,.ffi
\'
.tl'lll
a
- ,a !
Solution.
TE z( + ?
I
I
)
_Link 3
a^*? -"-\ qx
Ex
,l
* I
rl
&-? Qx
TrtrzV$.
ed,\H 1F
oo\
ax drTqX
-o\ o-l .-,
?Y=pqx
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
F19.7.22
paYt,I
PQX
P=
l,
so
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
0
I
l0
0
I
rl
3l
F19.7.23
0.
x x
e' =Fg+Fx
+QX
@-
E xarrple
to state grapht.
o\
'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'li-0i'state s2'z=0andthcnextstateisJgwhile If k = l, -0, thc next statc is J1 .
s,lrrtlo''
0, the nctrvork returns to,s9 0therwise, thc next state is.s3. putput Z is placcd in the statc box J3, therefo re Z thcnext','[iri itsetr. Fis.7,2ris i ;';3:rtb'otherwisc,
In
{r, ifx=
forx=l,z=0,thenextsrateis.s2.
Jff:'**;:rffijil;ft*:l'jl
I I
(.
r-7\
nplffi{'
the
t
t
A, PQ = 00; B, PQ = 0l ; C, pg 11. Derive the nexr sh? and ourpir equati, oy rracng link paths on the equatiotu oni.iirf),on the i sM chsrt. r.uo,io,u anc! thrn aron-ti;';;;'u-u"u,r rhe net*ork;;:o{;::'::^':!o::tu .on
logic gati.
sinptifi
-]-f,Vft t.
when' t' 'arl
'!
|
I
.".r,
7. t
8 to SM chart.
o/
ii i.a -t i--_i I
I
I I I
1
tl
Fig.7.18
Solution.
I I
I
I
ll
-J
..)
I I
t, rt
F19.7.19
'I
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.
Exanrple 7.8. obtain a s-late diagram for a Moore circuit which produces output'1, rrh, it detects rhe sequence l0l. ot,errapping scquences o* otioru"i.;i;;;;r;;,;r;';;;;:;: Solution.
ltl
0
Fig.7.16
!IT.JT{I COP
-,
(
I
(.
Fi,1.7.17
is placed in the state box since it is tdependent of input. Fig. 7.17 shows an SM chart for the state diagram
ff;li:':fil ;}1:1,:1:ll'*i"'^t"5*::?]:*''ne
ofFig. 7.16.
i] ,F[ii'i.
I
/@nn
r-l
llcnce
Insecondcase(Fig.7.l3(D))theoutputis l'= |
=t
or8:l,C-0'
-l'
Y = BC+AE+ABe
= 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
at the output tluring the last state of the sequence. ! --A@ffiCserrc a logical I Solutlon. Figure 7.14 gives thc cdrresponding state diagram for a given sequence detector. solur i I
i lotot !,,
,r..
Fisl
"-t
1,.,^.1. .'leaal , i
I
'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.
Ftg.7.14
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
I
tit
twtt
ore,
tLWlty,cWtg&
F:ft h -:',4hJ.
:
(a)
F19.7.13
= I andC- I Hencc
:i:i:,:,
:l
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.
the
lf
C=l
ifC= 0orA=0andcxitpath
,l rs taken.
4Sj!chart.
rr
s ,>\ ,/'
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
J:;:llTll"Ii3
f j13:T,q.l:::::r,rvir
be .r ,regardrcss
t''
:fif, ":.0
un rn, ,,!?:! tly,t.has.J input *r,::!^tS,(A, B, 2 cxir rxttrn..t'",, ti,r'ii"i*' C), 4 ourltuts (W, X, o:tr:r: z t, otrroy,r), y- t artdcxttl,o,i,'itr.tuken. t ,/rA ant* are botrt r. rf ynct
2 is takcti,
I /)It'l r.-r
t
rti
:
'l
I
.l
j
:
,ffi
l..._
rlif
.!
t.f
: l.
!'e
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.
..I I ii
rbi
|
Link Path
.{
;l il ',rl
..r
I
:
t
t I
I i I I
a
I I
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.
v()
ll
in
l'
illg
I I
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'
*'a Mil l,ut x'lnla c.tpres.siott
7. Rcslizc thc SM chart using gotcs and flip-flops. Errnrple 7,1, Obtalrt ln conditlon box.
Solutlon.
thc ASM
.rlc
l
ctnrtforlollowlngfitnctiott,
i,f
Z=A+B'C
.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-
Similarly, Fig. 7.5 (c) shorvs that Z= which is the same ourpur funcrion
| if AB t AC= l. Ilence, Z= A (B + C) = AB + )g
nrs t check,{ i f ,4 s ze r o z rrirn gnd jtiln b I,ff.,..,T# ili; l j l?l.T ?:,,.i: l j: _b_o1, iiJ''5 j,l'.',ii :' i i il'fi .oi Lo^^..^^ r :, t= 0 then outnltf witl h. '0' b..uur.-z{ is r and B C= o,:n:n our:ur *rllo. i, urro o.'#J,xr,trtlTf;;*TJ.|*.,,!irf'J
in
'
iil
Tj:i:lffi;::'fi J;: {!! :i }jr".,,j*:i;+:;Tj:?\T;,');:TtrlXil1iffiis l I,i ! !:,ld_n ycond tio n box Fi r check B, ir B i#H;"1.T:ili:Hi:*:':,i:AC: l, Zwill be l. zero because both temu arezero.lf ;.
i
l.
rs
last case, we may pur whofe boolean -.In AB + conditional output box. "*pr"riion
7.4.
exacrrv
*,,."l|X,ll:ilff::*ilu|1ji:'T;"'diagram
on..*it fitrr crcnned c;;il :'j:
rrair'
*r.,
Mealy ntacltirte' In casc of Mcaty nrachine, output is a frrrrctio'.f b,t' prcsc't statc Iror c.ttstructio' .fASv tr"n-ilnr Mcaly srarc diagr'n\ \r,c shourcilirilorv ltiii.
rtrc
ftil;,il;i'ffT,',ilTifilifialil;;ff' ;.
arrcJ
nrusr be ronowed
folowi'g
.
Rcprcscnt cach statcs by starc 2 Put input in dccision box a{lcr coch statc box. oulput in corrditional outpur boxcs sincc thcy depcnd 'ppc'r ,xf tH,y
l.
boxcs.
o' botl
r1c starc
5' Dcpending on varue of input connect the path to ncxt state box. fr{oore mochlne' ln case of Moore machine, output is a function of the present For conshuction ofAsrur state crrirt n*'rta*r. *r rr,orta rorr"*,r,. fortowing onry. 'v"vw
4' Meary circuit output writtcn o'ry wrrcn it is cquar to ,r , i e., truc.
l.
rodilil
'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 ft to rearize state diagrarn ut ihe It' tn, or*i r#rq*,ion for a fr1,-"rffif;:"ffj;" "n nip-nop e irgares and
boxes.
steps.
t I
7,5.
l'
*'l
"i.ri",
The first step is to make a suitabre state assignment for...h ro,r. 2 Search all the states for which e is one. 3' For each of these states, at of the rink paths that read inro the stare.
'nd
tl
I
I I
Branch 2
-1 ,l
f
I I
,l
tl
-'l
I
AIJ
tt'l
.l
Fls.7.a (b)
IJ
tl )
cj il
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.
7,9,
EQUIVALENT AsM
CHARTS
'
I'
'
',
I ;
| 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'
Zo A (8 + Q
_ _ -__ ,.,^e.rr,tc)
::]D,ffi'I;|r,Tj,;: j::*:j:n:n1b."_
wl$
dccisron box must foilbrv and L^ associated inrrcr fnllh.,, --r be *,ith a state box.
il;"'.;;';,Hffi:i:;rgnals. The
'i
is sh.orv' 'urptit bo-v. 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.
(iii) cottctitiottat
A.Fo,irli't"ffIl,ii!;il.
i'
,.
(ltlnrlit ional
()ulpui l.lsr
sratc box rvitrr onc or dccisiort boxcs and cortditionor Ci*.r associatcd ,"irhtthrt:;rl. an ntpiur".r. has onc crrrarcc ',orc path and one or ntorc cxit paths. nn nsrra chart consiri, oron. o, n.,or. iir',-.-r.o,*.ctcd Ilxccution ofsM block it blocks. t"q*"tii concurrcntprocess., ia."r, whercas.*e.r,ion orinrrru.tlon.fruirrrin sM brock is
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
t:
(l tl
I
Basic element for branching is decision box. After decision box we get two false' Depending upon exit path, true or condition-one can branch itself upwarcl or don*+,ard.
I
I
.t
//
r-\ / ''r
to VHD|
i -.-l
tl rj .-1 rt
'{
ATGORITHMIC STATE
nuchinc' or sirnply state nnchine is the another name netrvork is used to control a digital systetn rvhich carries l:rvcn to sequential netrvork. Sequential (AsN'l chart) or state nrachine frrr a stcp-by-step proceclure. Algorithnric srate nuchine charts rese nrblcs uscful in hardrvarc design of cligital systenl. ASM chart e lnrts (SM charts) arc flow charr, cotttain inplicit tirrring r convcntional llorv chart, but it is dill'crcnt liorn flowclurt. ASM cltrtt physical ltardwarc and oft'crs scvcral [rformation. It should bc notcct that ASM charts rcprcscnt ASM stands for
state
il n: I q --t ;l t |
r.,D
I
rl
I
J
_l
t
I
t I
I l
i
!
I
I
i
rrlvarttagcs.
.J
t I
I
by irrspcction of thc sM chltrt' opcration of a cligital systcnl con bc casily unclcrstitncl 2. ASM cltarts rcprcsctlt physicol lrardwarc groph, oncl it lcads dircctly to u ltardwlrc 3. 't'hc AsM charts urc cquivolcnt to u stutc
l.
i
I
A
I {
I
I
;: il;,;r*';;;
.ori.,
.5
I I
I I
' :#ilffi;
6. 'l'he AsM .t urt *uy a a.sqripti;" 6;r;;.in;*ion does, but not how it is donc' r,r the ,u*rt,rru, iiilescribes what a syitem point of thc hardware synthesis process' Any The ASM chart can be use{'as ttb slarting
in'more givenASM chartrnay be implcmented in hardware
sevcral equivalent fornr' to undcrstana ano cm bcconverted into output table' be equivalcntly cxpressed as a state nnd or.. aigtal svstem. It is an abstract description
luo:1* 'aat
ltt'
:l ../
rl I
7.2.
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;;i";;:wt,ttii,rtt
Stote Assignnrcnt
OutPut Llst
r,.i
or Rcgister OPcntion