You are on page 1of 14

CEG3155 @all2014) Final Exam Page 2 of 20

Question 1 (20 marks)


Part A (5 marks):

Short questions. Answer true/false:

a) These two VHDL concurrent statements provide different results:


1) D <- A+C;
E <- B+D;

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?

(],ilnr + ffi,t})+ V. 1tu


i - ... i b-
YF\

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

Answer Key T/F


a) Y
b) 1 /
c) T
d)
e)
rf
CEG3155 (Fall 20L4) Final Exam Page 3 of 20

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;

$u I aoO d. x *,.. &; o


tr:' x

{ #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

with sel exP select


r a- a+b when "00" '
a*c when "01",
tr) \^,i+h ful*W Mfu,*
;'' n -l-*"odr
. t\- ,/
d+l when others; & t-h*n\o 1",
& h/hen #|h#'ei
\'#lt ,*I'* *x? &*Is#
ef? e bt uh€,Y\Yq11
%V4
u\",hgfl
I *rhan ott$tb3

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

A++errn# b+*+{ i.vfi.!] d*#;hd&


l" J"h cr
idl* x*
Aelag *f
&te re$iale{ i* Ylc€}r} +*
hol d +l-s valu* #t {.

Frl, lrl

c Iu"

40
*hr
CEG3155 (Fall 201,4) Final Exam Page 6 af 20

Question 2 (20 marks)


Part A (10 marks)

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

{a) Blosk diagram


DsD2qD6
Parallel lntput

SI

sh
L
CLK
ibi lmplementation using flip4ops and MUXes

lnputs Next State Action


Sh (Shift) Ld (Load) Gls* Qz* Qr* Qo*
0 0 Qg Qz Qr Qo no change
0 1 Dg Dz Dr Do load
1 x SI Qs Qz Qr right shift

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 .

Inputs Next states Action


AB Qr* Qr* Q,* Qo*
00 Q: Qz Qr Qo No

01 SI Q, Qz Qr Right shift

10 Dl Dz Dr Do Load

11 Qo Qr Qz Q: Reverse bits
tr

CEG3155 (Fall 2A1,4) Final Exam Page 7 of 20

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

Question 2 Part B (10 marks)

Write VHDL code for an 8-bit left-to-right shift register.

liku€5 IEEEi &*#u.*# ShS+ in q,**+ f* 6{rffi


rrfe teE. *+i-lag}n,*lld*,dI|
i
snfib !r*hi{L*e;+ !*
e'e+ (
ii: in *+J*l-g itl
io : eil+ t+r.*l-*;i:
LlY.i ir"r *+d*
fu;;ti
ent lryh;fu#ei+;
orehi*. Avry lrst;{L-gu 0F- I rttr#l *0 b* i*
1;fiMl r I *+d*|ryfu *v(i.lo {Ulo* n lo dJ
i
b;n
r(7)
r(6do*nh 0) {,F tb}pnnn+r D;
*o # f,la]j
enl lrrh,\c+.#& b*\
CEG3155 (Fall 20L4) Final Exam Page 10 of 20

Question 3 (20 marks):

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.

(i) Show the state diagram of the counter


(i1 St o* the state table of the counter for the next states and for the output
(iii;mit the simplified (use k-map) logic expression for the D inputs
(iv) Draw the circuit diagram

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

Question 48 (20 marks)


,
J/,1
pattern il the communication
receiver'
to detectlh" "iOitiiO"
We wish to design an FSM ig"al' match' The match signal
The circuit has an input signal' *u..-in'
*;; of
i"p"t puttt* " 101010" is detected'
will be asserted 'I?* il, tto"t p"'ioJ *"" tL
",

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

Question 58 (20 marks)

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

y: a7 xor a6 xor a5 xor a4 xor a3 xor a2 xor al xor a0


Since this function retums 'f
if there are odd number of l's in its input, it can be used to
determine the odd parity of the input signal.

(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

#*u .# i*ry*t44 tt*x t,6J *w


Page 20 of 20
CWGiIfSS(FalI 2014) Final Exam

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

You might also like