What will be the output of this verilog code Any Idea ?

Status
Not open for further replies.

shethpurak

Junior Member level 1
Joined
Nov 15, 2005
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,399
reg Var1;
initial begin
Var1<= "-"
end
In
 

I'm not sure. A reg can only be a 1, 0, X or Z, so I'm not sure what assigning it to a "-" will do. May depend on the simulator.
 

I believe that Var1 will be assigned bit 0 of the 8 bit ASCII value of the character -. The simulator or the synth. tool should give a warning about truncating.
 

it is mostly simulator dependent.

I ran got it to be 1
 

it is mostly simulator dependent.

It should not be simulator dependent.
It will take ASCII value and assign LSB bit to Var1.
 

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