|
-
October 5th, 1999, 02:05 AM
#1
Combining And Splitting Bytes
I have two bytes (8 bits each) I need to combine these into one interger. And then split the top 12 bits into one integer and the bottom 4 bits into another integer.
i.e A = 0xFE
B = 0x03
First step combine two bytes: = 0xFE03
binary - 11111110 00000011
then split -------- ----++++ - = top 12 bits, + bottom 4 bits
then store seperatly
so one integer equals 0000111111100000
and the other equals 0000000000000011
Sorry it is hard to explain, please help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|