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.

What is value of Var1 after the following assignment? (Verilog)

Status
Not open for further replies.

abhineet22

Advanced Member level 4
Joined
Jan 25, 2005
Messages
105
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
bangalore
Activity points
1,017
What is value of Var1 after the following assignment ?


reg Var1;

initial begin

Var1<= "-"

end
 

Re: program of verilog?

Interview question I guess :) .........
It is rather simple here the '-' sign does not denote any value .Remember that in verilog the valid values are only 1,0,X,Z . So when you assign "-" . this is treated as a string and then the ascii value of this "-" is taken which is 2D is hex. The '0' bit value of "-" is ascii is then assigned to the variable . I hope I have answered your question .
 

Re: program of verilog?

Var1 will be "-"'s ASCII character value

best regards



abhineet22 said:
What is value of Var1 after the following assignment ?


reg Var1;

initial begin

Var1<= "-"

end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top