Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 68974

How to choose bits from a hexadecimal number?

$
0
0

I have a list of hexadecimal number (one column with 'n' rows). Let the list be named 'A'. Each hexadecimal number in A, after conversion to Binary, I need to choose 9 bits from the Right end (d0, d1, d2 ..d8) and label as X. Then the next consecutive 9 bits (d9,d10,...d17) and label as Y. I want to do this for all the 'n' elements in A and put it in separate X and Y columns. Can anyone help me to do this? Thanks a lot.

 

Example:

Suppose a=11110000111100000111110000 is binary form of the first element in A. Then, I want to choose bits so that, X=111110000 (bits from the right end of a) and Y=111100000 (the successive 9 bits). I don't care the rest of the bits towards left. In A, I have 'n' number of elements (a1, a2, a3,...an). I want to do this for all and make a list of X and Y (two separate columns).


Viewing all articles
Browse latest Browse all 68974

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>