| 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, 65 guest(s) and 0 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 |
lshj98115 Senior


Joined: Sep 06, 2006 Posts: 24
|
Posted: Sun Nov 23, 2008 10:08 pm Post subject: how to check duty cycle? |
|
|
| Is there a system task that can check the duty cycle? |
|
| Back to top |
|
 |
lshj98115 Senior


Joined: Sep 06, 2006 Posts: 24
|
Posted: Mon Nov 24, 2008 7:42 am Post subject: |
|
|
malvika:
I think your suggestion is unresonable.
how can you get the duty cycle check by limiting the minimum value ?
| malvika10 wrote: | $period can be used to check the timeperiod voilation
$width can be used to check the high time and low time voilation.
if both are used will give you sort of duty cycle voilation check. |
|
|
| Back to top |
|
 |
alexg Senior

![]()
Joined: Jan 07, 2004 Posts: 586 Location: Ottawa
|
Posted: Mon Nov 24, 2008 9:47 am Post subject: |
|
|
Here is an example of duty cycle check:
| Code: | module test;
reg clk = 0;
always #10 clk = ~clk;
time rise, fall;
integer duty;
always @(clk) begin
if (clk) rise <= $time;
else begin
fall <= $time;
duty = ($time - rise)*100/($time - fall);
if (duty < 45 | duty > 55)
$display($time, " Duty cycle error, d = %0d", duty);
end
end
initial #100 $finish;
endmodule
|
-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
|
| |
|
|