thank for your respond gmpstr..this is 1st time using Quartus II..actually what I want to do is to make a traffic light controller..let me explain my code..(for my opinion it should do as follows)..there are 4 trafffic lights..and it should be work in sequential order..1 to 4 and back to 1..
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
(g, y, r is for green, yellow, and red..there will be four each of them..
1 to 4..1 is the 1st traffic light and 4 is the last traffic light..)
entity allT is
port(g, y, r : buffer std_logic(1 to 4);
clk : in std_logic);
end allT;
architecture behav of allT is
(this signal I made here is for the delay part)
signal d, q : std_logic;
signal gL : std_logic_vector(1 to 16);
signal yL : std_logic_vector(1 to 4);
component delay
port(D, clk : in std_logic;
Q : out std_logic);
end component;
begin
process(r, clk, x)
begin
if (clk'event AND clk = '1') then
d <= '1';
(here i use the CASE statement to look at red light to on the green light)
case r is
when "0111" =>
g <= "1000";
when "1011" =>
g <= "0100";
when "1101" =>
g <= "0010";
when "1110" =>
g <= "0001";
when others =>
null;
end case;
(this part is to make the green light on for 15 clock cycle)
for gL in 1 to 15 loop
greenL : delay port map (d, clk, q);
gL <= gL + 1;
end loop;
(after 15 clock cycle..the green light will be off)
case r is
when "0111" =>
g <= "0000";
when others =>
null;
end case;
(and its time for the yellow light to on)
case r is
when "0111" =>
y <= "1000";
when "1011" =>
y <= "0100";
when "1101" =>
y <= "0010";
when "1110" =>
y <= "0001";
when others =>
null;
end case;
(on for 3 clock cycle)
for yL in 1 to 3 loop
yellowL : delay port map (d, clk, q);
yL <= yL + 1;
end loop;
(after 3 clock cycle the yellow light will be off)
case r is
when "0111" =>
y <= "0000";
when others =>
null;
end case;
(this part will on 3 red traffic light and off one red traffic light)
case r is
when "0111" =>
r <= "1011";
when "1011" =>
r <= "1101";
when "1101" =>
r <= "1110";
when "1110" =>
r <= "0111";
when others =>
null;
end case;
end if;
end process;
end behav;
:D ..hmm..thats it..my traffic light that i think it should work as i think..:o