实验二4位十进制计数器的设计.doc

  1. 1、本文档共12页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
实验二 4位十进制计数器的设计 一、实验目的: 1、深入理解信号和变量的区别; 2、深入理解并行语句和顺序语句的区别; 3、深入理解异步和同步的概念; 4、掌握计数器的设计方法; 5、能会看最大系统运行频率和资源使用报告。 二、实验原理: 四位十进制计数器程序A: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity bcd_counter is port ( clk : in std_logic; reset : in std_logic; co : out std_logic; q : out std_logic_vector(3 downto 0) ); end entity; architecture bev of bcd_counter is begin process (clk) variable cnt : std_logic_vector(3 downto 0); begin if (rising_edge(clk)) then if reset = 1 then cnt := 0000; else if cnt 9 then cnt := cnt + 0001; else cnt := 0000; co = 1; end if; end if; end if; q = cnt; end process; end bev; 四位十进制计数器程序B: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity bcd_counter2 is port ( clk : in std_logic; reset : in std_logic; co : out std_logic; q : out std_logic_vector(3 downto 0) ); end entity; architecture bev of bcd_counter2 is signal cnt : std_logic_vector(3 downto 0); begin process (clk) begin if (rising_edge(clk)) then if reset = 1 then cnt = 0000; else if cnt 9 then cnt = cnt + 0001; else cnt = 0000; co = 1; end if; end if; end if; end process; q = cnt; end bev; 四位十进制计数器程序C: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity bcd_counter3 is port ( clk : in std_logic; reset : in std_logic; co : out std_logic; q : out std_logic_vector(3 downto 0) ); end entity; architecture bev of bcd_counter3 is signal cnt : std_logic_vector(3 downto 0); begin process (clk) begin if reset = 1then cnt = 0000; elsif (rising_edge(clk)) then if cnt 9 then cnt = cnt + 0001; else cnt = 0000; co = 1; end if; end if; end process; q = cnt; end bev; 三、实验内容: 1、资源使用情况和最大运行频率: 程序 使用逻辑单元数 使用寄存器数 最大运行频率(M

文档评论(0)

a13355589 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档