Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

dividing the clock by 8

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
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 :

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 ?
 

You will get the system clock divided by 2. "clock_divide_eight" will just be an inverted version of "clock_divide_two".
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top