AAB - Binary System (Lesson)
Binary System
Binary Numbering System - Base 2
Understanding base 10 allows us to quickly understand the binary number system, a system of 0's and 1's, the language of the internet. Binary is base 2 so the only values allowed are 0 and 1, all of the natural number values less than the base. The base is 2, so the place values are made up of exponent powers of 2 beginning with zero versus the exponent powers of 10 in the decimal system.
|
Binary Numbering System - Base 2 |
|
||||||
---|---|---|---|---|---|---|---|---|
Place Value |
128 |
64 |
32's |
16's |
8's |
4's |
2's |
1's |
Baseexponent |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
How Many |
0 |
0 |
1 |
2 |
0 |
5 |
2 |
6 |
Math |
0 * 128 |
0 * 64 |
1 * 32 |
0 * 16 |
0 * 8 |
1 * 4 |
1 * 2 |
1 * 1 |
Add these up |
39 in decimal |
|
32 |
0 |
0 |
4 |
2 |
1 |
Note the similarity in the table structure. Now look at the first line of the "Math" row. There are 8 numbers starting with two zeros. The binary number does not need the zeros in the front, but the byte that travels across the internet does. A byte is made up of 8 bits, the individual 8 ones and zeros in the top row of the math column. These 8 bits when interpreted as a binary byte are 00100111 (often shown for readability as 0010 0111). The binary number 0010 0111 is 39 in the decimal number system. The byte is the package that travels the internet.
So how is conversion from decimal to binary accomplished? Let's convert the decimal number 142 to the binary number system. An algorithm to convert any decimal to binary number is needed.
You have now created a detailed algorithm, a method of organized steps to solve the problem of changing 142 decimal into a binary number. Do you see a pattern that could be generalized so that a method is available that works for any decimal to binary conversion? Review the solution above and reflect prior to looking at the answer. Programming is about thought process, thinking logically, and to do so, you must practice, so it is good to get in the habit.
What if we have a binary number, how do we get back to a decimal number? Suppose the binary number is 0100 1101, what is the decimal number?
Now you have created a second generic pseudocode (language of what to do) and provided the algorithm detail (math and other needs) to solve the problem.
Practice!
Binary to Decimal Conversion Video
Watch the video on Binary to Decimal Conversion below for a better understanding.
BINARY CONVERSION VIDEO USED ACCORDING TO TERMS OF USE ACCORDING TO SOURCE Links to an external site..