How do you set up a right shift or left ........ doing an infinite loop?
like for example,
the hex 0x55 which is equal t
o 0101 0101 in binary
now i want to shift the value of 0x55 to 1 to the right
so its
Code:
int value;
value = value >> 1;
then that changes the binary value to
0010 1010
then another shift will make it
0001 0101
whats happening here is it is shifting to the right but its not going back to the other side. Im triying to figure out how can i make this code in a loop like:
1010 0000 = form 1
0101 0000
0010 1000
0001 0100
0000 1010
0000 0101
1000 0010 in here the bit 1 goes back to the other side
0100 0001
1010 0000 now its back to form 1