go to previous page   go to home page   go to next page

Answer:

number = 247
247 div 16 = 15 r 7    so  digit[ 0 ] = 7

number =  15
 15 div 16 =  0 r 15   so  digit[ 1 ] = F     
                           ("15" is in base 10, 
                            "F" is the hex digit)

Result: 24710 = 0xF7

Another Conversion

To convert 247 from decimal to base 16, repeatedly divide by 16, collecting the remainders in the base 16 expression. This is shown above. Check the result by converting the base 16 expression to decimal: 0xF7  =  F × sixteen + 7 × 1  =  15 × 16 + 7  =  240 + 7 = 24710

The algorithm can be described as: Divide the number by the base. The remainder is the digit. The quotient becomes the number. Repeat. The digits come out right to left.

Here is another base conversion. Find pencil and paper and try it.

QUESTION 18:

Convert 103310 to hex.