你好,有人可以帮帮我吗?
我正在尝试制作一个数字时钟。
但是显示一个警告说输出“hora2”从未使用过。
对不起,我的英语不好 !
完整代码:https://www.dropbox.com/sh/8gay1r7bodukjqq/5fGPmj0ZcO
---------------------------
库ieee;使用ieee.std_logic_1164.all;使用ieee.std_logic_arith.all;使用ieee.std_logic_unsigned.all;
实体RelogioDigital isport(clk1:在std_logic; minuto1:out std_logic_vector(3 downto 0); minuto2:out std_logic_vector(3 downto 0); hora1:out std_logic_vector(3 downto 0); hora2:out std_logic_vector(3 downto 0));
RelogioDigital;
架构RelogioDigital的行为是
signal seg:整数范围0到60:= 0;
信号min1,min2,hr1,hr2:整数范围0到10:= 0;
信号计数:整数:= 1;
开始minuto1 minuto2 hora1 hora2
以上来自于谷歌翻译
以下为原文
Hello, can someone help me?
I'm trying to make a digital clock.
But show one warning saying that the output "hora2" is never used.
Sorry for my bad english !
Complete code:
https://www.dropbox.com/sh/8gay1r7bodukjqq/5fGPmj0ZcO
---------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
en
tity RelogioDigital is
port (clk1 : in std_logic;
minuto1 : out std_logic_vector(3 downto 0);
minuto2 : out std_logic_vector(3 downto 0);
hora1 : out std_logic_vector(3 downto 0);
hora2 : out std_logic_vector(3 downto 0)
);
end RelogioDigital;
architecture Behavioral of RelogioDigital is
signal seg : integer range 0 to 60 :=0;
signal min1,min2,hr1,hr2 : integer range 0 to 10 :=0;
signal count : integer :=1;
begin
minuto1 <= conv_std_logic_vector(min1,4);
minuto2 <= conv_std_logic_vector(min2,4);
hora1 <= conv_std_logic_vector(hr1,4);
hora2 <= conv_std_logic_vector(hr2,4);
process(clk1)
begin
if(clk1'event and clk1='1') then
seg <= seg+ 1;
if(seg = 59) then
seg<=0;
min1 <= min1 + 1;
if(min1 = 9) then
min2 <= min2 + 1;
min1 <= 0;
if(min2 = 5) then
hr1 <= hr1 + 1;
min2 <= 0;
if(hr1 = 3) then
hr1 <= 0;
hr2 <= hr2 + 1;
if(hr2 = 2) then
hr2 <= 0;
end if;
end if;
end if;
end if;
end if;
end if;
end process;
end Behavioral;
------------------------------