?? data_c.vhd
字號:
--** 數據分配器
--文件名:data_c.vhd
--功 能:數據分配器
--說 明:以撥盤開關作為數據輸入端,用數碼管來反映輸入的數據,通過不同的按鍵組合將數據用不同的數碼管顯示出來;
-- mux0、mux1分別用按鍵S3,S4來表示;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity data_c is
Port (datain : in std_logic_vector(7 downto 0); --數據輸入端;
mux : in std_logic_vector(1 downto 0); --多路選擇開關;
cs : out std_logic_vector(1 downto 0);--數碼管、發光二極管選通信號;
shift : out std_logic_vector(3 downto 0);--數碼管動態掃描信號;
dataout: out std_logic_vector(7 downto 0));--數據輸出端
end data_c;
architecture Behavioral of data_c is
begin
cs<="10"; --選通數碼管;
dataout<=datain;
with mux select --通過不同的按鍵組合將數據用不同的數碼管顯示出來;
shift<="1110" when "00",
"1101" when "10",
"1011" when "01",
"0111" when others;
end Behavioral;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -