cancel
Showing results for 
Search instead for 
Did you mean: 

binary digits

id
Active Participant
Active Participant

binary digits

I have a 32 BIT Binary word in which I want to pull out BITS 26-21 and a few others from the word to decode it.  Do I have to convert it to string or is there a function like get substring for this 32 BIT number?
1 REPLY 1
RavensFan
Knight of NI

Re: binary digits

You can use number to boolean array, then index the bits of interest out of the array.

 

You could also use boolean logic.  If you want bit 3, you could AND it with 8  (2^3) and you will have effectively masked off all the other bits and showed the one of interest.  Then you can see if that number is 0 (for false) or 8 (for true).