March 31st – Hexadecimal

As I look back on the previous post I’ve done, I look to January 31st when I geeked out about binary and different number systems.  I did it because 31 was 00011111 and a little trick I teach my students to read binary numbers quicker.  Binary is a Base 2 number system and there are dozens, if not hundred’s, or other number systems out there – but not all of them are used.  Hexadecimal is commonly found in colors when designing for the web and often confusing for students, but it can also be a lot of fun when you get to a certain level of abstraction.

March 31st – Hexadecimal

Deci-mal is a base 10 system, numbers are read from right to left, smallest to largest and you have the tens place, then hundreds place, thousands place moving over one spot to the left each time. Bi-nary is Base 2 with a ones place, then 2 moving left, then 4 moving left, then 8 moving left.  Both of these systems can also be viewed in powers of 10 and 2 respectfully.  Binary moves to the left when we have too many for the ones place (in binary it’s 2, so 1 is the highest digit in the 1’s place – hence the 1’s and 0’s), and Decimal moves left when we have too many for the ones place (in decimals case = 10, so the single digit 9 is the highest number in the 1’s place).  What happens when two digits isn’t the highest value in the “1’s” place?

Screen Shot 2016-04-01 at 11.21.42 AM
Decimal to Binary to Hexadecimal – What to do with 2 digits in the 1’s place?

Hexadecimal is a Base 16 number system, meaning that the “1’s” place goes up to 16 (15 as the highest number) before moving to the left and taking up the “16’s” place – much like the “10” in decimal when you add “1” to “9”.  but we can’t have two digits in the “1’s” place.  So we start using letters. “A” represents 10, “B” represents 11, “C” is 12 and so on until “F” represents 15.  So in Hexadecimal, the letter “f” is 15… mind blown.  2f is equal to 47 in decimal (2 16’s = 32 + 15 (f) = 47).

You’ll see hexadecimal values often in colors on the internet which are RGB (red, green, blue) and values can range from 0 to 255 which is equal to FF in hexadecimal (15 16’s (15 x 16) = 240 + 15 1’s = 255).  Why 255 for red, green and blue?  having the available combinations of 0-255 for each of these colors gives the outrageous number of 16,777,215 color combinations.  Here is a great hexadecimal page to play around with the colors.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s