📄 jishuqi.txt
字号:
三、实验要求
(1)设计一个带有技术允许输入端、复位输入端和进位输出端的10进制计数器。
(2)编制仿真测试文件,并进行功能仿真。
(3)下载并验证计数器功能。
(4)为上述设计建立元件符号
四、VHDL源文件
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity cont2 is
port(res:in bit;
enable:in bit;
clk:in bit;
q:out integer range 0 to 9;
cq:out bit);
end cont2;
architecture num of cont2 is
begin
process(clk)
variable cn:integer range 0 to 255;
begin
if (res='0') then
cn:=0;cq<='0';
else if(clk'event and clk='1') then
if (enable='1' ) then
if(cn=8 ) then cn:=cn+1;cq<='1';
else if(cn=9)then
cn:=0;cq<='0';
else
cn:=cn+1;
end if;
end if;
end if;
end if;
end if;
q<=cn;
end process;
end architecture num;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -