what will the following verilog code generate?

Status
Not open for further replies.

shivams

Junior Member level 1
Joined
Feb 13, 2010
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
pune
Activity points
1,361
always@*
begin
if en
y=a;
else
z=b;
end
 

by selector u mean mux? but code has 2 outputs
 

if en what's z's value. and if not ,what's y's value, it is not complete?

Added after 8 minutes:

u can try it through Quartus RTL viewer.
 

shivams said:
always@*
begin
if en
y=a;
else
z=b;
end

This will infer a latch for y and z,

e.g.
always @*
begin
if (en)
y = a;
end

always @*
begin
if (~en)
z = b;
end

HTH
 

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