priyanka24
Advanced Member level 4

Hi......
me facing problem in my coding.
everything syntax was correct but in simulation output 'o' is getting as 'XXXX' i.e unknown.
so plz tell me what i should do for that???????????
my code is as follows::
module runcount(i, o, addr);
input [7:0] i;
input [3:0]addr;
output [3:0]o;
reg [3:0]o;
integer count=0;
integer j;
reg [3:0] mem_bank [0:7];
always@(i)
begin
for(j=7;j<=0;j=j-1)
begin
if(i[j]==0)
begin
o=o+1;
end
else
begin
mem_bank[addr]=o;
end
end
end
endmodule
me facing problem in my coding.
everything syntax was correct but in simulation output 'o' is getting as 'XXXX' i.e unknown.
so plz tell me what i should do for that???????????
my code is as follows::
module runcount(i, o, addr);
input [7:0] i;
input [3:0]addr;
output [3:0]o;
reg [3:0]o;
integer count=0;
integer j;
reg [3:0] mem_bank [0:7];
always@(i)
begin
for(j=7;j<=0;j=j-1)
begin
if(i[j]==0)
begin
o=o+1;
end
else
begin
mem_bank[addr]=o;
end
end
end
endmodule