Computersight > Programming

Hexadecimal and Binary Code

Do you want to talk like a computer? Do you like programming codes? Are you interested in either binary code or hexadecimal? If there is a yes to any of these, than this is for you.

Do you want to talk like a computer? Do you like programming codes? Are you interested in either binary code or hexadecimal? If there is a yes to any of these, than this is for you!

The Basics of Hexadecimal

So just like other numbers, I will first tell you how to count in hexadecimal, the digits will be separated by

" | "

So you will understand more readily:

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F

and the last one is

1|0

the last one is just one number not two, there are only 16 numbers in hexadecimal

Hexa = Six
Deci = Ten

...and 10 plus six is 16, so now you know how it was named, or why they only have 16 numbers. the last is broken up like this: 1|0, in which the "1" stands for one set of sixteen, and the "0" stands for zero sets of one, like a decimal place, but in sets of 16 instead of sets of 10, there is a term for that, it is called using "Base 16", decimals use a "Base 10" method. Here is a table of Hexadecimal compared to Decimal, on a count to 30.

Decimal-Hexadecimal

  • 1-1
  • 2-2
  • 3-3
  • 4-4
  • 5-5
  • 6-6
  • 7-7
  • 8-8
  • 9-9
  • 10-A
  • 11-B
  • 12-C
  • 13-D
  • 14-E
  • 15-F
  • 16-10
  • 17-11
  • 18-12
  • 19-13
  • 20-14
  • 21-15
  • 22-16
  • 23-17
  • 24-18
  • 25-19
  • 26-1A
  • 27-1B
  • 28-1C
  • 29-1D
  • 30-1E

The Hexadecimal Pattern

You may see a pattern, if you don't, then no sweat I will guide you through it. See the reason because "1E" represents "30" because there is "1" set of 16, and "e" (as from above it for 14) which adds up to thirteen! So in hexadecimal you could put a " . " in between the two numbers, and the left side you times by sixteen, and the right is times by one, then add the two results, now was that hard? Hopefully now it isn't.

The Basic of Binary

So as before lets count, but binary is similar to decimal and different in hexadecimal in at least one way: In binary there aren't a limit of digits. They can go as far as the numbers they represent. So I will limit the counting to 30:

Decimal Binary

  • 1-1
  • 2-10
  • 3-11
  • 4-100
  • 5-101
  • 6-110
  • 7-111
  • 8-1000
  • 9-1001
  • 10-1010
  • 11-1011
  • 12-1100
  • 13-1101
  • 14-1110
  • 15-1111
  • 16-10000
  • 17-10001
  • 18-10010
  • 19-10011
  • 20-10100
  • 21-10101
  • 22-10110
  • 23-10111
  • 24-11000
  • 25-11001
  • 26-11010
  • 27-11011
  • 28-11100
  • 29-11101
  • 30-11110

The Binary Pattern

The pattern is a doubling system, the number farthest to the right in a binary number is one, the one to the left of that is two, the left of that is four, the left of that eight, then 16, and so on, it will just keep on doubling, and whether you put a one or a zero depends on the number if it is odd then there has to be a one in the farthest right, as I will explain later. Let's use “10010” as the example, you should tell right off the bat it's even, since the last zero. Trailing zeros are important, leading zero's do not even exist in binary. So “1001” is different from “10010”, and “01001” is not binary, if it is, then someone messed up. So let's examine the example above, which is “10010.” So the numbers go in order from right to left, which is one of the ways to decipher binary, 1-2-4-8-16, but if you read left to right, in the order the numbers of bi nary goes it would be “16-8-4-2-1” and this is the other way the decipher it, but you need to know that first number which depends on the number of numbers, or how many “ 1 ”s and “ 0 ”s there are. The easiest it the second one, and the least work is the first. So it depends if you can grasp the concept of the first, because if you can then I would stick with it, because binary can be millions of those ones and zeros, so less work is good, but if you don't then you can just count the total of ones and zeros, then minus one then that number, just for ease of working with will be a variable called “A.” so then you'll put that “A” as exponent of two, so it would be two the exponent of A (2A). Which lets just give an example again, lets make “A” a number so lets make A, 14, so it would be 2^14 on your calculator, or in mathematics that would be 2 to the power of 14, or 214. That would be the first number and divide by two to get the next number. So the A being 14 will be the example, here would be the sequence of numbers:

16384-8192-4096-2048-1024-512-256-128-64-32-16-8-4-2-1

so you can se how it can easily become very high numbers, to prove it lets see the range of numbers a 14 digits binary code can be in numbers: 16,384-32,767 that is a large range, that is because the first number is the range, because the largest would be one less than the next digit's value (32,768) And this is how you computer talks, in binary! Well, until next time, bye.

2
Liked It
I Like It!
Related Articles
Teaching HTML to Middle School Students  |  3D Engine Construction and Design Workshop: Lesson 2 - Getting out of Console
Comments (0)
Post Your Comment:
Name:  
Copy the code into this box:  
Post comment with your Triond credentials?
Inside Computersight

Communication & Networks

 /

Computers

 /

Hardware

 /

Operating Systems

 /

Programming

 /

Software


Popular Tags
Popular Writers
Powered by
Computersight
About Us
Terms of Use
Privacy Policy
Services
Submit an Article
Advertise with Us
Contact

© 2007 Copyright Stanza Ltd. All Rights Reserved.