?? 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 + -