📄 compare.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity compare is
port(ok,clk : in std_logic;--计时时钟
d,e : in std_logic_vector(5 downto 0);--开锁时输入的密码
f: out std_logic_vector(5 downto 0);--锁的原始密码
g: out std_logic); --密码正确与否的输出
end;
architecture behave of compare is
signal f0 : std_logic_vector (5 downto 0);
signal g0 : std_logic :='0';
--signal ok: std_logic := '0';
begin
process( d,e,clk)
begin
if clk'event and clk = '1' then
if d(5 downto 0)= e (5 downto 0) then
--f0(5 downto 0) <= d (5 downto 0);
g0 <= '1';
else
g0 <= '0';
--ok0 <= '1';
end if;
end if;
if ok = '1' then f0(5 downto 0) <= d (5 downto 0);
end if;
end process;
f(5 downto 0) <= f0 (5 downto 0);
g <= g0;
end behave;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -