Sunday, September 20, 2020

Binary Conversions



The conversion of numbers is common in mathematics and has been used for many generations.  During the creation of computers number conversion became even more common and necessary.  Although once the internet came about and allowed sharing data the ability to convert these numbers became a bit easier for the end user.  There are many ways of which you can convert numbers between number bases, and it is fairly simple in doing so. 
Although it may be simple it can seem just a bit confusing at first.  Remember as an adult you have been using base 10 since you were a child, even though it may not seem like it.  For example, base 10 is simply numeric values from 0 to 9, but since we do not have a single digit to express 10 like the romans "X" then we add 1 to the tenth place and zero out the ones place.  As another example, when you are adding 1 to 19, the 1 is technically added to the tenths place and the ones column is zeroed out.
Now that we have the basic concept of base 10 understood, let's take a look at base-two which is also known as binary.  Just as we use base 10 regularly throughout our lives as mentioned above, base 2 "binary" is very similar.  Instead of the highest digit being a 9 and when a 1 is added it rounds to 10, with binary the highest digit is 0 so when a 1 is added it rounds to one.  This is caused by there being no single digit for two in binary. 
With the two first bases described and understood we can now discuss conversion from base 10 to base 2 (binary) and back again.  Our first base 10 number being five, base ten converted to binary.  Start off with dividing the desired base such as two into the number we want to convert.  This division will require we use remainders like we did when we were all in elementary school.  If we take the 2 from base 2 and divide it into 5 that gives us 2 R 1, then we divide the 2 by 2 again, which gives us 1 R 0, then we divide the 1 by 2 which gives us 0 R 1.  Leaving us with the following remainders 1,0,1.  Thus being the binary conversion of 5 base 10 equals 101 base 2.
Converting base 10 back to binary almost seems a bit simpler, but it takes a keen eye to understand it.  I will use our previous numbers to make it a bit easier to understand.  Our binary number is 101 base 2 which can be listed as, (1x 22) + (0x21) + (1x20) = (1x4) + (0x2) + (1x1) = 4 + 0 + 1 = 5.  Now after reviewing this how did I manage to turn 101 to the equation above?  The digits 101 times two to the place power and add.
When converting a binary number to a decimal has similar rules that apply.  I will use the previous binary number of 101 that we used above.  Now for each number we have a list of power of two, for example 22 , 21, 20 which is 4,2,1.  Take these numbers and plug them in (4x1)+(2x0)+(1x1) = (4)+(0)+(1) = 5.  This method is simply going backwards from base 10 to binary and binary back to base 10.
Considering binary is base 2 and hexadecimal is base 16 and they are both powers of 2 this is a simpler conversion than binary to decimal.  Since hexadecimal numbers can either be numbers of 0-9 or even characters A-F, you can convert binary strings to hexadecimals.  First off you need at least a four digit binary number.  We will start with 1010 and add a "small number" to the top right of each digit a different power of 2, signifying their place as so, 180412 01.  This tells you how many of each number you have, which turns to 8020.  Now you can add the four numbers together as so, 8+0+2+0= 10.  All in all the binary number 1010 would convert to 10 which is an A in the hexadecimal system.
It is extremely important to be able to convert numbers and truly understand the numeric conversion methods.  All information and data is sent and stored in binary.  If an IT professional is unable to convert numbers as mentioned, then it would be more difficult to troubleshoot and decode many necessary parts of the IT world.  Also, if becoming a system programmer the ability to easily convert these numbers and translate them in their heads would allow them to easily understand the system.  This is definitely important if you would like to be able to code in assembly or machine code.
 
References
Binary to Decimal Conversion. (n.d.). Retrieved February 5, 2017, from Electronics Tutorials: http://www.electronics-tutorials.ws/binary/bin_2.html
Bogomolny, A. (n.d.). Implementation of Base Conversion. Retrieved February 5, 2017, from Cut the Knot: http://www.cut-the-knot.org/recurrence/conversion.shtml
Englander, I. (2014). The Architecture of Computer Hardware, Systems Software, & Networking An information technology approach. Don FowleY.

No comments:

Post a Comment

Binary Conversions

The conversion of numbers is common in mathematics and has been used for many generations.   During the creation of computers number co...