- 1、本文档共6页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
EDA上机实验报告高彬吉祥
一、 实验目的:了解qunters2的使用方法及操作方法。
二、 设计任务:设计出秒表计时器。
三、 程序代码
library ieee;
use ieee.stdJogic_1164.all;
use ieee.std」ogic_unsigned.all;
entity elk is
port
(
elk : in std_logic;
reset : in std_logic;
en : in std_logic;
jw : out std」ogic;
ql,q2,q3pq4,q5,q6 : out std_logic_vector ( 3 downto 0 )
);
end entity elk;
architecture alg_clk of elk is
signal couL,couH,couLl,couHl,couL2,couH2 : std_logic_vector ( 3 downto 0 ); signal jwl,jw2 : std_logic;
begin
process (clk,reset)
begin
if reset=O then
couL=,,0000n;
couH=,,0000;
elsif clkevent and clk=l then
if en = 1* then
if ( couL=9 and couH=9 ) then
couL=n0000n;
couH=0000;
elsif couL=9 then
couL=0000;
couH=couH+l;
else
couL=couL+l;
end if;
end if;
end if;
end process;
process (couL,couH)
begin
if ( couL=9 and couH=9 ) then jwlv二T;
else jwl=,0,; end if;
end process;
process (clk,reset)
begin
if reset=O then couLl=n0000n; couHl=0000n;
elsif clkevent and clk=l then
if en = 1* then
if jwl=O then couLl=couLl; couHl=couHl;
elsif couLl=9 then couLl=n0000; couHl=couHl+l;
else couLl=couLl+jwl;
end if; end if;
end if;
end process;
process (couLl^ouHl)
begin
if ( couLl=9 and couHl=5 ) then jw2=l,;
else jw2=,0,;
end if;
end process;
process (elk,reset) begin
if reset=lOl then
couL2=n0000H; couH2=H0000n;
elsif clkevent and clk=l then
if en = 1* then
if jw2=O* then couL2=couL2; couH2=couH2;
elsif couL2=9 then couL2=0000,; couH2=couH2+l;
else
couL2=couL2+jw2;
end if;
end if;
end if;
end process;
process (couL2,couH2)
begin
if ( couL2=9 and couH2=5 ) then jw=*l;
else jw=lO,; end if;
end process;
ql=couL;
q2=couH;
q3=couLl;
q4=couHl;
q5=couL2;
q6=couH2;
end architecture alg_clk;
四、仿真图形
,H ? 90翰二》V % PO 匕 8 ? Q ?Utitr4 hretia XI AVTO-*和X 06)ProHCt S0?tor ? ■ ckvM心也?卯 PB / Diy IWi JFlw |Q5Jr;??)? Cl?iti Ti?i? AMlys1? ? EM ??tint Vritw? B ? 皿耳7 ? ?几—,:?:ft $yT?th?iii7 I -? FiMr A —,?)⑧ trp— Ikvic?(Dpe hroa?iig K?pg1 V?Uc? ■ SvM?ryolwterSwiery Sizl?U? in u?y?rQ力力 ffi ffiss| 令 Cco^bonRg FtowSu 令 S?uUhon Report S?u ? 0
文档评论(0)