
A time ago I came across a piece of code intended to perform a bit reversing operation ( swapping the most significant bits toward less significant bits, and vice-versa ), but it seemed that would not work, like if one would superimpose the value of the other. Is it correct ?
Code:
for(i=0;i<8;i=i+1)
begin
a_temp<=a[7-i];
a[7-i]<=a[i];
a[i]<=a_temp;
end
end