I’m sure we have all seen 1’s and 0’s pictures like figure 1.1 in movies and TV shows. But what do those long strings of 1’s and 0’s mean? For my first tutorial we are going to answer the basics of this question. Learning binary will eventually lead us to more complex subjects like sub-netting, which is vital when working with networks. Understanding binary is more simple than most people believe, so let’s get into it.
What is Binary Anyways?
Computers today use electricity to work, it does this by changing states. Inside a microchip electricity can either be ON or OFF think light switch. The next step is to assign these two states a mathematical value. ON=1 and OFF=0, those values are called bits. For every 4 bits we call it a “nibble” (this is not commonly used, but it’s interesting) and for every 8 bits we call it a byte (commonly used). This is just the very basics, you can dive down many rabbit holes on this, but this is all the information you need to get started. The next step to understanding binary is seeing how our numbering system relates to binary.
Understanding Base 10.
An effective way to get a better grasp on binary is to understand how the numbering system we use every day fundamentally works. In base 10 we use ten symbols (0-9), but when we get to the number “10” we have to add a number to the left of our current digit, since we have ten symbols each new digit has to have a value 10x greater than the previous. For example, let’s say we have the number “239”, we will break it down into a chart (fig 1.2).
For our number “239” you can break it into three columns, one’s, ten’s and hundred’s. As you can see each column is 10x greater than the previous (10×1=10, 10×10=100). Our number can then be broken down into how many 1’s, 10’s and 100’s it has, as seen in the bottom row of the chart.
Base 2 and Conversion.
Now that we had a nice refresher on how the base 10 numbering system works, we can dive back into binary. If we call our numbering system “base 10” because we multiply by 10 to get to the next column. That means all we must do in binary is double the previous value to get to the next column. Let’s look at another table.
You should do yourself a huge favor and memorize the bottom row (fig 1.3), it will make the conversion process much faster for you.
As you can see in figure 1.3 starting at “0” each column is double its previous or 2^x where x=column value. Below are some examples with steps showing how the conversion process works.
Binary given: 0110 (fig 1.4)
- Since we are only using 4 bits we only need the place values of the first four columns.
- Ignore the value column if “0” think the light switch is OFF so its not in use. however use the value if it is “1” think light switch is ON.
- We are left with the values 4 and 2
- Add together (4+2) and we get our answer 6
Really easy! right? Let’s try another easy one to make sure.
Binary given: 01110 (fig 1.5)
- Five “1’s and 0’s” so we use 5 place values.
- Ignore “0” use “1”
- Left with 8,4,2
- Add and we get 14
Getting the hang of it? Next, we will use all 8 bits or one byte.
Binary given: 01100101 (fig 1.6)
Eight “1’s and 0’s” so we use 8 place values.
- Ignore “0” use “1”
- Left with 64,32,4,1
- Add and we get 101
That’s all there is to it, below are 5 more you can try!
| 11100101 | 10101110 | 00111011 | 11111100 | 10101011 |
After reading this hopefully you got to the point where you have the base 2 place holders (powers of 2) memorized, furthermore I hope you are now able to quickly see a string of binary and convert it to a base 10 number. I know binary seems boring and a lot of people get turned off because it is math, however learning this concept now will benefit you later. If you have any further questions or suggestions check out my “Contact page” and if you are curious about me or the site, head over to the “About” page.
Make sure to look out for my next tutorial on “Simple Hexadecimal”.
Sources: Binary image = https://cdn.techterms.com