?? seltime.vhd
字號:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity seltime is
port(ckdsp,reset:in std_logic;
second,minute,hour:in std_logic_vector(7 downto 0);
daout:out std_logic_vector(3 downto 0);
sel:out std_logic_vector(2 downto 0));
end seltime;
architecture behave of seltime is
signal count:std_logic_vector(2 downto 0);
begin
sel<=count;
process(CKDSP)
begin
if(reset='0')then daout<="0000";
else
if(CKDSP'event and CKDSP='1') then
if(count>="111") then
count<="000";
else
count<=count+1;
end if;
end if;
end if;
case count is
when"000"=>daout<=second(3 downto 0);
when"001"=>daout<=second(7 downto 4);
when"010"=>daout<=minute(3 downto 0);
when"011"=>daout<=minute(7 downto 4);
when"100"=>daout<=hour(3 downto 0);
when"101"=>daout<=hour(7 downto 4);
when others=>null;
end case;
end process;
end;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -