saad
Advanced Member level 4
Dear all, I am an intermediate-level verilog programmer. I was out of touch with Verilg programming so not really sure whats wrong with the following piece of verilog code.
and the test bench:
when I simulate it using xilinx ISE 13.1,
a remains 'zz' for all the time
index remains 'z' for all the time
out remains 'x' for all the time
Variables do no change their value even once. What could be the possible problem?
Thanks in advanced
Saad
Code:
module single_bit(
input [1:0] a,
input index,
output out);
reg out;
always @ index
out = a[index];
endmodule
and the test bench:
Code:
module test_single_bit;
reg [1:0] a;
reg index;
wire out;
single_bit uut (
.a(a),
.out(out),
.index(index));
initial begin
#100
a = 2'b01;
index = 1'b0;
#100;
index = 1'b1;
end
endmodule
when I simulate it using xilinx ISE 13.1,
a remains 'zz' for all the time
index remains 'z' for all the time
out remains 'x' for all the time
Variables do no change their value even once. What could be the possible problem?
Thanks in advanced
Saad