Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- Hi Mustapa, I can't understand what is the problem: duplicate or extend what you have already done for a single LED. If I correctly understand what you ask is quite straightforward. Anyway, you'd better try to write some code and post it if you have issues. You'll hardly receive help here in the forum if you simply ask someone to write all the code for you. --- Quote End --- Hi Cris, thank you for replying to me. What i want to do is to have the second LED to light on right after the first LED lights off, yes its quite straightforward. I know i need another comparator for the second PWM signal but i dont know how to make the second signal to start instantaneously after the first signal become '0', below is the code for my first comparator with a count modulus of 100 and clock divider frequency of 100MHz. Library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity comparator is port( q, b : in std_logic_vector( 6 downto 0); c : out std_logic); end comparator; architecture body3 of comparator is begin process (q, b) begin if (q<= b) then c<='1'; else c<='0'; end if; end process; end body3; if i make changes like this to the code for the second comparator, begin if (c<=1) then c2<='0'; else if (q<= b) then c2<='1'; would it be correct?