mms.vhd
来自「利用一块芯片完成除时钟源、按键、扬声器和显示器(数码管)之外的所有数字电路功能。」· VHDL 代码 · 共 39 行
VHD
39 行
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity mms is
port(clk,clr:in std_logic;
co:buffer std_logic;
ge,shi:buffer std_logic_vector(3 downto 0));
end;
architecture mms_1 of mms is
begin
process(clk,clr)
begin
if clr='0' then
ge<="0000";
shi<="0000";
elsif clk'event and clk='0' then
if ge="1001" and shi="1001" then
co<=not co;
ge<="0000";
shi<="0000";
elsif ge="0101" and shi="0101" then
co<=not co;
ge<=ge+'1';
elsif ge="1001" then
shi<=shi +'1';
ge<="0000";
else ge<=ge+'1';
end if;
end if;
end process;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?