Professional Documents
Culture Documents
VigNig HDL 1.1
VigNig HDL 1.1
HALF ADDER
Darta loo
module halfaddex(
input a,
input
output S
Output
assignS=a'b
assign
endmo.dule
O0 b20
#5 a o b b ;
#5 a /6 0
a bel
end
endmodule
Teacher'sSignalure:
StYuctur al Pepresenlation'
T7uthTable
Sum (s) lcaYry Cc)
O O
O
Date
Page No..--
Expt. No.
Gate leve
module halfoadder(
inpu a, b-
output Sum,CoX¥}F
BehavioYal
o dule halfaddex
inpu a,b,
outpu KegsT
always Q(a,b)
gin
Su a^bj
d
Aendmodule
Teacher's Signature
Date
FULL ADDE R
Data flow
module ulladderC
input a,b, C,
outpuf S,aY
assignS:o^b^c
assign_car:
cax-aslb&clccia)
assig
endmodule
hodule ulladdextb)
wixeS, CaY
K e g o , b,j
lladdex xilss),cax (cax),aa),. lL{b),.cle));
begin
t5 O20, b20j C20j-
#5
+5 a - 0 o e l , c 1
95
E5 a2l b 0 ( O ;
#5 a l bzO C21L
5 a b ,cel,-
end
endmodule
Teacher's Signature:
Structuwal Kepresetation
Co
ruth Table
Sun (s) cavryar)
O O O
O O
O O
6
Date-.
Gatea
mo.dule fulladder
input a, b,c-
outpufS, CaY
Behaviosal
m.odule tulladdex(
input oa,b,L-
output Yeq SYeq CaY
D,
aluwoys (@la,b, c)
oegin
S 2a^b^cj-
CaY Casb)l (KLc)lcca)i
end
Pndmodul
Teacher's Signature:
Date.
Dato law
module_mux
i n p u t a , b , c d so, SL-
Oufpu
asign alosa)&lsi)&a)lso)&sIEL)I(Soslosix)
SoL SId)
endmodule
modu le mux-thQ
e ,b,C,dS0,S1
mux Xiyg)yalalyl).cledld),.
iniialL
solGo)y.si(G))
begin-
5 So-0; SlD, aal, b-0 C20j d:0,-
SO-0S2laco , blceo, d-0,
5So-1,S20, a-oj b-o, C2l d:0-
#ESSo:|; S1E a 0, ozo , c-0 dzlj-
end
endmadule
Teacher's Signature:-
Stuctual Represeation
Olo
Iruth Tale
S S
O
Date
GaatelevelA
modue mux(
input a,b,c,d, so, sl,-
Output
and us ( 5 ,So,w2,
and ob so, SL,d)
uilyaao4,oSb);
endmsdule -
Behavioralz
madule mux
input o,b,c, d, So, s -
outputeg y-
alaays (sos1,a, b,c,d)
oegin
so)als)ka){sksuyl(so.& lsde ) (sodsikd
endmodule
Teacher's Signature:
Date-
Page No...
Expt. No....O4..-..
x4 DEMUX
DataPlouw
module d e m
Output a, b,c, d
inputSo,ly
assign a : (sso)4(s)e
ossign
assign CSo&si)&y-
assien d-so&SI&Y
endmadule
mo dlule_ dem-tbO
oire a,b, cjdj-
Ke- So, Si, Hi
den Kilsalso),.sils,-y)ala) blslcle), d(4);
begin
HS So 20 SI2oi9U-
5 So-o, Sl2l,y
t5 Sozl SI2d
5 So SA yy
end module
Teacher's Signature
Stvuctuval Represeatartion :
S
A
T t hTable' output
S D
O O
O O
Date -- --
Page No.
Expt. No..
Gateleval
module dem
output a,b,c,d
put So,Sl,y-
not u i l S o )
not uz(w2,s1)j
and us(a, wi,wiy-
and uy(b ol, sLy+
ond us(c, so,2, i
a n d u ld, sa, sLy;-
end mo.dule.
Behavioxal
madule dem
outpt
input So, sl,Y
aloays So,s1,
begin
a so) si)Ly
olwso)s1
C Sos &
d $o&sIy-
end
ndmodul
Teacher's Signature:
Date
3:8 ecodey
Datoflo
adule decodex(
input a, , -
output 1:0Jy
D
assignLo]-(a)zlsb)Llsc);_
assign4L:
lasSion (a)b 2c)_
ass LJ: (a) & bkc
assign - ( a ) k(sb) A(oe),_
assig S)= a2 (wb)kC_
assign o2b&(e)_
assionL
endmodule
mbdue decadex-t )
e:0Jy
KagOb,c
dezodex xi(ala Ll,cc)yy
initol
begin
5 0 6-0C20
5
Cnd
endmndule
Teacher's SignaBure:
Structuval Pepresetation
D-
Date--- --.
Page No.
Expt. No.
edelevel
mod u l e d e c o d e x C
input a,b,c
output 0)y
n o uilo,a)}
not ulw2, )
o t ua(ws, c);
land uHylo1, wlwl, w3 )
and u5 (yi1,wl,w2, C)
and
and un (y lbloi b )
ad ug ( y [ u , a , w , wi)i
and u
and ofy6a
CuAd u yiy a b c);
end ma.dule
Teacher's Signature:
TuTable
s
O O
O O O
o1 O O
o
Oo o/01
Date --
Page No..---
Expt. No.-.
Behauioxal
madule deodey
input Yega,ieg bXeg
Out put oly
alnas@la,b,c)
ylol:lna)Alb)&(vc _
ca)& bL(d-
u) a (b)&e)-
S = aL (wb) &C
AL ak b& (wO
a& bi
end
Teacher's Signature:
Structual dogra
aeb
b
a grb
-a s l
Yuth T alble
Page No..
Expt. No. ----.
-bit CqaoYCtoX
Datatloo
mo dule_comp
pu a, b,
output acqb,agrb,oalsh
assignag1b -aL(v b)
assign alsh ( v a ) & b
endmadule
mo dule Com p- t
wire aeq bogrb,alsbj-
g a,i
CB X (cata) boeqbloea) agrblorb),alshlals
initialL
beg
+S bel
t2 b -
end
Cnd modle
Teacher's Signature:
TuttTable
b
aea,ba grb a s
Ao d bo
O 6
Date
alsb b a,db b a
Dataflo
nodule Comp 2
input oa1,b0, bl-
output oRqb, ogrh,alsh
D_
|assiqn aqrh (a,ils )lla,a(h.)Lha &asob)_
assig alk L (voalkllloa,)Alaab)l(bd biALad);
lassign
(aoá.aboAhl(aslwa)a bailbi
endmo du le
nodule comp2-t64
oire ogxb
eaba, b
spxlaslay.oa.) bolha,(h),.agdlogb).altlali)
a8q.lae hl)_
nitial
|oegin
E5 a, 20 bo20 alco b2o
tS alel
ead
md mod.le
Teacher's Signature
Date --
Expt. No... Page No.
N-bit ConsporaoY
Behauioal
mndule Ncomp
nput n-I an-Lb,
utputxeq-atqb agy ¥egalsh
waya a,l
begin
elsb (ac L)L
enc
endmodu le
modle Ncomp-thO,
aie oeq0gx,alsb, -
Cn-oa, hj-
parame tey nL6-
Alcamp XILala).bl),aeaslecq b)..aglabalsblalsb
initial
be-gir
ESa6'dinb Gd
S a 6'd1 b 6d 1,
endmodule
Teacher's Signature :
Sclomartic Diaqsanm
bo
FA FA
FA Cin
C3 A3 C
So
Page No.
Expt. No.
Kippleary Addex
Dataflouw
modulexippleadder
(arolAblol)lCbro]Lcio)lcin&al)
Teacher's Signature:.
Date
Gotelevel
mDdule sippleadder
input 3'ola,[3olb, cin
out put [3:0S cout
wire Co, CL,C2
ulladderfololol, blol, cinslol, co)j
fulladdexfIla[l1LL1 co, S , coj
Luladder a l bJdslJ, ce)-
fulloddeY £slala, bE],c2slal,cotj
endmodule
module fuladdes
Inpu O,b,
Owtput S, cout
wire s l, S2S2
xo lSa,b, )
ond u2(sL,0,b)i-
and u3 ( bc)
and uu(s2,a)
DX uSlcout sL,S2,S2)j
edmodule
module ppleaddes-t
iy 3:oJS
wfe COut
xeg 3oJal
Teacher's Signature