?? d_flip_flop.vhd
字號:
--** D觸發器
--文件名:D_flip_flop.vhd
--功 能:D觸發器
--說 明:以撥盤開關作為數據輸入端,用發光二極管來反映鎖存的數據;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity D_flip_flop is
Port (clk : in std_logic; --時鐘信號;
reset : in std_logic; --異步復位;
datain : in std_logic_vector(7 downto 0); --輸入數據;
cs : out std_logic_vector(1 downto 0); ----數碼管、發光二極管片選信號;
q : out std_logic_vector(7 downto 0) );--輸出數據;
end D_flip_flop;
architecture Behavioral of D_flip_flop is
begin
cs<="01"; --選通發光二極管;
process(clk,reset)
begin
if reset='0' then q<="00000000";
elsif clk'event and clk='1' then
q<=datain;
end if;
end process;
end Behavioral;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -