?? an_switch.vhd
字號:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity an_switch is
--實現按鍵脈沖變換成固定的‘0’‘1’信號
port
( star_in : in std_logic;
waiten_in : in std_logic;
switch_in : in std_logic;
star : out std_logic;
wait_en : out std_logic;
switch : out std_logic:='0'
);
end entity;
architecture arc of an_switch is
signal flag0 :std_logic:='0';
signal flag1 :std_logic:='0';
signal flag2 :std_logic:='0';
begin
process(star_in) is
begin
if(star_in'event and star_in='1')then --有一個信號就變換一次
flag0<=not flag0;
end if;
end process;
process(waiten_in) is
begin
if(waiten_in'event and waiten_in='1')then
flag1<=not flag1;
end if;
end process;
process( switch_in ) is
begin
if(switch_in'event and switch_in='1')then
flag2<=not flag2;
end if;
end process;
star<=flag0; --信號輸出
wait_en<=flag1;
switch<=flag2;
end arc;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -