我有下面的代碼來計數到59.它開始罰款,但31後,開始顯示ASCII字符像'(','$','#'等,而不是數字。任何想法,我要去哪裏錯了?計數器的輸出顯示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;
VHDL用於定義硬件。它被芯片設計師使用。 – 2009-03-07 23:41:33