Well, this is some extra notes from the previous chapter.
In the last chapter we know how to convert binary to decimal, octal to decimal, and hexadecimal to decimal. But we still don't know how to convert it the other way back, so we're going to learn it now.
It is fairly simple. First of all, you must know what is DIV and MOD.DIV is division whilst MOD is modulus in mathematic. But what are they? If we did a division operation, we'll get two numbers, the result and the remainder. The result is the one which is called DIV and the remainder is the one which is called MOD. To make it easier, let's just go to an example.
5/2 = 2 with a remainder of 1. -- DIV=2 MOD=1
9/6 = 1 with a remainder of 3 -- DIV=1 MOD=3
15/16 = 0 with a remainder of 15 -- DIV=0 MOD=15
Got it?
Ok now let's move to the real thing.
To convert a decimal into another numeral system we must divide that decimal by the numeral system's base number until the DIV is 0 and then arrange the MOD from the last up to the first. For example, I'll put 123 in decimal into another numeral system.
Decimal to Binary
Binary's base number is 2 so we'll have to divide 123 by 2 until the DIV is zero:
123/2 gives DIV=61 MOD=1
61/2 gives DIV=30 MOD=1
30/2 gives DIV=15 MOD=0
15/2 gives DIV=7 MOD=1
7/2 gives DIV=3 MOD=1
3/2 gives DIV=1 MOD=1
1/2 gives DIV=0 MOD=1 --- And that's it
Now arrange the MOD --- 1111011
So 123 in decimal is 1111011 in binary.
Decimal to Octal
Octal's base number is 8 so we'll have to divide 123 by 8 until the DIV is zero:
123/8 gives DIV=15 MOD=3
15/8 gives DIV=1 MOD=7
1/8 gives DIV=0 MOD=1 --- And that's it
Now arrange the MOD --- 173
So 123 in decimal is 173 in octal.
Decimal to Hexadecimal
This one is a bit complicated however it's still as easy as the others.
To do this we must first remember that in hexadecimal we use the first six alphabets.
That makes 10 is A, 11 is B, 12 is C, 13 is D, 14 is E and 15 is F. So if we get more than 9 in MOD we must change it into those letters.
Hexadecimal's base number is 16 so we'll have to divide 123 by 16 until the DIV is zero:
123/16 gives DIV=7 MOD=11 (B)
7/16 gives DIV=0 MOD=7 --- And that's it
Now arrange the MOD --- 7B
So 123 in decimal is 7B in hexadecimal.
Now we know how to change decimal into another numeral systems.
But what about converting binary to hexadecimal, binary to octal, hexadecimal to binary and octal to binary.
The simplest way is to convert it into decimal and convert it again.
But is that the only way? How about converting it directly to its target?
That's easy.
As we know, hexadecimal's base number is 16, and 16 is 2^4. So to convert binary to hexadecimal we'll need to separate it into groups of four. Then just follow this chart:
0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = A
1011 = B
1100 = C
1101 = D
1110 = E
1111 = F
Let's just take the number from the previous example. We have 1111011 in binary. What is it in hexadecimal?
That number only has 7 digits. In that case, separate into groups of four, we need to add a 0 in front of it. So it's 01111011 now.
0111 1011
0111=7 and 1011=B.
So it's 7B in hexadecimal. It's correct, isn't it?
Converting it back is just as simple as that. Just follow the chart and you'll make it correct. The same rules applied to octal. Just try to figure it out on your own.
And that concludes the first chapter. Next we'll be moving to the machine (microprocessor).
If this guide confused you, feel free to contact me.
Published by Spygon
University Student View profile
Gaining Weight - the Nutrition (Part I)Gaining muscle and weight is one of the hardest and the most frustrating things for many people today. Use this three part series to learn how to manage your nutrition, exercise...- Finding Part-Time EmploymentPart-time employment is a practical means for everyone from teens to retirees to earn an income. The reasons people choose to work part-time vary; they may attend school, want to spend more time with their family, o...
- What's in a Number?Why does the media emphasize the age of an actor at his death? What is the relevance of age? What does it mean in our lives? What is in an age,a year,a number?
- The 900 Number - TelecommunicationsIn order for our local phone companies to be ethically and morally correct, I would recommend the board of directors of a local phone company that we make courtesy calls once a consumers phone bill reached over $100.0...
- New Theories on Language Shed Light on the Nature of Music
- Programming Assembly Language - Part 1
- Medicare Part A Primer
- Best Part of the News is Those Wacky Headlines
- The Benefits of Working Part Time
- Tips to Part Your Hair for Sexy Styles
- What You Need to Know Before Choosing or Switching Medicare Part D Programs



