hannachifaten
Member level 2
- Joined
- May 1, 2013
- Messages
- 44
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,769
Hello every one ,
i write an example of toggling led , the synthese is check but when i tried to see the simulation in the board that is not done ,
my card has up to 250 MHZ i convert this to get toggling led in every 500 ms , i show you the programme , any help please ,
i want to add a switch which i command the led but usually i didnt see the toggling led
entity main is
port (
clk:in std_logic;
--SW0:in std_logic;
led1ut std_logic;
led2ut std_logic
);
end main;
architecture Behavioral of main is
signal counter: std_logic_vector(32 downto 0) := (others =>'0');
signal bit1:std_logic :='0';
signal bit2:std_logic :='0';
begin
timer_processrocess(clk)
begin
-- if SW0 ='1' THEN
if rising_edge(clk) then
if (counter(31 downto 0) = "1001010100000010111110010000000") then --count upto 250M
led1 <= bit1;
led2 <= bit2;
counter <= (others =>'0') ;
bit1 <= not bit1;
bit2 <= not bit2;
else
counter <= counter+1;
end if;
end if;
--ELSE
-- led1 <= '0';
-- led2 <= '0';
--end if ;
end process;
end Behavioral;
i have doubt to the value of counter is very large perhepes :sad: any suggestion please !!
i write an example of toggling led , the synthese is check but when i tried to see the simulation in the board that is not done ,
my card has up to 250 MHZ i convert this to get toggling led in every 500 ms , i show you the programme , any help please ,
i want to add a switch which i command the led but usually i didnt see the toggling led
entity main is
port (
clk:in std_logic;
--SW0:in std_logic;
led1ut std_logic;
led2ut std_logic
);
end main;
architecture Behavioral of main is
signal counter: std_logic_vector(32 downto 0) := (others =>'0');
signal bit1:std_logic :='0';
signal bit2:std_logic :='0';
begin
timer_processrocess(clk)
begin
-- if SW0 ='1' THEN
if rising_edge(clk) then
if (counter(31 downto 0) = "1001010100000010111110010000000") then --count upto 250M
led1 <= bit1;
led2 <= bit2;
counter <= (others =>'0') ;
bit1 <= not bit1;
bit2 <= not bit2;
else
counter <= counter+1;
end if;
end if;
--ELSE
-- led1 <= '0';
-- led2 <= '0';
--end if ;
end process;
end Behavioral;
i have doubt to the value of counter is very large perhepes :sad: any suggestion please !!