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.

Verilog simple but bit confusing

Status
Not open for further replies.

balan

Member level 2
Joined
Feb 18, 2007
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,518
Let me know the output of this program

module tb;
reg [15:0] a;
initial begin
a=28'hff00;
$display("a = %h",a);
$display("a = %0h",a);
$display("a = %7h",a);

end
endmodule
 

whether the result which i get is expected.

1st display
ff00
2nd display
ff00
3rd display
ff00

Is that correct
 

The reg a is 16 bit, but the assignment is a = 28'h ff00 (assigned as 28 bit).

In the display we have given as $display("%7h",a)

I expect the value to be
000ff00.

Please let me know does %7h has any effect.
 

There must be something wrong with your answer.
you can simular with modelsim and you can see de result are:

1st display
ff00
2nd display
ff
3rd display
___ff00 (_means Space bar)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top