Motorola M6800 User Manual

Page 26

Advertising
background image

MPU-26

To convert any base 10 number to hex (base 16) you may convert it to

base 8 first, then represent the base 8 number with its binary

representation. By taking the binary representation of the number and

grouping the bits from right to left in groups of four which are then

represented in hex per the above table. Or one may convert any base 10 number

to hex by our continuous division rule as before. Lets convert 82510 to hex.

51

16 825

R=9

3

16 51

R=3

33916

0

16 3

R=3


therefore 82510 = 33916

to convert 33916 back to our base 10 number,

33916 = 9x16

0 + 3x161 + 3x162

= 9x1 + 3x16 + 3x256
= 9 + 48 + 768
= 82510

To show the relationship between hex, binary, and octal, lets convert
82510 to octal & to binary and then back to hex.

Advertising