Go Down

### Topic: can you read or write 8 bits at once? (Read 3041 times)previous topic - next topic

#### Tom Carpenter

#15
##### Jan 01, 2013, 09:41 pmLast Edit: Jan 01, 2013, 09:43 pm by Tom Carpenter Reason: 1
I agree, once you get used to hex there is little need for binary.

For those that don't know, here is a little tip for Binary to hex conversion:

Take a binary number (works for any number of bits, but lets choose 13 to demonstrate):
Code: [Select]
`0b1101101101010`

Split it into groups of four bits starting from right to left
Code: [Select]
`   1   1011   0110   1010`

If there arent a multiple of four bits, then pad with zeros until there are (now you see why I chose 13)
Code: [Select]
`0001   1011   0110   1010`

Now convert each group into decimal [base 10] (you can skip this step when you get used to it)
Code: [Select]
`  1      11      6     10`

Now convert each group into hex [base 16]
Code: [Select]
`  1       B      6     A`

Code: [Select]
`0x1B6A`
~Tom~

Go Up

Please enter a valid email to subscribe