我在quartusii11.0中新建vhdl程式,怎麼進行模擬,就是能看到模擬波形呢?
再新建一個激勵檔案。可以是波形激勵檔案。然後儲存,模擬即可。
並行語句放在程序外面
library ieee;
use ieee。std_logic_1164。all;
use ieee。std_logic_arith。all;
use ieee。std_logic_unsigned。all;
entity test is
port(clk,clr: in bit;
y: out integer range 0 to 11);
end test;
architecture rtl of test is
signal temp: std_logic_vector(3 downto 0);
begin
process(clk,clr,temp)
begin
if clr=‘1’ then
temp<;=“0000”;
elsif clk‘event and clk=’1‘ then
if temp=“1011” then
temp<;=“0000”;
else
temp<;=temp+1;
end if;
end if;
end process;
y<;= 0 when temp=“0000” else
1 when temp=“0001” else
2 when temp=“0010” else
3 when temp=“0011” else
4 when temp=“0100” else
5 when temp=“0101” else
6 when temp=“0110” else
7 when temp=“0111” else
8 when temp=“1000” else
9 when temp=“1001” else
10 when temp=“1010” else
11;
end rtl;