Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

binary hexdecimal

Apr 21, 2015 6:34AM PDT

Hi, I'm trying to work this binay number out but I can't.
Problem :
I have this binary number 0111000010000010 which is 16 bits 2 byts.

However I can't figure how this 16 bits 2 byts is broken down and segmented.

I know that this binay number will give bits values of:

3278, 16384, 8092, 4096, etc but I don't know how you get these numbers.

guys any solutions ??? I hope you guys can help!!

Discussion is locked

- Collapse -
Answer
Re: binary
Apr 21, 2015 6:47AM PDT

Binary is not the same as hexadecimal. So your subject line is strange.

Now about that number. You start at the back. Then you get
0 * 1 = 0
1 * 2 = 2
0 * 4 = 0
0 * 8 = 0
Then add the (decimal) numbers after the equal sign and you get 0010 (start at the bottom) = 2.

With 5 digits it's:
0 * 1 = 0
1 * 2 = 2
0 * 4 = 0
0 * 8 = 0
1 * 16 =16
So you get 10010 = 18.

I leave it to you to extend this to 16 lines for a 16-bit unsigned number.

It's a nice spreadsheet-exercise to break down a string of 16 zeroes and ones into A1 to A16, have the constants 0,2,4,8,16,.32,64 and so on in B1 to B16, calculate the outcome of the multiplications in C1 to c16 and sum that array into the decimal value of the 16 bit binary value you entered somewhere in another cell.

Kees

- Collapse -
Answer
0111 0000 1000 0010 = 70 82
Apr 21, 2015 7:41AM PDT

That's hexadecimal, you just break the binary code into 4 bit clusters. It's normally used in dumps, places like the registry, and for representing text characters internally. Of course inside the computer everything is represented in binary bits (zeros and ones), it's just the way it's used that determines whether it's meant to be a number or a character. And of course if it's a number, there's pure binary and floating point, the latter being used in scientific calculations.
`And remember:
Hexadecimal hits the spot,
16 bits is quite a lot,
twice as much as octal too,
hexadecimal is the byte for you!

`
Happy computing.