vhdl introductory lab

Upload: azonegrpz

Post on 16-Feb-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 VHDL Introductory lab

    1/37

    ECE238L FALL 2015

    LAB 0DESIGN AND SIMULATE GATES

    Fundamentals ! D"#"tal and Cm$ute% Des"#n &"t' ()DLE*$e%"ment 0A + 0B

    Anees A,%l -aa,%l.unm/m

    E%" )ame -e'ame.unm/m

    Steen Se$$ala -sse$$ala.unm/edu

    Am"% 4ae"s" Na!'" -am"%%n.unm/edu

    B'u&an Ba,u Bastla -,'u&an,a,u.unm/edu

    mailto:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]
  • 7/23/2019 VHDL Introductory lab

    2/37

    LEA4NING B6ECTI(ES

    Im$lement l#" #ates/ Im$lement l#" des"#n7s ,ased n

    DeM%#an7s La&/ S"mulate u% des"#n t e%"! "t &%s Int%dut"n t ISE9 Ade$t9 and ,as"

    ()DL

  • 7/23/2019 VHDL Introductory lab

    3/37

    ()DL CDE INT4

    ()DL des"#ns 'ae t'%ee $a%ts: l",%a%9 ent"tdela%at"n9 a%'"tetu%e dela%at"n/

    Ent"t and A%'"tetu%e a%e t'e te*tual des%"$t"ns! t'e "%u"t

    S"#nal ass"#nment sm,l ;< End de &"t' = Ident">e%s: S"#nal names -I? $%ts and la,els

    -ent"t and a%'"tetu%e names/

    Notase sens"t"e/ N nent"n !% s$aes and"ndentat"n/ La,el used "n ent"t dela%at"n must ,e used "n

    a%'"tetu%e/ @%eedene: NT9 AND9 4

  • 7/23/2019 VHDL Introductory lab

    4/37

    SA(ING U4 LAB 4

    u all s'uld 'ae an ECE l#"n and $ass&%d!% t'"s lass/ I! nt see F%an Me%e%/ )e &"ll setu u$/

    Get an aess a%d !% a!te% 'u%s aess t ECE/

    Create a working directory on yourcomputer or a Flashdrive (Flashdrive isbetter)

    Temp/Your_Name/C!"#$/$ab%

    N s$aes Al$'anume%" &"t' unde%s%e nl

    These two steps are very important& You must know

    where you are saving your work on your computer'

  • 7/23/2019 VHDL Introductory lab

    5/37

    STA4T A NE @46ECT

    Ente%AND3

    Ente%&%"n# d"%et%n u%m$ute% %Flas'd%"e-Flas'd%"e "s

    ,ette%

    'en dne ente%"n# datCl" n Ne*t

  • 7/23/2019 VHDL Introductory lab

    6/37

    SELECT BA4D AND LANGUAGET@E

    $Y* CheckThese- *partan +- ,C+*$,-+- C*."!- 012$

    De,u##"n# T"$:

    T'e >elds ma%ed "nell& a%e ntal&as $$ulated

    &"t' data s$e"> tt'e ,a%ds "n t'ela,/

    I! t'ese a%e nt%%et u &"ll 'ae

    e%%%s &'en uattem$t t #ene%ate

    'en dne 'e"n# dataCl" n Ne*t

  • 7/23/2019 VHDL Introductory lab

    7/37

    CM@LETE T)E @46ECT SETU@

    and_3

    orking

    directory on yourcomputer orFlashdrive(Flashdrive isbetter)

    3ro4ect Name yountered

    'en dne 'e"n# dataCl" n F"n"s'

    I! t'"n#s d nt l %"#'tCl" n ;Ba and %eente% data

    Check that theseare setupcorrectly

  • 7/23/2019 VHDL Introductory lab

    8/37

    ADD NE SU4CE

    1/ 4"#'tl" "nt'e Des"#n @anel

    -U$$e% le!t 'ands"de ! s%een/

    2/ C'se Ne&Su%e !%m$$u$ menu

    3/ Selet()DL mdule

    H/ Ente%AND3

    5/ C'e $at'"s %%et/

    'en dne ente%"n# data

    Cl" n Ne*t

  • 7/23/2019 VHDL Introductory lab

    9/37

    ENTE4 SU4CE INF4MATIN

    / Ente% t'e ent"t name

    2/ Ente% t'ea%'"tetu%e name

    3/ Ente% t'e "n$utnamesH/ Ente% t'e ut$utname

    5/ U$date D"%et"nt ut !% ut$ut

    'en dne ente%"n# data Cl" nNe*t

  • 7/23/2019 VHDL Introductory lab

    10/37

    ADD ()DL CDE F4 3BIT ANDGATE

    De,u##"n# t"$:

    T'e ass"#nmentJ()DL deals &"t' dataK&s s u need t,e a&a%e t'at

    F;%st statementsas me alues "n A"nt F9 &'e%e t'esend statementmes alues !%m F

    "nt A

    Ente% t'e l#" !unt"n ,et&een t'e

    ,e#"nand endBleanFunt"nstatements

  • 7/23/2019 VHDL Introductory lab

    11/37

    SNT)ESIE T C)EC CDE

    Le!t l" n t'esm,l ne*t tSnt'es"e

    t %un a snta* 'e

    I! t'e snta* "s %%et u &"ll #et t'e !ll&"n#messa#e "n t'e ,ttm nsle $anel9

    I! smet'"n# !a"led t'e 'e9 a messa#e "nd"at"n# t'e l"ne num,e% anda '"ntJ as t &'at !a"led/

    De,u##"n# T"$: Al&as >* t'e >%st "tem n t'e l"st >%st/ Sme ! t'et'e% messa#es ma 'ae ,een a %esult ! t'e >%st l"nes e%%%9

  • 7/23/2019 VHDL Introductory lab

    12/37

    C4EATE TEST BENC)

    1/ 4"#'tl" "nt'e Des"#n @anel

    -U$$e% le!t 'ands"de ! s%een/

    2/ C'se Ne&Su%e !%m$$u$ menu

    3/ Selet()DL TestBen'

    H/ Ente%AND3TB

    De,u##"n# T"$: D nt name t'e test ,en' >le e*atl t'e same name

    as t'e mdule/ u &"ll e% &%"te t'e mdule and 'ae t %eente% "t/

    'en dneente%"n# dataCl" n Ne*t

  • 7/23/2019 VHDL Introductory lab

    13/37

    ASSCIATE SU4CE F4 TESTBENC)

    1/ Selet t'emdule t'att'e test ,en'"s !%/

    'en dne selet"n# t'e >le Cl"n Ne*t

  • 7/23/2019 VHDL Introductory lab

    14/37

    TEST BENC) SUMMA4

    Test Ben' Name u Ente%ed

    C'e t'at t'ese a%e setu$

    %%etl

    ()DL Des"#n ,e"n# tested

    %"n# d"%et% n u%m$ute% % Flas'd%"e-Flas'd%"e "s ,ette%

    'en dne'e"n# dataCl" n F"n"s'

  • 7/23/2019 VHDL Introductory lab

    15/37

    CMBINAT4IAL LGIC )AS NCLCS

    1/ Cmment ut t'e l $e%"d l"ne -l"ne 58 "nt'e Test Ben' F"le us"n# du,le das' as s'&n,el&

    2/ )"#'l"#'t l"nes 1 t and %"#'t l"

    3/ C'seCmment!%m $$u$menu

    H/ C'seL"nes !%m$$u$menu

  • 7/23/2019 VHDL Introductory lab

    16/37

    C4EATE T)E STIMULUS

    T'e test ,en' >le "s an autmatedtest ! u% des"#n/ T'e s!t&a%e&"ll s"mulate &'at 'a$$ens &'enea' l"ne "n t'e t%ut' ta,le "sa$$l"ed t t'e "n$uts/ S u need

    t 'ae &%ed ut t'e t%ut' ta,le"n adane/

    4e$lae t'e te*t"nd"ated a,e&"t' t'e !ll&"n#%e$%esentat"n !t'e t%ut' ta,le/

    Nte t'e &a"t t"mes at t'e end ! ea' l"ne9

    t'"s "s '& ln# t'e st"mulus "s at"e n t'e"n$ut $"ns ! t'e F@GA '"$/

  • 7/23/2019 VHDL Introductory lab

    17/37

    4UN SIMULATIN1/ Selet t'e s"mulat"n mde%ad" ,uttn "n t'e u$$e% le!t 'and$anel

    2/ Selet test ,en' >le t ,eused , t'e s"mulat"n/

    3/ E*$and t'e ISMS"mulat"n d%$d&nmenu

    H/ Selet s"mulate

    ,e'a"%al mdel

  • 7/23/2019 VHDL Introductory lab

    18/37

    (IEING SIMULATIN 4ESULTSe t'e "n t e*$and t'e "e& s t'at u an see t'e &ae !%ms/

  • 7/23/2019 VHDL Introductory lab

    19/37

    A(EF4M AFTE4 EO@ANDING (IE

    @lease Clse S"mulat"n "nd&

    Test sePueneA l& -0=B '"#' -1=C l& -0=Funt"n ut$ut -F "s L&

    "s "s ne &a ! 'e"n# &'et'e% t'e des"#n &%s % nt/

    ,u##"n# T"$: T'"s "s a #d tl !% s$tt"n# t"m"n# e%%%s/

  • 7/23/2019 VHDL Introductory lab

    20/37

    (IE SC)EMATIC F BLAC BOJ1/ Selet t'e "m$lementat"n mde%ad" ,uttn "n t'e u$$e% le!t 'and$anel

    2/ E*$and Snt'es"e d%$ d&nmenu

    3/ Selet sta%t &"t' a s'emat""e&/

    H/ Cl" t

    nt"nue

  • 7/23/2019 VHDL Introductory lab

    21/37

    AND3 BLAC BO

    Du,le l" n t'e ,la ,* d%a&"n# t see t'e ne*t lae% -L U$ Ta,le d%

    2/ Du,le l" nt'e lut d%a&"n# tsee t'e des"#nsumma% &"nd&s

  • 7/23/2019 VHDL Introductory lab

    22/37

    AND3 DIALG INDS

    "nd& $ens s'&"n# 'a%d&a%es'emat" -T& And Gates 6"ned tC%eate 3"n$ut And

    elet"n# t'e ePuat"n ta, #"es t'e t%ut'nt"n % ePuat"n

    T'e t%ut' ta,le ta, s'uld #"e t'et%ut' ta,le !% t'e !unt"n

    T'e a%nau#' ma$ "s s'&n ,el&

    False %L&

    T%ue %)"#'

  • 7/23/2019 VHDL Introductory lab

    23/37

    ASSIGN @ACAGE @INS T @4TS

    Ea' ()DL s"#nal name-A9 B9 C9 F % NET must,e ass"#ned t a F@GA,a%d $"n nnet"n

    -lat"n % LC/ In$ut s"#nals a%e ass"#ned

    t s&"t'es and ,uttns ut$ut s"#nals a%e

    ass"#ned t LEDs % t'ese#ment d"s$la

    NEOS 3 Data S'eet:

    &&&/d"#"lent"n/m?Data?@%duts?NEOS3?Ne*s

    3%m/$d!

    http://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdfhttp://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdfhttp://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdfhttp://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdfhttp://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdfhttp://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdf
  • 7/23/2019 VHDL Introductory lab

    24/37

    ADD CNST4AINTS FILE -UCF

    1/ 4"#'tl" "nt'e Des"#n @anel

    -U$$e% le!t 'ands"de ! s%een/

    2/ C'se Ne&Su%e !%m$$u$ menu

    3/ SeletIm$lementat"nCnst%a"nts F"le

    H/ Ente%AND3

    'en dne'e"n# dataCl" n Ne*t

  • 7/23/2019 VHDL Introductory lab

    25/37

    ACCE@T SUMMA4

    F"le Name uEnte%ed

    C'e t'at t'"s "s

    t'e %%et >le t$e

    %"n# d"%et% nu% m$ute% %Flas'd%"e-Flas'd%"e "s ,ette%

    @%Qet Name

    'en dne'e"n# dataCl" n F"n"s'

  • 7/23/2019 VHDL Introductory lab

    26/37

    EDIT UCF

    1/ Du,lel" AND3/u!

    2/ Ass"#n as !ll&s: In$ut A t S2 -(R9 "n$ut B t S1 -TR9 "n$ut C t S0 -T109 ut$ut t t'e LED des"#nated

    -U1

    De,u##"n# T"$: Smet"mes t'e ,a%d e*$ets t'e a,e "n a d"e%ent!%mat/ I! u% >les and s"mulat"ns 'e ut ,ut t'e ,a%d des nt%es$nd t s&"t' sett"n#s9 u &"ll need t t% t'e alte%nate !%mat#"en n t'e !ll&"n# sl"de/

  • 7/23/2019 VHDL Introductory lab

    27/37

    NN ISSUE

    In$ut A S2NET Vs&;2V LC < V(RV W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL32NGCL289

    S' name < S2NET AV LC < V(RV W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL32NGCL289

    S' name < S2

    %NET AV LC < V(RV = W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL32NGCL289S' name < S2

    "n$ut B S19NET Vs&;1V LC < VTRV W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL32@GCL2R9

    S' name < S1NET BV LC < VTRV W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL32@GCL2R9

    S' name < S1

    %NET BV LC < VTRV = W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL32@GCL2R9S' name < S1

    "n$ut C S09NET s&;0V LC < VT10V W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL2RNGCL29

    S' name < S0NET CV LC < VT10V W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL2RNGCL29

    S' name < S0

    %NET CV LC < VT10V = W ISTANDA4D < VL(CMS33V= Ban < 29 @"n name < IL2RNGCL29

    @lease use t'e >le NEOSS3 MASTE4 FILE as a tem$late/

    Nte9 t'e Ne*s 3 ,a%d &"ll $" e"t'e% !%m/T% ne and "! "t desn7t &% t% t'e t'e%/

  • 7/23/2019 VHDL Introductory lab

    28/37

    GENE4ATE @4G4AMMING FILE

    1/ $en AND3/'d

    2/ Du,lel" Gene%ate@%#%amm"n# F"le

    T'e "nte%!ae &"ll T%anslate ()DL t netl"st Ma$ des"#n and

    $t"m"e #ates @lae and 4utes #ate

    ass"#nments t F@GA,a%d

    C%eates /,"tJ >le

    NTE: I!9 du%"n# t'e #ene%ate$%ess9 ISE Ka#s e%%%s "nu% de9 u must %%et

    t'em ,e!%e t'e /,"t >le "s%eated/ISE ma als Ka# &a%n"n#s/nl sme &a%n"n#s must,e %%eted/ F% t'"s u%seu an usuall "#n%e

    &a%n"n#s/ As u% TA !%

  • 7/23/2019 VHDL Introductory lab

    29/37

    U@LAD /BIT FILE

    3/ $en D"#"lent Ade$t/

    2/ Tu%n ,a%d n/

    1/ Cnnet F@GA ,a%dt m$ute% &"t' USBa,le/

    H/ B%&se t u% &%!lde%/

    De,u##"n# T"$: I! u 'ae made'an#es t u% de and "t des nta$$ea% t 'ae an aet n t'e '&t'e $%#%am &%s n t'e ,a%d9 uma nt ,e u$lad"n# u% >le/Al&as du,le 'e t'e d"%et%and t'e dateXt"me la,el !% t'e >le/

  • 7/23/2019 VHDL Introductory lab

    30/37

    U@LAD /BIT -CNT/

    1/ Selet t'e >le -AND3/,"t !% u$lad"n# , du,lel""n# n

    2/ Cl" @%#%am t sta%t u$lad"n# t'e $%#%am

    T'e /,"t >le "s$%#%ammed tt'e F@GA ,a%d/

  • 7/23/2019 VHDL Introductory lab

    31/37

    LAB 0 @46ECT A NT9 AND9 4

    1/ C%eate a ne& $%Qet/ Name "t La,0A/

    %"te t'e ()DL t'at $e%!%ms t'e NT9 AND9 4 $e%at"ns n t&"n$ut alues/

    In$ut s"#nals: A and B ut$ut s"#nal: FNT9 FAND9 F4/

    2/ C%eate t'e t%ut' ta,le !% t'ese t'%ee $e%at"ns/

    3/ S"mulate t'e ()DL mdule/ Mae st"mulus "n$uts unt!%m 00 119 &a"t"n# 100 ns ,et&een ea' unt/

    H/ (e%"! t'at u% t%ut' ta,le %%es$nds &"t' t'es"mulat"n ut$ut/

    5/ C%eate a UCF !% La,0B/ Ass"#n:

    A t S19 B t S0 FNT t LD09 FAND t LD19 F4 t LD2/

    / Gene%ate and d&nlad $%#%am >le -/,"t t F@GA

    / (e%"! t'at t'e 'a%d&a%e &%s as e*$eted ,ased n u%t%ut' ta,le !%m 32/

  • 7/23/2019 VHDL Introductory lab

    32/37

    T4UT) TABLES F4 NT9 AND9 4 GATES

    5nputs

    6utput

    F_N6T

    - 7 -

    ! 1 0

    5nputs

    6utput

    8 F_N2

    - 7 7 7

    ! 0 1 0

    " 1 0 0 - - -

    5nputs

    6utput

    8 F_69

    - 7 7 7

    ! 0 1 1

    " 1 0 1

    - - -

    LAB 0 @46ECT B

  • 7/23/2019 VHDL Introductory lab

    33/37

    LAB 0 @46ECT B NAND9 N49 O49 ON49 BUFFE41/ C%eate a ne& $%Qet/ Name "t La,0A/

    %"te t'e ()DL t'at $e%!%ms t'e NAND9 N49 O49 ON4 and Bue%$e%at"ns n "n$ut alues/

    In$ut s"#nals: A and B ut$ut s"#nal: FNAND9 FN49 FO49 FON49 FBUFF/

    2/ C%eate t'e t%ut' ta,le !% t'ese >e $e%at"ns/

    3/ S"mulate t'e ()DL mdule/ Mae st"mulus "n$uts unt!%m 00 119 &a"t"n# 100 ns ,et&een ea' unt/

    H/ (e%"! t'at u% t%ut' ta,le %%es$nds &"t' t'es"mulat"n ut$ut/

    5/ C%eate a UCF !% La,0B/ Ass"#n:

    A t S19 B t S0 FNAND t LD0 9FN4 t LD19 FO4 t LD29 FON4 t LD39 FBUFF

    t LDH

    / Gene%ate and d&nlad $%#%am >le -/,"t t F@GA

    / (e%"! t'at t'e 'a%d&a%e &%s as e*$eted ,ased n u%t%ut' ta,le !%m 3H/

    T4UT) TABLES F4

  • 7/23/2019 VHDL Introductory lab

    34/37

    T4UT) TABLES F4NAND9 N49 O49 ON49 BUFFE4

    5nputs

    6utput

    8F_NN

    2

    7 7 -

    0 1 1

    1 0 1

    - - 7

    5nputs

    6utput

    8F_N6

    9

    7 7 -

    0 1 0

    1 0 0

    - - 7

    5nputs

    6utput

    8 F_,697 7 7

    0 1 1

    1 0 1

    - - 7

    5nputs

    6utput

    8F_,N69

    7 7 -

    0 1 0

    1 0 0

    - - -

    5nputs

    6utput

    F_8:FF- 7 7

    ! 1 1

  • 7/23/2019 VHDL Introductory lab

    35/37

    LAB 0 @46ECT C DEM4GAN7SLAS1/ C%eate a ne& $%Qet/ Name "t DeM%#anGates/

    %"te ()DL !% a Ynt79 Yand79 and Y%7 #ates us"n# nl Ynand7 #ates/ In$ut s"#nals: O9 !% t'e t'%ee #ates/ ut$ut s"#nals: FNT9 FAND and F4 -4e"e& 'a$te% 1 $a#es 2 t 32/ -Es$e"all F"#u%es 1/15 and 1/1

    2/ C%eate t'e t%ut' ta,le !% all #ates/

    3/ S"mulate t'e #ates/ Mae st"mulus "n$uts unt !%m 00 119 &a"t"n# 100 ns,et&een ea' unt/

    H/ (e%"! t'at u% t%ut' ta,les %%es$nd &"t' t'e s"mulat"n ut$ut/

    5/ C%eate a UCF !% t'e #ates= Ass"#n: O t S t S

    FNT t LD FAND t LDH F4 t LD0

    / Gene%ate and d&nlad $%#%am >le -/,"t t F@GA

    / (e%"! t'at t'e 'a%d&a%e &%s as e*$eted ,ased n u% t%ut' ta,les !%m 32/

  • 7/23/2019 VHDL Introductory lab

    36/37

    DEM4GAN LGIC GATES

    NT Gate

    A FNT A FNT

    FAND

    AND Gate

    FANDA

    B

    A

    B

    A

    BF4

    4 Gate A

    BF4

    FNt ;< A nand A

    FAND ;< -A nand B nand -A nand B

    F4 ;< Z

  • 7/23/2019 VHDL Introductory lab

    37/37

    LAB 4E@4T

    Ce% $a#e: Cu%se T"tle La, Num,e%9 Lette% Team Names

    @%Qet 0A: ()DL Mdule Bla B* T%ut' Ta,le S"mulat"n ae!%m UCF

    @%Qet 0B: ()DL Mdule Bla B* T%ut' Ta,le S"mulat"n

    UCF

    @%Qet 0C: ()DL Mdule Bla B* T%ut' Ta,le S"mulat"n UCF

    Summa% $a%a#%a$' % m$leted An $%,lems )el$!ul )"nts Su##ested

    Im$%ements