我需要生成的16位...我的延遲是不工作來產生所需的圖案..... 也是我的for循環無法正常延遲 工作領導模式,就像我需要幫助,使用流來genrate模式任何沒有。有點使用延遲...... ????使用Vhdl ...生成碼型?
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counters_1 is
port(CLK : in std_logic;
Q : out std_logic_vector(2 downto 0);
led_out : out std_logic_vector(15 downto 0));
end counters_1;
architecture archi of counters_1 is
signal tmp: std_logic_vector(2 downto 0) := "000";
begin
process (CLK)
begin
-- variable i :Integer :=0;
-- variable j :Integer :=0;
if (CLK'event and CLK='1') then
tmp <= tmp + 1;
if(tmp="100") then
tmp <="000";
end if;
end if;
if(tmp="00") then
loop1: for i in 0 to 10 loop
led_out <="0000000000000001" ;
led_out <="0000000000000010" ;
end loop;
end if;
if(tmp="01") then
loop2: for i in 0 to 10 loop
led_out <="1111111100000000";
led_out <="000000001111111" after 500 ms;
end loop;
end if;
if(tmp="10") then
loop3: for i in 0 to 10 loop
led_out <="0011000000000101";
led_out <="0000000111000110" after 500 ms;
end loop;
end if;
if(tmp="11") then
loop4: for i in 0 to 10 loop
led_out <="0000001100000111" after 500 ms;
led_out <="0000000000001000" after 500 ms;
led_out <="0001001000001000" after 500 ms;
led_out <="0000000000001000" after 500 ms;
led_out <="0100001100000111" after 500 ms;
led_out <="0000000000001000" after 500 ms;
led_out <="0010001000001000" after 500 ms;
led_out <="1000000000001000" after 500 ms;
led_out <="0001001100000111" after 500 ms;
led_out <="0000000000001000" after 500 ms;
led_out <="0011001000001000" after 500 ms;
led_out <="0000000000001000" after 500 ms;
led_out <="0100111100000111" after 500 ms;
led_out <="0000011110001000" after 500 ms;
led_out <="0010001000001000" after 500 ms;
led_out <="1000001110001000" after 500 ms;
end loop;
end if;
end process;
Q <= tmp;
end archi;
這是否需要綜合? – Thanushan
像這樣的延遲是不可綜合的。你最好的選擇是創建一個基於計數器的狀態機。 – N8TRO