Problem with simple VHDL piece of code
- From: Jaco Naude <naude.jaco@xxxxxxxxx>
- Date: Thu, 12 Jul 2007 11:18:18 -0700
Hi all,
I'm wondering if any VHDL expert out there can tell me why the
following piece of code isn't working. It should be a simple clock
divider, enabling the CE signal on every counter'th pulse. However the
counter increase line counter := 1+ counter does not increment the
variable. If I change the 1 to for example 20 it stays 20 throughout
the simulation. I'm sure the input signals are correct... Any
suggestions would be helpful.
Thanks,
Jaco
=================================
begin
process (clk)
variable counter : integer :=0;
begin
if (clk'event and clk = '1') then
counter_out <= counter;
if rst <= '1' then
counter := 0;
ce_out <= '1';
end if;
if start <= '1' and rst <= '0' then
if counter < counter_top + 1 then
ce_out <= '0';
counter := 1 + counter;
else
counter := 0;
ce_out <= '1';
end if;
else
ce_out <= '1';
end if;
end if;
end process;
end Behavioral;
==================================
.
- Follow-Ups:
- Re: Problem with simple VHDL piece of code
- From: Jonathan Bromley
- Re: Problem with simple VHDL piece of code
- From: Mike Treseler
- Re: Problem with simple VHDL piece of code
- From: Frank Buss
- Re: Problem with simple VHDL piece of code
- Prev by Date: Re: Using logical operators on parameterized-length vectors
- Next by Date: Re: Problem with simple VHDL piece of code
- Previous by thread: Code for programming Flash memory
- Next by thread: Re: Problem with simple VHDL piece of code
- Index(es):