On 15 May 2005 12:41:59 -0700,
(jo) wrote:
>I need to make a vga controller but I have a problem.
>The clock is 48 Mhz,so i have to divide it by two to have 24 Mhz for
>640 by 480 pixels.
>but the clock input should be the real clock 48 Mhz en there's also an
>enable input and by this input we can get the correct(needed)
>frequency of 24 MHz.
>I don't know how to do this and how this exactly works,but it has to
>be done this way,maybe somebody can write a little bit code for me?
>Are explain howthis thing works.
>thanks a lot!!
Should it be something like this?
architecture PreScaler of PreScaler is
signal Qint: STD_LOGIC_VECTOR(26 downto 0);
begin
process (CLK, RESET)
begin
if RESET = '1' then
Qint <= (others => '0');
elsif Clk'event and Clk='1' then
if CEI = '1' then
if Qint = 1 then
Qint <= (others => '0');
else
Qint <= Qint + 1;
end if;
end if;
end if;
end process;
CEO <= '1' when Qint = 1 else '0';
end PreScaler;
Next, you should map port CEO to CE in your design.
--
Lukasz Z.