- Welcome Guest |
- Publish Article |
- Blog |
- Login
Intro
If you are studying for CCNA or Network+ certification, you will have to be able to do Binary and Hexadecimal number conversions without the use of a calculator. This article discusses why we use binary math in comuters, some commonly used terms that are related to binary, and then outlines how to do binary conversions.
Computer Math Terms
Bits, Bytes, Megs, Gigs...... You undoubtedly have heard these terms. Just turn on your television and wait until the next Dell or HP ad comes on. What does it all mean? As humans, we have all adopted the decimal notation system 0 - 9. But, when computers were first created, there needed to be a much simpler way of addition. "Why" you may ask? Computers operate off electricity and the easiest way to communicate with electricity is "on" or "off".
Binary
The simplest unit in binary math is called a Bit. The bit can have only one of two values, 1 or 0. A group of 8 bits is called a Byte (I think the creator of binary math must have been hungry.) When written down, the most significant bit is on the left and the least significant bit is on the right. What this means is that number's value increases when you add more places to the left. Take decimal as an example: the first digit can be any number from 0 - 9. When you reach 10, the second digit(most significant) becomes a one and the first digit (least significant) starts again at 0. However, in binary, each bit can only be 0 or 1. So if you want to get to 2 you have to add another bit 10. I know it kind of looks like decimal 10, but it is actually decimal 2. This is why it is important to understand which notation you are in. Decimal 10 is actually 1010 in binary. A neat little trick to remember is that if the last bit is 0, the number is even. If it is 1, the number is odd.
Just like in decimal we have "benchmarks" when we reach larger numbers, so there are in binary. Even though the bit is technically the smallest unit in computing, we usually use the byte as the smallest number. One byte is 8 bits in length. A Kilobyte is 1,000 bytes and a Megabyte is 1,000,000 bytes. Gigabytes are in the Billions. Computers now hold Terabytes or more of information. That's 1 Trillion bytes!
Converting Decimal into Binary
When converting decimal into binary, it is easier if you draw out a chart for the powers of 2 starting from right to left. For example an 8-bit number would look like this:
128 64 32 16 8 4 2 1
Let's say we want to know what 110 would look like in binary. We would first divide 110 into 128 to see if we get 0 or 1 (ignore the remainder). We do not want 2 because in binary, each place can only be either 1 or 0.
110/128 = 0 this is our first bit
then we would subtract 0 from 110 and divide the answer into the next number. in this case 110 - 0 is still 110 so:
110/64 = 1 this is our second bit subtract 64 from 110 = 46
46/32 = 1 subtract 32 from 46 = 14
14/16 = 0
14/8 = 1 14-8 = 6
6/4 = 1 6-4 = 2
2/2 = 1
Then once you subtract down to zero with no remainder, fill in the rest with zeros. Once you place the ones and zeroes in your chart, you get 01101110.
Converting Binary to Decimal
To go the other way, you would still use the chart, but fill in the binary number underneath. Let's use a binary 11000101 as an example:
128 64 32 16 8 4 2 1 (chart)
1 1 0 0 0 1 0 1 (plug in the number)
This is the easy part. Only where there is a 1, write down the number above it in the chart. Write them down underneath each other and add them together.
128
64
4
1 +
197 is the decimal equivalent!
IP Addresses
IP addresses are where you will be using these type of conversions most often as a Network Professional. This is because, often it is necessary to segment larger IP addresses into subnets. An IP address is a 32-bit address broken down into four 8-bit octets separated by decimals. Commonly, they are shown in dotted-decimal notation because it's easier for us to think in decimal. This just means it looks like this: 192.168.1.1
Since each octet has only 8 bits (hence the term octet) there are a total of 256 numbers which can be assigned to the octet 0 - 255 (don't forget, 0 is a value too). Written out as binary, that number would look like this: 11000000101010000000000100000001
Wrap Up
I hope this has been helpful to those of you studying for your Network+ or CCNA exams. Of, course, you would probably use a calculator to do the conversions, however, you will not have a calculator in the exam room with you so you have to feel comfortable doing the conversions on paper or in your head.
Remember that computers only know Binary. Binary numbers are a string of 1s and 0s that correspond electrical signals which have significance to computers. binary is considered a base 2 number system which means that there are only two possible values for each place in a binary number. The most significant bit is written as the left-most bit and the least-significant is on the right.
Remember how to convert binary to decimal and decimal to binary as you will need to do this for the exam without a calculator. IP addresses are 32-bit numbers written in 8-bit octet dotted-decimal notation.
Article Views: 3030 Report this Article