I am trying to set a hex value to a variable and then convert that value to bits. I then need to set a value to another variable with the reverse bits.
x = 0x13fa
Converted, this would equal (not accurate, but for arguments sake):
0001 0011 1111 1001
I need to convert this to:
1001 1111 1100 1000
I am having trouble with the conversion. I've been trying to use a loop like y = x<<15. y = y + x<<14, etc. but this is not working.
Please help with some advice and/or code. Explanations would really help, as I would like to learn this.
Thanks so much.