Convert 21 from decimal to hexadecimal
(base 16) notation:
Raise our base of 16 to a power
Start at 0 and increasing by 1 until it is >= 21
160 = 1
161 = 16
162 = 256 <--- Stop: This is greater than 21
Since 256 is greater than 21, we use 1 power less as our starting point which equals 1
Work backwards from a power of 1
We start with a total sum of 0:
The highest coefficient less than 15 we can multiply this by to stay under 21 is 1
Multiplying this coefficient by our original value, we get: 1 * 16 = 16
Add our new value to our running total, we get:
0 + 16 = 16
This is <= 21, so we assign our outside coefficient of 1 for this digit.
Our new sum becomes 16
Our hexadecimal notation is now equal to 1
The highest coefficient less than 15 we can multiply this by to stay under 21 is 5
Multiplying this coefficient by our original value, we get: 5 * 1 = 5
Add our new value to our running total, we get:
16 + 5 = 21
This = 21, so we assign our outside coefficient of 5 for this digit.
Our new sum becomes 21
Our hexadecimal notation is now equal to 15