Was my college book wrong?

Status
Not open for further replies.

Yolkz

In Runtime
Messages
169
I was reading my homework when it was showing a example of converting binary to hexadecimal...now it says 01100011 you would break into 2 nibbles 0110 and 0011 it says the hexidecimal value of the first nibble would be 6 which I agree with. Then it says the second niblle 0011 would be B which I dont agree with wouldnt it be 3? Becuase 2+1 = 3 not 11 correct?


Sorry if this is the wrong fourm it was kinda tricky to choose a spot to put this.
 
Absolutely--what you said!

You'd think when paying so much for these books...well, I don't know about that one specifically, but in general...:mad:

If you don't mind me asking, what class is this? :D
 
Intro to personal computers. First day of class and we had to read chapter one and I sat there figuring out all the examples to make sure I understood it and I came across that one and was like no theres no way this can be right.
 
I've never heard of converting an 8 bit binary number to Hex by splitting it to nibbles first. I've always done the entire 8 bits.

First to answer your question, yes, 0110 would be six and 0011 would be 3, which would make your whole byte as 9. However, for both of those nibbles to calculate out that way they would have to be 00000110 and 00000011 in their full byte form, respectively.

How I've always done it -
01100011 is equal to decimal 99.
Now, 16 goes into 99 six even times with three remaining (calculation done in decimal).
16 * 6 = 96 OR 99 / 16 = 6 R 3
Next, we need to convert three decimal to three hex, which is easy.
3(dec) = 3(hex)
our Hex is now $63
01100011 = 99 = $63

for all intents and purposes, you can run this through a calculator. To check many scientific calculators come with the ability to convert number. On windows, calc.exe comes with the ability, just change the view from standard to scientific. Please observe significant digits

Apologies for not having the direct binary to hex conversion process. This method (binary to decimal to hex) has always been the easiest for me.
 
I've never heard of converting an 8 bit binary number to Hex by splitting it to nibbles first.
One hex digit represents four binary digits, which is why some learn this method. It's actually much easier this way.

First to answer your question, yes, 0110 would be six and 0011 would be 3, which would make your whole byte as 9.
Intuitively, it seems like you should add the 6 and the 3, but that would yield the wrong answer, as you pointed out. Instead, using this method, you just concatenate the 6 and the 3. Thus, the answer is 63h, which is the same result you calculated.
 
Status
Not open for further replies.
Back
Top Bottom