Lesson 02 - Number Conversions and Arithmetic Operations
Lesson 02 - Number Conversions and Arithmetic Operations
1. Divide the decimal number by the base of the number system you want to convert to.
2. The remainder is the least significant (last) digit of the conversion.
3. Take the quotient from Step 2 and divide it by the base of the number system.
4. The remainder from Step 3 is the place value to the left of the converted equivalent.
5. Take the quotient from Step 4 and divide it by the base of the number system.
6. Repeat Steps 4 & 5 until the quotient is zero (0).
17 ÷ 2 = 8, 𝑅𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑜𝑓 1
8 ÷ 2 = 4, 𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 𝑜𝑓 0
4 ÷ 2 = 2, 𝑅𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑜𝑓 0
2 ÷ 2 = 1, 𝑅𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑜𝑓 0
1 ÷ 2 = 0, 𝑅𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑜𝑓 1
Stop when your answer is 0. Final answer is 10001bin. Note, you start with the remainders from the
bottom up and write the answer from left to write.
Stop when your answer is 0. Final answer is 22Bhex. Note, you start with the remainders from the
bottom up and write the answer from left to write.
25 – 24 = 9
1
24 23 22 21 20
9 – 23 = 1
1 1
4
2 23 22 21 20
1 – 20 = 0
1 1 1
4 3 2 1
2 2 2 2 20
1. Start with the right-most (least significant) bit and group into sets of four bits.
2. If the last group contains less than four bits, pad to the left with zeros until the group has four
bits.
3. Convert each group of four bits to its hexadecimal equivalent.
Exercise 1:
When the sum of two digits is greater than 9, a carry-out of 1 is added to the next significant digit.
Hex addition is similar to decimal addition with the only difference being that the sum must be greater
than F (15) for a carry-out of 1 to be added to the next significant hexit.
If the subtrahend (the digit you are subtracting) is greater than the minuend (the digit you are
subtracting from), then you need to “borrow” (subtract 1) from the minuend of the next significant digit
(digit to the left) and add 10 (the base) to the minuend. Then you can subtract:
The concept of “borrowing” is similar to that of the decimal number system, the only difference being
that you add 16 to the minuend instead of 10 (because hexadecimal is base 16!).
Exercise 2:
a) b)
0100110 0111111
+0110111 + 1
a) b)
ABCD FFFFF
+ 4EFA + 1
c) d)
B46 7B6
+ D29 + FFF
a) b) c)
F1 DEAF FFFFF
−1F −CAB − ABCDE