私は59までカウントする次のコードを持っています。最初は問題ありませんが、31を過ぎると、数字の代わりに'('、'$'、'#'などのASCII文字が表示され始めます。 ?
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
entity counter is
port(clk: IN STD_LOGIC;
secs:OUT INTEGER RANGE 0 to 59);
end counter;
architecture counter_behav of counter is
signal countSVal: INTEGER RANGE 0 to 59:=0;
begin
process(clk)
begin
if(rising_edge(clk)) then
if(countSVal>=59) then
countSVal <= 0;
else
countSVal <= countSVal + 1;
end if;
secs <= countSVal;
end if;
end process;
end counter_behav;