program-m.vhd
来自「last time when i came here to find some 」· VHDL 代码 · 共 39 行
VHD
39 行
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity newminute is
port (carry,reset,clk1:in std_logic;
sethour: in std_logic :='0';
Lmin,Hmin: out std_logic_vector(3 downto 0);
carrym: out std_logic);
end newminute;
architecture t1 of newminute is
signal mint1,mint2: std_logic_vector(3 downto 0);
begin
process(reset,carry)
begin
if reset='1' then
mint1<="0000";
mint2<="0000";
elsif sethour='1' then
carrym<=clk1;
elsif (carry'event and carry='1') then
if mint1="1001" then
mint1<="0000";
if mint2="0101" then
mint2<="0000";
else mint2<=mint2+1;
end if;
else mint1<=mint1+1;
end if;
if (mint1="1001" and mint2="0101") then
carrym<='1';
else
carrym<='0';
end if;
end if;
end process;
Lmin<=mint1;
Hmin<=mint2;
end t1;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?