









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
multiplication, addition and subtraction, solved exercise for different bases
Typology: Exercises
1 / 15
This page cannot be seen from the preview
Don't miss anything!
We normally work with numbers in base 10. In this section we consider numbers in base 2 , often called binary numbers. In base 10 we use the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. In base 2 we use only the digits 0 and 1. Binary numbers are at the heart of all computing systems since, in an electrical circuit, 0 represents no current flowing whereas 1 represents a current flowing. In base 10 we use a system of place values as shown below: 1000 100 10 1 4 2 1 5 โ 4 ร 1000 + 2 ร 100 + 1 ร 10 + 5 ร 1 3 1 0 2 โ 3 ร 1000 + 1 ร 100 + 2 ร 1 Note that, to obtain the place value for the next digit to the left, we multiply by 10. If we were to add another digit to the front (left) of the numbers above, that number would represent 10 000s. In base 2 we use a system of place values as shown below: 64 32 16 8 4 2 1 1 0 0 0 0 0 0 โ 1 ร 64 = 64 1 0 0 1 0 0 1 โ 1 ร 64 + 1 ร 8 + 1 ร 1 = 73 Note that the place values begin with 1 and are multiplied by 2 as you move to the left. Once you know how the place value system works, you can convert binary numbers to base 10, and vice versa.
Convert the following binary numbers to base 10: (a) 111 (b) 101 (c) 1100110
For each number, consider the place value of every digit. (a) 4 2 1 1 1 1 โ 4 + 2 + 1 = 7 The binary number 111 is 7 in base 10.
(b) 4 2 1 1 0 1 โ 4 + 1 = 5 The binary number 101 is 5 in base 10. (c) 64 32 16 8 4 2 1 1 1 0 0 1 1 0 โ 64 + 32 + 4 + 2 = 102 The binary number 1100110 is 102 in base 10.
Convert the following base 10 numbers into binary numbers: (a) 3 (b) 11 (c) 140
We need to write these numbers in terms of the binary place value headings 1, 2, 4, 8, 16, 32, 64, 128, ..., etc. (a) 2 1 3 = 2 + 1 โ 1 1 The base 10 number 3 is written as 11 in base 2.
(b) 8 4 2 1 11 = 8 + 2 + 1 โ 1 0 1 1 The base 10 number 11 is written as 1011 in base 2.
(c) 128 64 32 16 8 4 2 1 140 = 128 + 8 + 4 โ 1 0 0 0 1 1 0 0 The base 10 number 140 is written as 10001100 in base 2.
Exercises
1.2 Adding and Subtracting Binary Numbers
It is possible to add and subtract binary numbers in a similar way to base 10 numbers. For example, 1 + 1 + 1 = 3 in base 10 becomes 1 + 1 + 1 = 11 in binary. In the same way, 3 โ 1 = 2 in base 10 becomes 11 โ 1 = 10 in binary. When you add and subtract binary numbers you will need to be careful when 'carrying' or 'borrowing' as these will take place more often.
Key Addition Results for Binary Numbers 1 + 0 = 1 1 + 1 = 10 1 + 1 + 1 = 11
Key Subtraction Results for Binary Numbers (^1) โ 0 = 1 (^10) โ 1 = 1 (^11) โ 1 = 10
Calculate, using binary numbers: (a) 111 + 100 (b) 101 + 110 (c) 1111 + 111
(a) 1 1 1 (b) 1 0 1 (c) 1 1 1 1
Note how important it is to 'carry' correctly.
Calculate the binary numbers: (a) 111 โ 101 (b) 110 โ 11 (c) 1100 โ 101
(a) 1 1 1 (b) 1 1 0 (c) 1 1 0 0 โ 1 0 1^ โ 1 1^ โ 1 0 1 1 0 1 1 1 1 1
1 1 1 1 1
Exercises
(a) 11 + 1 (b) 11 + 11 (c) 111 + 11 (d) 111 + 10 (e) 1110 + 111 (f) 1100 + 110 (g) 1111 + 10101 (h) 1100 + 11001 (i) 1011 + 1101 (j) 1110 + 10111 (k) 1110 + 1111 (l) 11111 + 11101
(a) 10 + 10 (b) 100 + 100 (c) 1000 + 1000 (d) 10000 + 10000 Describe any patterns that you observe in your answers.
(a) x + 11 = 1101 (b) x โ 10 = 101 (c) x โ 1101 = 11011 (d) x + 1110 = 10001 (e) x + 111 = 11110 (f) x โ 1001 = 11101
(a) 10 โ 1 (b) 100 โ 1 (c) 1000 โ 1 (d) 10000 โ 1 Describe any patterns that you observe in your answers.
Checking: (a) 8 4 2 1
1 0 1 1 โ 8 + 2 + 1 = 11
4 2 1 1 0 0 โ 4
32 16 8 4 2 1 1 0 1 1 0 0 โ 32 + 8 + 4 = 44 and 11 ร 4 = 44 , as expected.
(c) 16 8 4 2 1
1 1 0 1 1 โ 16 + 8 + 2 + 1 = 27
16 8 4 2 1 1 0 0 0 0 โ 16
256 128 64 32 16 8 4 2 1 1 1 0 1 1 0 0 0 0 โ 256 + 128 + 32 + 16 = 432 and 27 ร 16 = 432 , as expected.
Note : clearly it is more efficient to keep the numbers in binary when doing the calculations.
Calculate the binary numbers: (a) 1011 ร 11 (b) 1110 ร 101 (c) (^11011) ร 111 (d) (^11011) ร 1001
(a) 1 0 1 1 (b) 1 1 1 0 ร 1 1 ร 1 0 1 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 1 1 1 1
(c) 1 1 0 1 1 (d) 1 1 0 1 1 ร 1 1 1 ร 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 0 1 1 1 0 1 1 1 1 0 1
Exercises
(c) 10 x = 111 (d) 111 x = 1011
(^1 11 1) 1 1
1 1
The following example shows a conversion from base 5 to base 10 using the powers of 5 as place values. Base 5 625 125 25 5 1 4 1 0 0 1 โ (4 ร 625) + (1 ร 125) + (0 ร 25) + (0 ร 5)
Convert each of the following numbers to base 10: (a) 412 in base 6. (b) 374 in base 9. (c) 1432 in base 5.
(a) 36 6 1 4 1 2 โ (4 ร 36) + (1 ร 6) + ( 2 ร 1) = 152 in base 10 (b) 81 9 1 3 7 4 โ (3 ร 81) + (7 ร 9) + (4 ร 1) = 310 in base 10 (c) 125 25 5 1 1 4 3 2 โ (1 ร 125) + (4 ร 25) + (3 ร 5) + (2 ร 1) = 242 in base 10
Convert each of the following base 10 numbers to the base stated: (a) 472 to base 4, (b) 179 to base 7, (c) 342 to base 3.
(a) For base 4 the place values are 256, 64, 16, 4, 1, and you need to express the number 472 as a linear combination of 256, 64, 16, 4 and 1, but with no multiplier greater than 3. We begin by writing 472 = (1 ร 256) + 216 The next stage is to write the remaining 216 as a linear combination of 64, 16, 4 and 1. We use the fact that 216 = (3 ร 64) + 24 and, continuing in this way,
Putting all these stages together, 472 = (1 ร 256) + (3 ร 64) + (1 ร 16) + ( 2 ร 4) + ( 0 ร 1) = 13120 in base 4
(b) For base 7 the place values are 49, 7, 1.
179 = (3 ร 49) + (4 ร 7) + (4 ร 1) = 344 in base 7
(b) For base 3 the place values are 243, 81, 27, 9, 3, 1.
342 = (1 ร 243) + (1 ร 81) + (0 ร 27) + (2 ร 9) +( 0 ร 3) + (0 ร 1) = 110200 in base 3
Carry out each of the following calculations in the base stated:
(a) 14 + 21 base 5
(b) 16 + 32 base 7
(c) 141 + 104 base 5
(d) 212 + 121 base 3
Check your answer in (a) by changing to base 10 numbers.
(a) 1 4
(b) 1 6
1
1
1 1 1
(b) 1 2 2 Note that, in base 3,
ร 1 2 2 ร 2 = 11 1 0 2 1 1 2 2 0 1 0 0 1 1
(c) 5 1 2 Note that, in base 6,
ร 2 4 2 ร 4 = 12 3 2 5 2 4 ร 5 = 32 1 4 2 4 0 2 ร 5 = 14 2 1 5 3 2
Checking in (b):
(b) 9 3 1 1 2 2 โ (1 ร 9) + (2 ร 3) + (2 ร 1) = 17 3 1 1 2 โ (1 ร 3) + (2 ร 1) = 5
and 17 ร 5 = 85, as expected.
Exercises
1 1