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
 

Shurik

Full Member level 3
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 !!!
 

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

echo47

Advanced Member level 6
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.
 

    shiv_emf

    Points: 2
    Helpful Answer Positive Rating

Shurik

Full Member level 3
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 !!!!
 

    shiv_emf

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top