| | |
Need to separate 16 bit binary to 4bit and 12 bit binary values
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Solved Threads: 0
Hi Martin,
Your code for shifting the bits is working for me.
The crux of my problem was to extract the 4 MSB as a 4bit nibble ( values deciphered to be 0 to 15 ) and remaining LSB as a 12 bit integer, from the the 16 bit value.
Your entire code is doing the job well from joining the 2 byte values at the start to giving me the 4 and 12 bit values appropriately at the end.
BTW I had to make a change at line to get proper results ( *256 instead of *255 )
12. sumBytes = byteA * 256 + byteB
Thanks a ton.
Your code for shifting the bits is working for me.
The crux of my problem was to extract the 4 MSB as a 4bit nibble ( values deciphered to be 0 to 15 ) and remaining LSB as a 12 bit integer, from the the 16 bit value.
Your entire code is doing the job well from joining the 2 byte values at the start to giving me the 4 and 12 bit values appropriately at the end.
BTW I had to make a change at line to get proper results ( *256 instead of *255 )
12. sumBytes = byteA * 256 + byteB
Thanks a ton.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Bind ListBox to ADODB.Recordset
- Next Thread: Need your opinion:
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





