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.

wht will output for this verilog code

Status
Not open for further replies.

shiv_emf

Advanced Member level 2
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
 

Hello!!!
Cannot use in one always the blocking assignment and nonblocking assignment together!!


a=0 !!!
 

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=??
 

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.
 

    shiv_emf

    Points: 2
    Helpful Answer Positive Rating
a will display "0" always !!!!
 

    shiv_emf

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top