| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
| Who's Online | There are currently, 64 guest(s) and 1 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
naajila Senior


Joined: Nov 30, 2010 Posts: 30
|
Posted: Wed Mar 09, 2011 11:27 am Post subject: Generation of clock |
|
|
I want to create one Monitor which recieves a clock1 from RTL.
Again i have to reciev eone more signal x from RTL .When x becomes 1, "data" has to be collected at both posedge as well as negedge of clock1.
x may come at any time (either at posedge or negedge or in middle of these edges of clock1)..When it comes 1,immediately at next edge(may be posedge or negedge) i have to collect data.
So i want to generate one more clock clk2 in my monitor whcih has the time period exactly half of clock1.
My intension to generate clk2 ::: To collect the data always at posedge of clk2 so that i dont have any confusion of posedge or negedge of clk1.
Can anybody write a logic to generate this clk2 and it should be in synchronization with clk1.? |
|
| Back to top |
|
 |
alexg Senior

![]()
Joined: Jan 07, 2004 Posts: 586 Location: Ottawa
|
Posted: Wed Mar 09, 2011 1:43 pm Post subject: |
|
|
Not sure why you need a second clock.
This code may be sufficient for your needs:
| Code: | always @(clk1) if(x) begin
d1 <= data;
@(clk1) d2 <= data;
end |
-Alex |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|