who can explain this question for me?

Status
Not open for further replies.

dolby.yang

Member level 4
Joined
Mar 2, 2005
Messages
73
Helped
10
Reputation
20
Reaction score
2
Trophy points
1,288
Activity points
1,862
hi:who can explain this question for me?
Q: Given the following snipet of Verilog code,
draw out the waveforms for clk and a

always @(clk) begin
a = 0;
#5 a = 1;
end

A:

10 30 50 70 90 110 130
___ ___ ___ ___ ___ ___ ___
clk ___| |___| |___| |___| |___| |___| |___| |___


a ___________________________________________________________


This obviously is not what we wanted, so to get closer, you could use
"always @ (posedge clk)" instead, and you'd get

10 30 50 70 90 110 130
___ ___ ___ ___ ___ ___ ___
clk ___| |___| |___| |___| |___| |___| |___| |___

___ ___
a _______________________| |___________________| |_______


Thank you!
 

the answer is not correct.
you can simulate it.
 

ok,thanks a lot.i will try to sim it .
i see this Q from h**p://grumpytom.com/Interview_Questions/questions.html
.
 

description is not clear, simulate it then you can find the result is wrong
 

u should enter the right syntex.
yr syntex is wrong.
 

in alway ,it is a good habit to use "<="
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…