Hex

Peter Gargano peter at ntserver.techedge.com.au
Mon Nov 8 10:51:04 GMT 1999


To understand hex you first have to understand how
decimal works (a lot of people don't!)

The number 354 (decimal) is 

      354 = (  300        +   50     +   4   )
      354 = (3 * 100)     + (5 * 10) + (4 * 1)
      354 = (3 * 10 * 10) + (5 * 10) + (4 * 1)

The position of the digits gives their weight. Each
extra decimal digit to the right is worth 10 times more.
Hexadecimal (or Hex) uses a base or 16, not 10.  So the
number 77a (hex) is, using all hex numbers...

      77a = (   700       +   70     +  a    )
      77a = (7 * 100)     + (7 * 10) + (a * 1)
      77a = (7 * 10 * 10) + (7 * 10) + (a * 1)

but remember each 10 above is hex 10 which is decimal 16,
and the "a" above is decimal 10, so we can rewrite in 
this in decimal on the right hand side

    0x77a = (7 * 16 * 16) + (7 * 16) + (10 * 1)
          = (7 * 256)     + (7 * 16) + 10
          = 1792          + 112      + 10
          = 1914

Geoff Richards wrote:

> 77a =1792 multiplied ( I cant find times key ) by 112 
> multiplied by 10 = 2007040 decimal ?

So, you were almost correct, just substitute the "multiplied by"
with "added to", and you get the correct answer.

regards,
-- 
Peter Gargano



More information about the Gmecm mailing list