#### gsbkbharath

##### Newbie level 4

*[j] into a temporary variable n which is the intensity of that pixel.Then it has to increment the nth bit of the hist vector by 1 so that at the end the vector hist has the requires histogram values.But the loop is RUNNING FOREVER.Can someone help with this please?*

always@(posedge clk)

begin

for (i=0;i<=2;i=i+1)

begin

for (j=0;j<=2;j=j+1)

begin

n = in

always@(posedge clk)

begin

for (i=0;i<=2;i=i+1)

begin

for (j=0;j<=2;j=j+1)

begin

n = in

*[j];*

hist[n] = hist[n]+1'b1;

end

end

endhist[n] = hist[n]+1'b1;

end

end

end