附:EDA课程设计完整版---数字秒表(设计报告+仿真文件+硬件实现)仿真文件下载地址:/detail/zhj8861991/4061 198(友情提示:关于页数,下载后请删除此页即可)《可编程器件及应用课程设计报告》题目数字秒表学院信电工程学院专业电子信息科学与技术班级姓名学号指导教师目录课程设计任务书 (3)一、系统组成模块连图 (4)二、模块器件及其程序 (4)1、分频器 (4)2、十进制计数器 (5)3、六进制计数器 (6)4、动态扫描 (7)5、译码显示管 (8)三、系统仿真 (9)1、六进制计数器 (9)2、十进制计数器 (9)3、动态扫描 (9)4、译码显示管 (10)5、分频器 (10)6、系统仿真 (11)7、硬件实现 (11)四、心得体会 (12)课程设计成果1.与设计内容对应的软件程序2.实验报告3.课程设计报告书一、系统组成模块连接图二、模块器件及其程序1、分频模块及其程序本模块实现脉冲分频,本实验使用的EP2C5的CLK3所以进行10分频产生100HZ的脉冲。
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity div isport (clk:in std_logic;clk1:out std_logic);end div;architecture behav of div issignal temp:std_logic_vector(3 downto 0);signal clk3:std_logic;beginprocess(clk)beginif clk'event and clk='1'thenif temp="1001" then clk3<=not clk3;temp<="0000";else temp<=temp+'1';end if;end if;end process;clk1<=clk3;end behav;2、十进制程序产生99毫秒、秒的低位、分的低位的功能。
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity cnt10 isport(clk,clr,start:in std_logic;cout:out std_logic;daout:buffer std_logic_vector(3 downto 0));end cnt10;architecture behav of cnt10 isbeginprocess(clk,clr,start)beginif clr='1' then daout<="0000";elsif(clk'event and clk='1')thenif start='1' thenif daout="1001" then daout<="0000";cout<='1';else daout<=daout+'1';cout<='0';end if;end if;end if;end process;end behav;3、六进制程序产生秒的高位、分的高位library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity cnt6 isport(clk,clr,start:in std_logic;cout:out std_logic;daout:buffer std_logic_vector(3 downto 0));end cnt6;architecture behav of cnt6 isbeginprocess(clk,clr,start)beginif clr='1' then daout<="0000";elsif(clk'event and clk='1')thenif start='1' thenif daout="0101" then daout<="0000";cout<='1';else daout<=daout+'1';cout<='0';end if;end if;end if;end process;end behav;4、动态扫描程序动态的扫描六个数码管,实时的显示出相应的数字。
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity seltime isport(clk,clr,start:in std_logic;dain0,dain1,dain2,dain3,dain4,dain5:in std_logic_vector(3 downto 0);daout:out std_logic_vector(3 downto 0);sel:out std_logic_vector(2 downto 0));end seltime;architecture behav of seltime issignal temp:std_logic_vector(2 downto 0);signal d_out:std_logic_vector(3 downto 0);beginsel<=temp;process(clk)beginif clk'event and clk='1' thenif temp="101" thentemp<="000";elsetemp<=temp+'1';end if;end if;end process;process(temp,clr,dain0,dain1,dain2,dain3,dain4,dain5)beginif clr='1' thend_out<="0000";elseif temp="000" then d_out<=dain0;elsif temp="001" then d_out<=dain1;elsif temp="010" then d_out<=dain2;elsif temp="011" then d_out<=dain3;elsif temp="100" then d_out<=dain4;elsif temp="101" then d_out<=dain5;else d_out<="0000";end if;end if;end process;daout<=d_out;end behav;5、译码显示管程序显示管电路的作用是在74LS138的驱动将计数值在LED数码管上显示出来。
计时电路产生的值在经过BCD七段译码后,驱动LED数码管。
library ieee;use ieee.std_logic_1164.all;entity xianshi isport(num:in std_logic_vector(3 downto 0);led:out std_logic_vector(7 downto 0));end xianshi;architecture behav of xianshi isbeginprocess(num)beginled<=(others=>'1');case num iswhen"0000"=>led<="00111111";when"0001"=>led<="00000110";when"0010"=>led<="01011011";when"0011"=>led<="01001111";when"0100"=>led<="01100110";when"0101"=>led<="01101101";when"0110"=>led<="01111101";when"0111"=>led<="00000111";when"1000"=>led<="01111111";when"1001"=>led<="01101111";when others=>NULL;end case;end process;end behav;三、系统仿真1、六进制仿真图2、十进制仿真图3、动态扫描仿真图4、译码显示仿真图5、分频器仿真图6、系统仿真图7、硬件实现四、心得体会通过本次课程设计,我巩固了关于EDA的许多专业知识。
开始做设计时总是会犯一些错误,只有经过不停的改错不停的编译才能得到正确的程序。
在编程时,我充分使用了结构化的思想,这样程序检查起来也比较方便,调试时也给了我很大方便,只要一个模块一个模块的进行调就可以了,充分体现了结构化编程的优势。
在设计中要求我要有耐心和毅力,还要细心,稍有不慎,一个小小的错误就会导致结果的不正确,而对错误的检查要求我要有足够的耐心,通过这次设计和设计中遇到的问题,也积累了一定的经验,对以后从事集成电路设计工作会有一定的帮助。