Labels

Thursday, February 23, 2017

Binary and Hexadecimal Number Systems

In one of my many Workshops at GCE called Math Problem Solving, we were given the freedom to research and follow any challenging math concept we wanted. This workshop was new and very special in the sense that we were given the responsibility to keep track of our own work and go at our own pace. For my topic, I chose to learn about binary and hexadecimal (hex) number systems because I am majoring in computer science next year.

When I first started my research, I chose to learn the basic concepts of binary. This meant learning how the number system is structured, how to convert it to base 10 or hexadecimal, and how to add, subtract, and divide in binary. My most valuable resource was Kahn Academy. They have many videos on binary and hex and different things you can do with them. This video gave me my basic understanding of binary:


Basically, when learning about number systems, the most important thing to look at is place value. If you look at base 10 (what we use), you see that the first place value is 1s, then 10s, then 100s, and so on. It is called base 10 because each place value is a power of ten. The 1s are 10 to the 0th power because that equals 1, the 10s are 10 to the 1st power because that equals 10, the 100s are 10 to the 2nd power because that equals 100, and so on. If we look at the number 251 in base 10. By looking at the place value, you see that we have 2 "100s", 5 "10s", and 1 "1s". Add those together and you get 251.

 Both binary and hex are very similar. For binary, the only numbers we can use is 1 or 0. Also, the place value for each place one of those numbers can go changes. Another word for binary is base 2. In base two, each place value is two to the power of a number rather than ten to the power of a number in base ten. So, the first place is still the 1s because 2 to the power of 0 equals 1. But, the next place is the 2s place because 2 to the power of 1 is two. Then, the third place is the 4s place because 2 to the power of 2 is 4. Just like base ten, the places go on and on like this infinitely. Since binary only has the numbers 1 or 0, each place value can only have 1 or none of said value. To look at an example, if we had the number 1011 in binary, you'd covert it to base 10 like so: In the 1s place we have 1 so that is one 1. In the 2s place we have a 1 so that is one 2. In the 4s place we have a 0 so we have zero 4s. In the 8s place we have a 1 so that is one 8. Add that together and you get (1x1)+(1x2)+(0x4)+(1x8)=11. So, 1011 in binary equals 11 in base 10. 

Hexadecimal is very easy once you understand the basics of place values in the number system. Another name for hexadecimal is base 16. So, hex uses 16 numbers. However, we are used to the base 10 system where we only have 10 numbers (0,1,2,3,4,5,6,7,8,9). In hex, the numbers we use are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. While this seems confusing, the letters that follow the numbers correspond to numbers that we see in base 10. A=10, B=11, C=12 and so on. Also, since hex operates in powers of 16, the place values are 1s, 16s, 256s, 4096s and so on for infinity. As an example, if we had the number 6A4 in hex, you'd convert it to base 10 as follows: In the 1s place we have 4 so thats 4 ones. In the 16s place we have A so we have eleven 16s. In the 256s place we have 6 so we have six 256s. Add everything together and you get (4x1)+(16x10)+(256x6)=1700. So, 6A4 in base 10 equals 1700.

As for applications of these concepts, I learned in my research that binary is used mostly in computers and are the way that computers carry out their operations. In computer circuits, something is either on or off. Thus, in binary, 1 stands for on and 0 stands for off.

No comments:

Post a Comment