1. Home
  2. Computing & Technology
  3. Java
photo of Paul Leahy
Paul's Java Blog

By Paul Leahy, About.com Guide to Java

Java Term of the Week: Hexadecimal

Saturday September 27, 2008

The past two terms we've looked at were about the denary and octal numbering systems. Now it's the turn of hexadecimal. It differs from the previous two systems by using a combination of digits and letters to represent numbers, and by having a base of 16.The digits and letters used are 0,1,2,3,4,5,6,7,8,9 and A,B,C,D,E,F.

It follows the same rules as the other two except that once you get to 9 it starts to use letters (i.e., A=10, B=11, C=12, D=13, E=14, F=15). To make it easier to understand think back to denary, the number 30 is the same as saying 3 x tens + 0 x ones. In hexadecimal, because it has a base 16, it's 1 x sixteens + 14 x ones, which is 1E. The trick is to remember that 14 in hexadecimal is represented by "E".

Hexadecimal surpassed octal numbers as a compact way to represent binary numbers. The reason being that four bits can go from 0000 (i.e., zero) to 1111 (i.e., 15) which matches one hexadecimal digit perfectly, 0 (i.e., zero) to F (i.e., 15). Therefore to represent a byte (8 bits) all that's needed is two hexadecimal digits.

Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore Java
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Java

©2009 About.com, a part of The New York Times Company.

All rights reserved.