shaiko
Advanced Member level 5
I wanted to divide my system clock's frequency by a factor of eight.
Didn't want to use a counter so I decided to use a series of 3 T flip flops.
This is my code :
After I wrote this code I took a look and thought : both "clock_divide_two" and "clock_divide_four" ( marked in red ) are assigned the same signal.
What do you think about it ?
will the signal "clock_divide_eight" have the system clocks frequency divided by 8 ?
or will it only be divided by 4 ?
Didn't want to use a counter so I decided to use a series of 3 T flip flops.
This is my code :
Code:
dividing_the_clock_by_eight : process ( CLOCK , RESET ) is
begin
if RESET = '0' then
clock_divide_two <= '0' ;
clock_divide_four <= '0' ;
clock_divide_eight <= '0' ;
elsif rising_edge ( CLOCK ) then
[COLOR="#FF0000"]clock_divide_two <= not clock_divide_two ;[/COLOR]
[COLOR="#FF0000"]clock_divide_four <= not clock_divide_two ;[/COLOR]
clock_divide_eight <= not clock_divide_four ;
end if ;
end process ;
After I wrote this code I took a look and thought : both "clock_divide_two" and "clock_divide_four" ( marked in red ) are assigned the same signal.
What do you think about it ?
will the signal "clock_divide_eight" have the system clocks frequency divided by 8 ?
or will it only be divided by 4 ?