|
Hexadecimal ConversionsTo take all of this information with you, download our HTS PDA Tools. It's free and we throw in the source code! To see a list of our other reference materials click here or one of the buttons in the left hand column.
Note that the calculator that comes with the Microsoft Windows operating system can do conversions. To use the calculator click on Start, Programs, Accessories, Calculator. Then change the calculator to "Scientific" mode by clicking on View and then Scientific. Now you should see option buttons for Hex, Dec, Oct (Octal), and Bin (Binary). To convert 1234 Hex to decimal you would "clear" the calculator, click the Hex option button, enter 1234 and then click the Dec option button and you should see the result 4,660.
Hex to decimal examples1234h = 4,096 + 512 + 48 + 4 = 4,660 decimal FC96h = 61,440 + 3,072 + 144 + 6 = 64,662 decimal
Decimal to Hex examplesTo convert from decimal to hex find the largest decimal number less than or equal to the number you are converting and find the corresponding hex digit. Subtract the value of that hex digit and repeat for the next digit. 13,117 decimal to hex: 3000h = 12,288 which is less than or equal to 13,117 13,117 - 12,288 = 829 0300h = 768 which is less than or equal to 829 829 - 768 = 61 0030h = 48 which is less than or equal to 61 61 - 48 = 13 which can be read from the table as 000Dh Therefore 13,117 decimal = 333Dh
Using the Remainder MethodThis method sent in by John A. Harris of Woodstock, GA: A Decimal to Hexadecimal conversion method that does not require a table look up. Use remainders of repeated integer divides by 16 until quotient is zero. Convert remainders to hex (0-16 to 0-F) and line up in reverse order of rendering. 13,117 / 16 = 819 remainder 13 or D (least significant digit) 819 / 16 = 51 with remainder of 3 51 / 16 = 3 with remainder of 3 3 / 16 = 0 with remainder of 3 (most significant digit) 333Dh
See Also
|
|
Click here to find out how High Tech Services can help you implement this technology. Copyright © 1984-2005 CompanyLongName HTS, Cary, Raleigh, RTP, North Carolina, NC. All Rights Reserved. All trademarks are the property of their owners. Prices and specifications subject to change without notice. |