sp
Full Member level 6
- Joined
- Jan 1, 2004
- Messages
- 395
- Helped
- 23
- Reputation
- 46
- Reaction score
- 2
- Trophy points
- 1,298
- Location
- Floating Garden
- Activity points
- 4,044
i write the VHDL clk divide code... and i hav some doubt on it... hope someone can help me...
my question is like tht.... the code is as follow...
and everytime i run compilation using the different N the hardware used on my FPGA doesnt change... i tot changing N would increase the counter flip flop used... doesnt it?....i used N = 2 and N = 25Mega... the hardware used also is the same...
wad actually is the hardware used to divide the clock?.... flip flops?...counter??
the hardware resources used is shown bellow... all N wth the same resources used...
my regards,
sp
my question is like tht.... the code is as follow...
Code:
library ieee;
use ieee.std_logic_1164.all;
entity clk_div is
generic(N: positive:= 2);
port
(fast_clk, reset: in std_logic;
slow_clk: buffer std_logic
);
end clk_div;
architecture behavioural of clk_div is
begin
process(reset, fast_clk)
variable count: natural;
begin
if reset = '1' then
count := 0;
slow_clk <= '0';
elsif rising_edge(fast_clk) then
count := count + 1;
if count = N then
slow_clk <= not slow_clk;
count := 0;
end if;
end if;
end process;
end behavioural;
and everytime i run compilation using the different N the hardware used on my FPGA doesnt change... i tot changing N would increase the counter flip flop used... doesnt it?....i used N = 2 and N = 25Mega... the hardware used also is the same...
wad actually is the hardware used to divide the clock?.... flip flops?...counter??
the hardware resources used is shown bellow... all N wth the same resources used...
my regards,
sp