Professional Documents
Culture Documents
CEG3155 2014 Final Solutions
CEG3155 2014 Final Solutions
2) E <- B+D;
fulE< / +l"y hq ?w^ concurtq
D <- A+C;
b) Without an output register, the output of a Mealy FSM can contain glitches. True
c) Are these two rcalizations equivalent?
Yn* ) I fi+e
d) Assume the initial value of the counter is "1000". This counter counts through 4
different states.
lpDO
O/'o o
poto ' Fol*u
/rool
irto0
\
e) Assume the initial value of the counter is "1000". This counter counts through 4
dif[erent states.
r*rag{0}
Tr,*e
Part B (5 marks):
Explain the difference between these two VHDL statements and show their conceptual
implementations (i.e. draw the circuits):
if (a:'r?#.::r, uA<:a&,b;
u) S
fl) case ab is W
elseif (b:'1') when
6610"1"1
1:: dout <- c;
-)
dout.- d; \ when "01" :) dout .- d;
else
dout <- e; end case
endif;
{ #s
{
1\r" Rrd i,rnpbn+e*Llim *bb rt dnl.**xta t, +"c+ ea,c.h tnprl. xpdely , uhib
tl''c Secora) ivnpleoenthoa cenehnaht l*.,e trwo ry*b onl. **4s tl e r+ulhng]
abt*!. B*+r,, imrlerne*fa*;ena iwple,neyr'l ]h, uo* lgic,W +h€ dift,*1
d&ren4, '
r-
gen*ralv/- *;l/ he
e
e
& A Jou*
)r,* CI
b
(
fl.6
Page 4 of 20
Exam
CEG3155 (Fall 20L4\ Final
Part C (5 marks):
the
it uses one adder' Show
tII combinational VHDL
KEWTIIS the
Rewrite :"d:.iil:i.::J"r:"?:Tat
designs'
conceptuar diagram
(i.e. draw the circuit) of both
f € ep* **VZ. J
&
b
&
C
f
*
I /
V
5d*-?,YY
CEG3155 (Fall 2014) Final Exam Page 5 of 20
Part D (5 marks):
An ASM diagram is shown in the below figure. How many registers are needed in the
datapath? Show the implementation of the datapath logic for register c.
{_
l:
t:
l
I'
l:
t:
qi)
l:
t:
I
ry**e
l:
l:
I:
l
*
t
t
t
4*oy
Frl, lrl
c Iu"
40
*hr
CEG3155 (Fall 201,4) Final Exam Page 6 af 20
The following figure shows a parallel-in parallel out right shift register, Part a is the block
diagram and part b is the implementation using flip flops and multiplexers
Parallel Output
,rfrffii.H#tffil
03 Q2 Q1 Qs
O(Serial Outl
$l{$erial ln}
$h(Sflift Enable)
L{Load Enable}
Clock
SI
sh
L
CLK
ibi lmplementation using flip4ops and MUXes
Show how to make the shift register reverse the order of its bits: i.e. Qs* : Qo,
Qz*: Qr, Qr*: Qz, Qo*: Qs
1. Use external connections between the Q output and D inputs, what should the
values of sh and L be for a reversal?
2. Change the internal circuitry to allow bit reversal, so that the D inputs may be
used for other purposes. Replace Sh and L with A and B and the register operate
accorclng the rollowm
dins to tne followine tabl A'
\,2 .
01 SI Q, Qz Qr Right shift
10 Dl Dz Dr Do Load
11 Qo Qr Qz Q: Reverse bits
tr
5h,t;
,IK t1'
ar, ;+ *rl#art,irl-;.: l.sj3,$^
V
rlt6
B.
fi.o ** D3 r#nnnn"hJ
6h thd,&ld &r #qnd I +o $
qr {w*urkl{a De
, e uo*rng rh; *a D; # *ha{H &e wu*l +" I
d.e t6nrl r-J'd-ia Ib
&
t
C}K
CEG3155 (Fall 2014) Final Exam Page 8 of 20
Derive a 3-bit counter using D flip flops. The counting sequence is: 0, 4,2,6,1,5,3,7,0,
4,2, andso on. There is anlnput signal w, if w: 0, the counter stays in the same state
and if w: 1 the counter will go to the next state.
Wr*fi
i)
V*l
ii)
e# to/
C rt-)
IJ o c o {} Qa
6{e \-e*- #-F II \a
0 ,frtrrn d
o 0 o I I t' {e"'
E).',
,
o I o c O F! 0
o
e>
a I
I I o
o II rn o o {
o a o O I
l c !s .t)
i,*'+**-'l
a a \r_
0 I I
at = {u;tGew\
o
o o I I
= 4.* S trl
c I
c.oo hl
I I t
0 I I
ee 4r Q0 frt $l Id
o 0 o o o o o
I
( {1 o
o o
1
I a
c#
6l
"ff ,#;A
t
ffi
* I t
\
0 r! ,!J o 0
I
CI I 0 I
I
l* o
-g*
o I
I
I c I
I
0
"*11 k
;-.
t"It
#&
u,
..F-
r}lm,* *4ruF+a*a)t*r
D o I 4
Aa\"/
c
I !
U e*
o I ^ I
4r
I
ffi
t I o il {
I I
cl
l io i o o l,p
l"i
I
t0
r=Es-F..-''"i-**
d= o-Lq, A: v l. e L *+ G-)dn t e, v)
CEG3155 (Falt 2014) Final Exam Page lL of 20
()*
DA
w
/
Page 15 of 20
Exam
CEG3155 (Fatl 20L4) Final
ilft';?ffi il;"'li**X,
8],ff;;+ifitiming't#*;;;""; t;i'ffi! data-in', 0,, o,,
o {101010f
i
(d) Showthe ".o,"n..
e)
Page 16 of 20
CEG3155 (Falt 20L4) Final Exam
libctg t EfHi
we- r eEH-l,r#*[a4ic-! l*'L.-d$; U&*T*Fff ' #.,wmnic)
0 ev\hl! trbt| \u
7er*{
in i'..\: fr*rt
rr1<s *+{*l$ic; # i{{# **lot'*.s*J
in i j'r h+A*[oEi k".] ,fi;; $,"1:
='t'J
nexl*$t*e# bi
, &t*l s e*+ eld-hff*} i
enC Wf\) **oihhe,Bi
*rcVtrhclwre rhfiL *P F9t4 i*
el,HH****63thc4
Signdl. €a*|*tde I inlg e{', i, I rn =*rr] *Fwn
*ignrl nexb{o+,g;infuu{: nex*|hk €ti
btii- ebe
yter|rhk & 6i
{wp
b*srn
Ler K)
€lrr% rfi,* * +,k= d)'l'h p,r
if Ltlklevcnk oo* dK=*rr] lbvr a.r[- 4=t i i
.tnfuh+
end ,B
,wvlbhi'e, if {l,n =\l} *1*n
qd W*byr, . mq,h* *"fu #"17
el*r
VftP-tt tclK) L
-"-r#chk#ff:
grldr*i
ffiie.d, :*t*e'rlt .
*l be
1
if{e*6o1la'in
i+{in="/){t*n
hflSStok er*i
YnI!#
nexl *+nfuali) ftd pME#j
elx,
+dlaheoS
n&) eri r_+fiyl,;
-d'#i
el**
fii€,m dlatr x I t+,on
T+ [;*
='rt l-rien
,nexl_4lnlr
ef&e,
#l;
Y**
#**s'kb##
,Vtf L{**fuW #Z,}*?,ew
;$ Lin = {,i)++en
\""\
"*v*$[aye &VS
el+s
pxl+h
?qx+hhle <=+ *{
/'J-
eni #: )
etw
nft"m,*&fu =z) tv',e,n
tf I in *\tl)
* \ tl] thBn
t'hen
.
nsl+$+d+f
elro
el,
r;x,+
Bod.H
b++*e# fi
t* to to
&)
Y
,h+e
{
CEG3155 (Fall 2014) Final Exam Page 19 of 2A
A reduced-xor function works by applying xor operations over all bits of an input signal.
For example, let a7a6a5a4a3a2ala0 be an 8-bit signal. The reduced-xor of this signal is
(a) Show conceptual design of reduced xor using 2 input xor gates so that the
propagation delay of the circuit (critical path) is equal to propagation delay
through 3 xor gates.
(b) Convert the reduced-xor circuit into a three-stage pipelined circuit. Show
conceptual design.
(c) Derive VHDL code for implementation in b).
(d) If the propagation delay through xor gate is 0.5 ns and Tcq:0.8 ns and Tsetup:O.2
ns compute the maximum clock frequency of the pipelined circuit. How long will
it take to compute 16 subsequent reduced xor operations on circuit implemented
in (a) and how long on the circuit implemented in (b).
u} f;*
ffieP-
#*# b-$
A'
4+
rh}} &4
fu*F tigz
*l
A*
B'\
,trj 4) f Xfi*t 6lr6n6 f#r';*]d
f*x :
'rf''$'
!
.;,}*'g.ffi*
*f -ryt{ry:1,4F*ff*,1&
b) J*I*u; x {*. s+ #LsE,$ d},, #-
W Ia,r' Pfuu
r ffi )
Rr#,r
7 s6 ,d7
-. -a4.f,fr\ ;1arrh
t"&o*
S" u'r* -i &h, *s,*.ii:,u
d 'WffihJ*ir,*t ;
tb4,dll
un+itU tuLxor \q
'pr*
{fl[',[
y , a,+
iB]Hr u**rrr t, a*ou oY
r[il*bf*);
enrd ted*yss3
arehi'ieelu t? frF*rar ia
tSb;U'rtrt l ++LWic *vabr A h"rrh CI)i
siswl g r1p*i *$ fiie-wtW tl )awr L 0h
"*fii;t$$6*
bUn*I ." #ryfu-;
tEln
ffw**tdl()
@i"(.tlk)EvorFF , clk=\t')
..
if ood I",an
t &bnsr+i
t* #
q{vv+i
tl #d-vw.,d
e;[{#.6)
h'novbt6) G NLr) xo{ e(6};
bro*{t} # &t*: )#r 6, (*\
br**k) *a" {3} xo{*te},
[**de] 6 d" tt] >' e{ atl}i
c*ex+(.") + b[o) x@r &CUi
trpxl-{,fi
6Hp} }@{- fu{u}i
}"**r* d t{*} k*r tt;:tf;
dn& p?etG? V