《十六进制7段数码显示译码器设计实验报告.docx》由会员分享,可在线阅读,更多相关《十六进制7段数码显示译码器设计实验报告.docx(17页珍藏版)》请在三一办公上搜索。
1、实验名称:十六进制7段数码显示译码器设计实验目的:1. 设计七段显示译码器2. 学习Verilog HDL文本文件进行逻辑设计输入;3. 学习设计仿真工具的使用方法;工作原理:7段数码是纯组合电路,通常的小规模专用IC,如74或4000系列的器件只 能作十进制BCD码译码,然而数字系统中的数据处理和运算都是二进制的,所以 输出表达都是十六进制的,为了满足十六进制数的译码显示,最方便的方法就是 利用译码程序在FPGA/CPLD中来实现。例如6-18作为7段译码器,输出信号LED7S 的7位分别接图6-17数码管的7个段,高位在左,低位在右。例如当LED7S输 出为 “1101101” 时,数码管
2、的 7 个段 g,f,e,d,c,b,a 分别接 1,1,0,1,1,0,1; 接有高电平的段发亮,于是数码管显示“5”。注意,这里没有考虑表示小数点的 发光管,如果要考虑,需要增加段h,例6-18中的LED7S:OUT STD_LOGIC_VECTOR(6 DOWNTO 0)应改为 DOWNTO 0)。实验内容1:将设计好的VHDL译码器程序在QuartusII上进行编辑、编译、综 合、适配、仿真,给出其所有信号的时序仿真波形。实验步骤:步骤1:新建一个文件夹击打开vhdl文件;Newp SOPC Builder SystemDesign FilesHOL File:Blcck D iaLr
3、dm1-,lS chematic File| |- EDIF File:Stcte Machine Filep- SystemVeriog HDL File; Tcl Script File! Verilog HDL FileVHDL File M ernurH Files:H eK-adecimal I ntel Forrnat) Filej MOTiory Iniidlizdtion FileVerificction1-,ID tbugging Filesp- In-System Sources and Probes File:Logic .Analjjzer Interface FleS
4、igialTap II Logic Analyzer File:- Vector Waveform FileS-Other Files| -AHDL Include File?Blcck Symbol FileChain D escription FileSyriopr1 Design Con:E:l:rainbE: File= T e:-:t FileTCIK | Cancel步骤2:编写源程序并保存LZBRAWHENrr0Q01rr=WHENrr001Orr=WHENrr0022rr=WHENrr020Qri=WHENrr0102ri=WHENrr011Qri=WHEMFll暨=WHENr
5、r20OOrr=WHEWWOhfWHENrr2Q10rr=可皿T官任WHENrr21QQri=WHENrrllQlri=WHENrrllinn=WHE邱旦里”fLED7S=ri0111211r,;LED75=riQ000110ri ;LED7S=rr2O21012ri ;LED7S=rr2.O02222ri ;LED7S=rr210OllOri ;LED75=rr2101101ri ;LED75=rr2121101ri ;LED75=riQ000111ri ;LED7S=rr2121212ri ;LED75=rr2120112ri ;LED75=rr2111100ri ;LED75=ri011
6、1001ri ;LEDT欤=*鱼金。;LED751ET1L;EbTD CASE;Ei-ID PROCESS;END;步骤3:新建一个工程及进行工程设置Recent圜我的文档 L我的电脑 费网上邻居 .gadder tDECLTSA京面我的电脑网上郃居保存庭支件名 :jDECLTS,vhiWhenou click FiriLsh,. the projeGl will ber.created with the followirg settings:Projec directory:C?/Docunrients时d如止ing球黑嘿填食)Project name:DE CVSTop-level des
7、ign entity:DECL7SNumber of file added:2Number af user librari dded;0D 已vice aignmert5:Family name:Cjjclorie IIIDqe:EP3C5E144C8EDA tools:Design entry/synthesis:Simulation:4 N cine:*Timing analysis;我“Operating conditions:TOINT voltage:IWJunction temperature range:0-854 EackPini ah取消ategory:General ,Fi
8、les :- LibrariescviceSelect Ihe temilp and device you want to targel for carrpibtion.DeviceB- Liperafing Seuings and Curditiuns:3 Cornpilathn Proc:gs: G ettings3- EDATool Settinos由 Analyse Sc 6.jrnthesis Settings=Fitter SebtirgsB- Timing A旧p:i:w SeKings.Assembler? Design .Assistant? Signal!qp II Lcg
9、is Aralpzer=Logie Analjiser InterfaceB- Simiiafur Setting:P-ii.ierPlii i Prii.uat AkiIi 匚 uiFhmTarget devceL Au Io devce elBct$d by the FEter席 Gpeafic device selected in Avaiabl$ devices islC Other nZaShow h Avalable devices listShow advanced devices 厂 HcrdCopy ccrrpddble cnlji旦口杭匚仁 dnd Pin Options.
10、mrDiial-PurroEe PinsVoltajeFin FlscementError Iletacti an CRC | Capaci tive Lo ad: ng | Eoard Trace Ho del I/O Timing &eneralFrorrannins FilesIfriused PirtiSpecify lhe devce conliguralicn sckenne a rd the conFiguration device. Note: Far HaidZopy dcsigiL lhesc setlirgi dpp to the FPGA protolype devic
11、e.Configuration schemeAclive Gurid |:cen l骚己匚nnfigretiori Dzice:|Configuratbn jnode:Cbnfguration devce* Ue conFigurdtion devce: |EFCS4ot-ErdardCorfigLiation Devce Options.Canligjialicn device I/O vol:age:AutoF FcrceVCCIO to be compatible with Gorfifli.rction I/O ydtage* Generate carrpre?sed bit$tiea
12、m$Acbve 钥rial cbck source:Descriptbn:The rnelhod u如d Id bad data into the devce. Up to foir Danliguialiori scPennes dre avaiable. cfepending on the selected device: Passive SerialfPS; Fast Passive Parallel |FPP) Active Paialel (P) ad Active Serial |S).步骤4:调试程序至无误;Info: No 3 7nchron.izer chaias to re
13、port*Warning: At least one of the filters had sc-ne problems and could not be iBEtched.Info: Ee.gi-orn is nDt full/ coEstrained for setup requirenentg-V.V4Vrinfo: LC.3LJI1 is gt full/ cc-nstrained idl hold MQUirenentsinto: luarrua II 64-bil lun.eQu.e3L luring Analyzer wasi successlul. 0 errorsr 6 wa
14、mingaInfo: Cuarma II Full OowilaLlon was sacMsstJi. 0 errors. 11 warningsnn步骤5:接着新建一个VECTOR WAVEFOM文件及展出仿真波形设置:: yterrf/enbg HUL FileI T cl Gcripl Fie j kVEfilogHDLFilel -VHDL FileB- Memory Files* H ewadedmal (I ntd-Formai: HeMerrorp Initiafzation Fie0- VerihcatiorVDebiQQinQ Files:- IrrSystuE Source
15、j and Probes Fife; Logic Analjer Interface File Signal! ap II Logic Analyzer FileEnd T imeTime:网Default ewtension options:Vector Wavelorrn FileEwtension value: (Last clock patternH- Jtitr Hies:;I-D_ nclL.dc File? block Suntolble: Cl aiii DcLii|.liuii Fie;r rrrlEirle Fia - tKlFieOKICarnal I . . c.II.
16、 I Jade Finderlamed: p-| Filter: |Pins: all-| Customize.ookin: IDEGL751D二I 旧 Include aubentitisEnd time extension per signal:Sign扇1巳 顷知肃 |RadixExtension valueName1 AssignmentsType| Creator最白IJnassignedInput GroupUser enterediiA0UnassignedInputUser entered1A1IJnassignedInputUser enteredlJA2fUnassigne
17、dInputUser enterediA31UnassignedInputUser entered- l?h 1 11. C . f-. J odes Found:I I0 A B OOCl叠 5 田 LED7S E m.步骤6:输入数据并输出结果(时序仿真图)lame0 AML-A 31踏2-A2龄3.-Al1-A0鸯5 LEDTS西&-.6时7-.5莎日-.4龄g-.3矽L0-.2矽L1-.1疫LZL .oMaster Time Bar:0 psPoirtej:0 ps. .Interval:Ops Start: 0 ps End:.j 0J pi区溺 us 5. 12 us 7 68 u
18、w 10.4 ns 12.8 us 15.36 uz IT.I IIII1- ps 一 一 :I _L_J I I _I I _I I I I _I I _I I _I : ?_ 正1*I III InlI h I I I ! Ii I I 11 I V ! I | ! I | 步骤7:设置好这个模式GariBralFBesLbrariesDsmce: Liperadng SeKings: and Conditions:g- Corrpifetbn Pcicess Setting:!:3 ED.A ToijI GettingsB- Anasis k Synthssis Settings: Ff
19、cter Settings3 T mirig.naSE: SettingsAssentiler:Desian .AssistantG igralTap II Logic:.Analpzsrr- Lugfc AnalEE丁 Interfaceg-Smulator SettinasPovserPlar1 Pa-.er Ana脂et S etdrgs= S5N Analyser步骤8:生成RTL原理图步骤9:引脚锁定及源代码LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY DECL7S ISPORT(A :IN STD_LOGIC_VECTOR(3 DO
20、WNTO 0);LED7S:OUT STD_LOGIC_VECTOR(6 DOWNTO 0);END;ARCHITECTURE one OF DECL7S ISBEGINPROCESS(A)BEGINCASE A ISWHEN0000=WHEN0001=WHEN0010=WHEN0011=WHEN0100=WHEN0101=WHEN0110=WHEN0111=WHEN1000=WHEN1001=WHEN1010=WHEN1011=WHEN1100=WHEN1101=WHEN1110=WHEN1111=LED7S=0111111LED7S=0000110LED7S=1011011LED7S=10
21、01111LED7S=1100110LED7S=1101101LED7S=1111101LED7S=0000111LED7S=1111111LED7S=1101111LED7S=1110111LED7S=1111100LED7S=0111001LED7S=1011110LED7S=1111001LED7SNULL;END CASE;END PROCESS;END;LLxusQoiigEZmHEF iSiCLfGjrtit StrefigthRput12.82nxt2.3 Ijd血如.g心JCEATK L1站Idefy汹oeliuk.4input1:!.如蚀或rA (dahJl:5IJED布回O
22、jhjIIC&W: 33LKi?S6sX)翌地山:6utpiil1UCMV. 3J2.3ii(defkiC-LBD75a. .0-SnA (oefaJiZioefsd;-LED 75 HDuiput-2.S w 妣LETS戚句SffA 任:姓 Mh)回布JOuqxjiIO6WIK:JLBJ第食.flg窿政9IJtD?32jipulICCANKJUijd心岫LBD75fl. 0SrrJ- WM:uOUED珂】J0EAT_3a*LEDTS 戚.03mAccfajirZtdefvlt:LI皿范0】lO&w: 32.5 -LEDKfi.q球(ckihUi;-12Few gd匕加、实验内容二:1、硬件测
23、试。程序不一样,其他步骤相同操作LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY CNT4B ISPORT (CLK,RST,ENA:IN STD_LOGIC;OUTY:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);COUT:OUT STD_LOGIC);END CNT4B;ARCHITECTURE behav OF CNT4B ISBEGINPROCESS(CLK,RST,ENA)VARIABLE Q:STD_LOGIC_VECTOR(3 DOWNTO 0);BE
24、GINIF RST=0 THEN Q: = (OTHERS=0);ELSIF CLKEVENT AND CLK=1 THENIF ENA=1 THENQ:=Q+1;END IF;END IF;IF Q二1111 THEN COUT=1;ELSE COUT=0;END IF;OUTYclock0, RST=rst0, ENA=ena0, OUTY=tmp, COUT=cout0);u2:DECL7S PORT MAP(A=tmp, q=led);END ARCHITECTURE ad1;2、时序仿真波形:Siiriulation WaveformsSiniil方.七】皿 mode: Fmwtio
25、rsil境 Master The BarAA10zLo ckDar=+0coutJOH leiTJ oa-Zl -4 JJL卜15.425 nsJjJ Falter:30. 0Z7.IE nsIrtEC/dt11.6 nsStartEnd,10. 0 ns1 1LK r u /:3、RTL原理图:(计数器和译码器连接电路的顶层文件原理图) ECL7S:u2产1 a rkfl - -田EUT lENiaurq3.q rarLI U LFS.U |q n w n - -J 1 1 Q LJ | rstOI-CMT4S:u1辛.可密.可 e d6. 0coutO注意:运用实验三,调用实验一和实验二的
26、RTl原理图得计数器和译码器连接电路的顶层文件原理 图在引脚锁定及硬件测试。建议选GW48系统的实验电路模式6(参考附录图F-6),用数码8显示译码输出(PIO46PIO40),键8、键7、键6和键5四位控制输入,硬件验证译码器的工作性能。提示1:目标器件选择MAX7000S系列的EPM7128SLC84-15。提示2:引脚锁定除了参考第5章第2节内容外,具体引脚编号选定应参考“实验附注资料 附注3:万能接插口与结构图信号/与芯片引脚对照表”的 “EPM7128S-PL84 ”栏目。提示3:选实验电路模式6,参考“实验附注资料附注2:实验电路结构图”的“附图2-8实验电路结构图NO.6”栏目。
27、实验心得及个人心得:通过本次实验,对Quartus II有了进一步的学习和认识,对Verilog也有了 深入了解。学会了 7段数码显示译码器的Verilog硬件设计,学习了 VHDL的 CASE语句应用及多层次设计方法。在设计顶层文件时,最有深刻体会,自己在 不知道弄错了多少次和请教过别人多次,在终于知道顶层文件怎样生成的所以 我们应该学会认真分析程序,弄清实验原理,做实验时耐心、认真,遇到问题 争取自己解决。认真总结实验,分析波形,完成实验报告。特别经过一个学期 的学习,我并不说我完全懂得EDA技术,我知道在程序方面还有很多要学习的, 对于EDA,我都还懂得一些必要的语法和程序。这门课程锻炼了我读程序的能 力和分析语法用法的能力,为我将来学更高级的语言打下了基础,很多语言都 是有相通的地方,只是有些用法不太一样而已。但我学到了运用Quartus II这 个软件,并靠自己慢慢去摸索,慢慢研究。能多学一些软件就多学一些,毕竟 不知道将来的路怎样发展。虽然老师说EDA这门课程出来后用处不大,但我觉 得锻炼了自我学能力和分析问题、解决问题的能力。
链接地址:https://www.31ppt.com/p-5076124.html