vhdl秒表报告.docVIP

  • 8
  • 0
  • 约4.6千字
  • 约 8页
  • 2016-09-21 发布于重庆
  • 举报
vhdl秒表报告

实验:vhdl秒表设计报告 一、验目的: ???? 秒表的逻辑结构比较简单,它主要由、显示译码器、分频器、十进制计数器、六进制计数器组成。二、结构组成: ??? 1、十进制计数器:用来对秒进行计数; ??? 2、进制计数器:用来分别对十秒进行计数; ??? 3、分频率器:用来产生的计数脉冲; ??? 4、 三、实验内容及步骤: ??? 1、 ??? 2、 ??? 3、 ??? 4、 ??? 四、实验源代码如下: 源代码vhdl语言如下: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity div is port(inclk:in std_logic; outclk:out std_logic:=0); end; architecture behave of div is signal temp:integer range 0 to 99999; signal internal:std_logic:=0; begin process(inclk) begin if inclkevent and inclk=1 then if temp=10 then temp=0; internal=not internal; else temp=temp+1; end if; outclk=internal; end if; end process; end behave; 2,十进制计数器模块 原理图: 十进制vhdl源码: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt10 is port(clk,clr,en:in std_logic; q:buffer std_logic_vector(3 downto 0); c10:out std_logic); end; architecture behave of cnt10 is begin process(clr,clk) begin if clr=0 then q=0000; elsif clkevent and clk=1 then if en=1 then if q9 then q=q+1; else q=0000; end if; end if; end if; end process; process(q) begin if q=0000 then c10=1; else c10=0; end if; end process; end; 3,六进制计数模块 原理图 源代码: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt6 is port(clk,clr,en:in std_logic; q:buffer std_logic_vector(2 downto 0); c6:out std_logic); end; architecture behave of cnt6 is begin process(clr,clk) begin if clr=0 then q=000; elsif clkevent and clk=1 then if en=1 then if q5 then q=q+1; else q=000; end if; end if; end if; end process; process(q) begin if q=000 then c6=1; else c6=0; end if; end process; end; 4,十进制锁存 原理图: 代码: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity suo is port(inp:in std_logic_vector(3 downto 0); suo:in std

文档评论(0)

1亿VIP精品文档

相关文档