balan
Member level 2
basics of verilog
module Top;
reg[3:0] r;
initial begin
r = 4'b1110;
$display(" r = %b ", r);
$display("(3'b01x ? 4'b01xz : r) = %b ", (3'b01x ? 4'b01xz : r));
$display("(3'b01x ? 4'b01xz : 4'b0000) = %b ", (3'b01x ? 4'b01xz : 4'b0000));
$display("Both values should be identical: 01xz");
end
enmodule.
Can anyone suggest what would be the output of the above example.
module Top;
reg[3:0] r;
initial begin
r = 4'b1110;
$display(" r = %b ", r);
$display("(3'b01x ? 4'b01xz : r) = %b ", (3'b01x ? 4'b01xz : r));
$display("(3'b01x ? 4'b01xz : 4'b0000) = %b ", (3'b01x ? 4'b01xz : 4'b0000));
$display("Both values should be identical: 01xz");
end
enmodule.
Can anyone suggest what would be the output of the above example.