Hexadecimal to Decimal

Since last week we did a thing with Binary, why not we try the same thing with Hex. Info about hex:

  • There are 16 digits to choose from.
  • Digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f.
  • The letters translated into decimal are a=10, b=11, c=12, d=13, e=14. f=15.
  • Each number can be represented as a sum of 16^x where x is the 16's place the digit is in.
  • Sometimes represented with 0x in front of the digits.

Running with examples like last week, here we go:

  • 0x3c
  • 3*(16^1) + c*(16^0)
  • 3*(16^1) + 12*(16^0)
  • 3*(16) + 12(1)
  • 48 + 12
  • 60
This entry was posted in tips and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *