Nov 5, 2006 #1 S shiv_emf Advanced Member level 2 Joined Aug 31, 2005 Messages 605 Helped 22 Reputation 44 Reaction score 6 Trophy points 1,298 Activity points 4,106 Given the following verilog code, What value of "a" is displayed ? always@(clk)begin a=0; a<=1; $display(a); end
Given the following verilog code, What value of "a" is displayed ? always@(clk)begin a=0; a<=1; $display(a); end
Nov 5, 2006 #2 Shurik Full Member level 3 Joined Jul 15, 2004 Messages 166 Helped 16 Reputation 32 Reaction score 4 Trophy points 1,298 Activity points 842 Hello!!! Cannot use in one always the blocking assignment and nonblocking assignment together!! a=0 !!!
Hello!!! Cannot use in one always the blocking assignment and nonblocking assignment together!! a=0 !!!
Nov 5, 2006 #3 S shiv_emf Advanced Member level 2 Joined Aug 31, 2005 Messages 605 Helped 22 Reputation 44 Reaction score 6 Trophy points 1,298 Activity points 4,106 well ....... I want output nt ur views !! its posible to write tht code n ... or may b it cant be synthesiable .. but ths nt da issue .. Wht will be the value of a ......... a=??
well ....... I want output nt ur views !! its posible to write tht code n ... or may b it cant be synthesiable .. but ths nt da issue .. Wht will be the value of a ......... a=??
Nov 5, 2006 #4 E echo47 Advanced Member level 6 Joined Apr 7, 2002 Messages 3,933 Helped 638 Reputation 1,274 Reaction score 90 Trophy points 1,328 Location USA Activity points 33,176 Shurik already said the correct answer. Assuming "a" is a register ... After each clock edge: a is set to 0, then a is displayed, then a is set to 1. Remember that a<=1 schedules the assignment for the end of the time step. For more info, see IEEE Std 1364-2005, section 9.2.2, Example 1.
Shurik already said the correct answer. Assuming "a" is a register ... After each clock edge: a is set to 0, then a is displayed, then a is set to 1. Remember that a<=1 schedules the assignment for the end of the time step. For more info, see IEEE Std 1364-2005, section 9.2.2, Example 1.
Nov 5, 2006 #5 Shurik Full Member level 3 Joined Jul 15, 2004 Messages 166 Helped 16 Reputation 32 Reaction score 4 Trophy points 1,298 Activity points 842 a will display "0" always !!!!