Invert bits binary

hello good, I wanted to be able to change the order of the bits for their correct reading.
When I want it to get a 1 in binary, it represents it to me in the following way

Sin título

What I wish is for it to be positioned correctly as follows.

0000000000000001

What you have is correct. Bit 0 (array element [0]) is 1

BIT  1    1
     5432109876543210
VAL  0000000000000001

If you must, then look at array reverse

Additionally, if you want it as a bit string, then call join("") on the array....

image

↑ obviously that was reversed first.

image

I got it in the following way. I have created a function to invert the bits

image
image

Thanks for your interest

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.