-------------------------------------------------------------------------- Convert Hex to Decimal and Back Bulletin 9000 09/28/93 Copyright (C) 1992, Coastal Security Systems, Inc. All rights reserved. -------------------------------------------------------------------------- HEX = 0 1 2 3 4 5 6 7 8 9 A B C D E F -------------------------------------------------------------- DECIMAL = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HOW TO CONVERT HEX TO DECIMAL Place Value Total Value 1st None None 2nd 16 = 16 3rd 16 x 16 = 256 4th 16 x 16 x 16 = 4096 5th 16 x 16 x 16 x 16 = 65536 6th 16 x 16 x 16 x 16 x 16 = 1048576 Example: AB32h 2 1st place 2 = 2 3 2nd place 3 x 16 = 48 B 3rd place 11 x 256 = 2816 A 4th place 10 x 4096 = + 40960 AB32h = 43826 --------------------- HOW TO CONVERT DECIMAL TO HEX Example: 14855 14855 16 = 928.4375 .4375 x 16 = remainder of 7 928 16 = 58.0 0 x 16 = remainder of 0 58 16 = 3.625 .625 x 16 = remainder of 10 3 16 = 0.1875 .1875 x 16 = remainder of 3 14855 16 = 928 r 7 1st place 7 = 7 928 16 = 58 r 0 2nd place 0 x 16 = 0 58 16 = 3 r A 3rd place 10 x 256 = 2560 3 16 = 0 r 3 4th place 3 x 4096 = + 12288 3A07h = 14855 ---------------------