0123456789ABCDEF    0123456789ABCDEF    0123456789ABCDEF

What Is "Hexadecimal" ?

and

Where / How / Why is it used on Computers?

Copyright © 1996, 1999, 2000, 2002, 2004 by Daniel B. Sedory


All new Revision in 1999. Now contains an explanation of the use of Hexadecimal
for R - G - B colors as used in HTML for web pages ( Hexadecimal Colors in HTML )
( And a link to a combined free HEX <---> DECIMAL converter and HTML color coder! )




 Hexadecimal          Decimal    |  Hexadecimal     Decimal
-------------       -----------  |  ------------     -------
 0 through 9        0 through 9  |
                                 |  1D  (1 x 16) + 13 = 29 
      A   ( 9 + 1 = )    10      |  1E     "     + 14 = 30
      B   ( 9 + 2 = )    11      |  1F     "     + 15 = 31
      C   ( 9 + 3 = )    12      |  20  (2 x 16) +  0 = 32
      D   ( 9 + 4 = )    13      |  21     "     +  1 = 33
      E   ( 9 + 5 = )    14      |  22     "     +  2 = 34
      F   ( 9 + 6 = )    15      |  23     "     +  3 = 35
     10   (1 x 16) + 0 = 16      |  24     "     +  4 = 36
     11   (1 x 16) + 1 = 17      |  25     "     +  5 = 37
     12      "    +  2 = 18      |  26     "     +  6 = 38
     13      "    +  3 = 19      |  27     "     +  7 = 39
     14      "    +  4 = 20      |  28     "     +  8 = 40
     15      "    +  5 = 21      |  29     "     +  9 = 41
     16      "    +  6 = 22      |  2A     "     + 10 = 42
     17      "    +  7 = 23      |  2B     "     + 11 = 43
     18      "    +  8 = 24      |  2C     "     + 12 = 44
     19      "    +  9 = 25      |  2D     "     + 13 = 45
     1A      "    + 10 = 26      |  2E     "     + 14 = 46
     1B      "    + 11 = 27      |  2F     "     + 15 = 47
     1C      "    + 12 = 28      |  30  (3 x 16) +  0 = 48

 Hexadecimal          Decimal   Hexadecimal          Decimal
 -----------          -------   -----------          -------
     30    (3x16) + 0 =  48   |     100    (1x256) =    256
     40    (4x16) + 0 =  64   | *   200    (2x256) =    512
     50    (5x16) + 0 =  80   |     400    (4x256) =   1024
     64    (6x16) + 4 = 100   |     500    (5x256) =   1280
 *   7F    (7x16) +15 = 127   |     800    (8x256) =   2048
     80    (8x16) + 0 = 128   |     A00   (10x256) =   2560
     90    (9x16) + 0 = 144   |     FFF                4095
     9F    (9x16) +15 = 159   |    1000   (1x4096) =   4096
     A0   (10x16) + 0 = 160   |    4000   (4x4096) = 16,384
     B0   (11x16) + 0 = 176   |    5000   (5x4096) = 20,480
     F0   (15x16) + 0 = 240   |    8000   (8x4096) = 32,768
 *   FF   (15x16) +15 = 255   | *  FFFF              65,535
So, what does a Base 16 number system have to do with a machine that's based ( pun intended ) on zeros and ones?

_____________________
*Perhaps you've heard of the file COMMAND.COM (it's the kernel for the MS-DOS 7.1 Operating System on a Windows™ 98 Boot Disk). Well it's really an .EXE program! Microsoft® simply felt it had to retain the same name for this file, most likely for compatibility reasons; it hasn't been a real .COM file since Windows™ 95 came out. A true .COM program can never be more than 64 KiB in size, and does not begin with the letters "MZ" (which you'll find at the beginning of this COMMAND.COM file and all other .EXE files).




A Quick Look at the Amazing History of Computers

Over half a century ago, hot, room-sized machines built with vacuum tubes and relays were already using the same concepts we still use today to carry out instructions on numbers stored as "bits" (Binary digits) in structures known as registers. Today, even our hand-held programmable calculators could blow away those old computers in speed if not in results (number of digits). And the registers have shrunk from the size of handfuls of light bulbs to a space so tiny you need an electron microscope to see it; yet they still continue to add, subtract and compare bits by the same logical methods that were already known long before even those now archaic machines could have been built.

Programs were often stored and fed into those first computers from patterns of holes punched into a roll of paper tape. This idea came from an earlier device called the teletypewriter, which used a seven-bit code called ASCII to send alphanumeric data over wires. Essentially this same bit code or expansions upon it, such as Unicode, are still used to store data on a PC. Designed for communications, the original code included control characters to signal the start of, success, failure, and end of transmissions. The ASCII code 7, was used to ring a real bell at a distant station, thus it is often abbreviated as "bell" in an ASCII chart. Programs now use it to beep a computer's speaker!

Some of the 33 control codes used decades ago, such as ASCII 8 (a Backspace), 10 [0Ah] (a Line Feed), and 13 [0Dh] (a Carriage-Return) are still fairly close to their original meanings, while others were so "device dependent" that modern day equivalents no longer exist.

Seven bits gives us a total of 128 different codes in the standard ASCII character set. That's 64 + 32 + 16 + 8 + 4 + 2 + 1 or 127, plus the zero.
At a much later date, companies such as IBM® and Apple® introduced Extended ASCII character sets.

The revolution in electronics which made home computing possible came about when integrated circuit companies, such as Motorola®, Intel®, Rockwell® and Zilog®, began mass producing 8-bit microprocessors in the early Seventies. The Motorola® MC6800 series made the loveable little Apple™ computers an instant success, and the Zilog® Z-80 made the Tandy® (Radio Shack) TRS-80 a very common product. Finally, in 1979, Intel's 4.77MHz 8088 chip (a 16-bit CPU with only an 8-bit bus) found a home inside the original IBM® Personal Computer [Note: The Intel 8086, with a full 16-bit bus, had already been produced in 1978, but IBM considered it too expensive to use for their first PC project.]  In 1984, IBM introduced it's AT (Advanced Technology) series PC based on Intel's 80286 CPU. That computer, made by the 'business' company of IBM, is most likely what convinced many managers and CEOs that Microcomputers would soon become the future of computing in the business world. (Well, that and the fact that further technological advances allowed PCs to be "Networked" together through server machines! Once they became widely used in large businesses, the PCs tended to cause data which had only been stored in the tape libraries of main-frame computers to become distributed among "workstations" as they're now called; rather than just being "dumb" terminals that had to access what some still thought of as a "real computer" in order to do something useful.)

A Few Details about the IBM PC and Microsoft

Instead of making its own Disk Operating System, IBM® paid a little software company to put together a DOS for their new IBM Personal Computers. But, IBM did not pay for exclusive rights to any future uses of this DOS. And when that little company (called Microsoft®) made some changes and started selling MS-DOS to anyone, it wasn't long until a flood of "AT clones" and "IBM - compatibles" spread across the globe! Microsoft and Intel® made a fortune selling the essential software and hardware that made up a PC, but IBM simply acted like its usual "big blue" self over the losses in home and small business sales. I'm sure that IBM now wishes they had done things differently, but perhaps that's what they deserved for making a calculated decision to promote Microsoft's DOS instead of an 8086 version of CP/M by Gary Kildall (which later became Digital Research DOS). And in spite of what you may read elsewhere, Gary never 'lost out' to Bill Gates due to any personal differences or missed meetings! It was simply a business decision by IBM; which appears to have been done on purpose since IBM's DOS could only be used on their machines, whereas Gary's OS was almost machine independent. It's a little known fact (these days) that IBM actually licensed both DOS and CP/M-86 for their PC, but you had to special order CP/M-86 rather than having it come at a much lower price with most PCs as IBM's DOS did; that was clearly a business decision on the part of IBM!


Bits, Bytes, Characters and Words


Binary:  | 2048 1024 512 256 | 128 64 32 16 | 8 4 2 1 | = 1111 1111 1111
  HEX :  |       256's       |     16's     |   1's   | =   F    F    F 
--------------------------------------------------------------------------
Computing      (15 x 256)    +  (15 x 16 )  +   15
 Decimal          3840       +     240      +   15      =    4 0 9 5
equivalent
=========================================================================
Binary: |2048 1024 512 | 256 128 64 | 32 16 8 | 4 2 1 | = 111 111 111 111
 OCTAL: |    512's     |     64's   |   8's   |   1's | =  7   7   7   7 
--------------------------------------------------------------------------
Computing ( 7 x 512 ) +  ( 7 x 64 ) + (7 x 8) +   7
 Decimal     3584     +     448     +    56   +   7     =    4 0 9 5
eqivalent
=========================================================================
 F F F h  =  7 7 7 7  Octal  =  4 0 9 5 (Decimal).
   FAD7(hex) =  1 1 1 1  1 0 1 0  1 1 0 1  0 1 1 1
   D37E(hex) =  1 1 0 1  0 0 1 1  0 1 1 1  1 1 1 0
               ------------------------------------
 ANDing gives:  1 1 0 1  0 0 1 0  0 1 0 1  0 1 1 0
   the Answer:     D       2        5       6
     (in hex)

 

                                			  HTML TAG Name
 <font color="#FF0000">  RED   </font>  (RED)
 <font color="#00FF00"> GREEN  </font>  (GREEN)    LIME
 <font color="#0000FF">  BLUE  </font>  (BLUE)
 <font color="#FFFF00"> YELLOW </font>  (YELLOW)
 <font color="#FF00FF"> VIOLET </font>  (VIOLET)  FUCHSIA
 <font color="#00FFFF">  CYAN  </font>  (CYAN)     AQUA



Copyright ©1996,1997,1999,2000,2002,2003,2004 by  Daniel B. Sedory
 < Online reply form here >

Revised on November 7th, 2003.
Last Update: 25 OCT 2004.


 

Back to " The Starman's Realm " Index Page