Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Binary Number and Other Bases Arithmetic, Exercises of Number Theory

multiplication, addition and subtraction, solved exercise for different bases

Typology: Exercises

2020/2021

Uploaded on 03/30/2021

anum
anum ๐Ÿ‡บ๐Ÿ‡ธ

4.6

(8)

243 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MEP Y9 Practice Book A
1
1 Base Arithmetic
1.1 Binary Numbers
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
4215
โ†’
4 1000 2 100 1 10 5 1ร—+ร—+ร—+ร—
3102
โ†’
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
1000000
โ†’
16464ร—=
1001001
โ†’
164181173ร— +ร—+ร—=
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.
Example 1
Convert the following binary numbers to base 10:
(a) 111 (b) 101 (c) 1100110
Solution
For each number, consider the place value of every digit.
(a) 4 2 1
111
โ†’
4
+
2
+
1
=
7
The binary number 111 is 7 in base 10.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Binary Number and Other Bases Arithmetic and more Exercises Number Theory in PDF only on Docsity!

1 Base Arithmetic

1.1 Binary Numbers

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.

Example 1

Convert the following binary numbers to base 10: (a) 111 (b) 101 (c) 1100110

Solution

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.

Example 2

Convert the following base 10 numbers into binary numbers: (a) 3 (b) 11 (c) 140

Solution

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. Convert the following binary numbers to base 10: (a) 110 (b) 1111 (c) 1001 (d) 1101 (e) 10001 (f) 11011 (g) 1111111 (h) 1110001 (i) 10101010 (j) 11001101 (k) 111000111 (l) 1100110

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

Example 1

Calculate, using binary numbers: (a) 111 + 100 (b) 101 + 110 (c) 1111 + 111

Solution

(a) 1 1 1 (b) 1 0 1 (c) 1 1 1 1

  • 1 0 0 + 1 1 0 + 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0

Note how important it is to 'carry' correctly.

Example 2

Calculate the binary numbers: (a) 111 โˆ’ 101 (b) 110 โˆ’ 11 (c) 1100 โˆ’ 101

Solution

(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

  1. Calculate the binary numbers:

(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

  1. Calculate the binary numbers: (a) 11 โˆ’ 10 (b) 110 โˆ’ 10 (c) 1111 โˆ’ 110 (d) 100 โˆ’ 10 (e) 100 โˆ’ 11 (f) 1000 โˆ’ 11 (g) 1101 โˆ’ 110 (h) 11011 โˆ’ 110 (i) 1111 โˆ’ 111 (j) 110101 โˆ’ 1010 (k) 11011 โˆ’ 111 (l) 11110 โˆ’ 111
  2. Calculate the binary numbers: (a) 11 + 11 (b) 111 + 111 (c) 1111 + 1111 (d) 11111 + 11111 Describe any patterns that you observe in your answers.
  3. Calculate the binary numbers:

(a) 10 + 10 (b) 100 + 100 (c) 1000 + 1000 (d) 10000 + 10000 Describe any patterns that you observe in your answers.

  1. Solve the following equations, where all numbers, including x, are binary:

(a) x + 11 = 1101 (b) x โˆ’ 10 = 101 (c) x โˆ’ 1101 = 11011 (d) x + 1110 = 10001 (e) x + 111 = 11110 (f) x โˆ’ 1001 = 11101

  1. Calculate the binary numbers:

(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.

Example 2

Calculate the binary numbers: (a) 1011 ร— 11 (b) 1110 ร— 101 (c) (^11011) ร— 111 (d) (^11011) ร— 1001

Solution

(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

  1. Calculate the binary numbers: (a) 111 ร— 10 (b) 1100 ร— 100 (c) 101 ร— 1000 (d) 11101 ร— 1000 (e) 11000 ร— 10 (f) 10100 ร— 1000 (g) (^10100) รท 10 (h) (^1100) รท 100 Check your answers by converting to base 10 numbers.
  2. Calculate the binary numbers: (a) 111 ร— 11 (b) 1101 ร— 11 (c) 1101 ร— 101 (d) 1111 ร— 110 (e) 11011 ร— 1011 (f) 11010 ร— 1011 (g) 10101 ร— 101 (h) 10101 ร— 111 (i) 10101 ร— 110 (j) 100111 ร— 1101
  3. Solve the following equations, where all numbers, including x, are binary: (a) 11 x = 110 (b) 101 x = 101

(c) 10 x = 111 (d) 111 x = 1011

  1. Multiply each of the following binary numbers by itself: (a) 11 (b) 111 (c) 1111 What do you notice about your answers to parts (a), (b) and (c)? What will you get if you multiply 11111 by itself?

(^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)

  • (1 ร— 1) = 2626 in base 10

Example 1

Convert each of the following numbers to base 10: (a) 412 in base 6. (b) 374 in base 9. (c) 1432 in base 5.

Solution

(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

Example 2

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.

Solution

(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,

24 = (1 ร— 16) + 8

8 = (2 ร— 4) + 0

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

Example 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.

Solution

(a) 1 4

  • 2 1 4 0 Note that 4 + 1 = 10 in base 5.

(b) 1 6

  • 3 2 5 1 Note that 6 + 2 = 11 in base 7.

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

1 0 0 1 1 โ†’ (1 ร— 81) + (0 ร— 27) + (0 ร— 9) + (3 ร— 1) + (1 ร— 1)

and 17 ร— 5 = 85, as expected.

Exercises

  1. Convert the following numbers from the base stated to base 10: (a) 412 base 5 (b) 333 base 4 (c) 728 base 9 (d) 1210 base 3 (e) 1471 base 8 (f) 612 base 7 (g) 351 base 6 (h) 111 base 3

1 1

  1. Convert the following numbers from base 10 to the base stated: (a) 24 to base 3 (b) 16 to base 4 (c) 321 to base 5 (d) 113 to base 6 (e) 314 to base 7 (f) 84 to base 9 (g) 142 to base 3 (h) 617 to base 5
  2. Carry out the following additions in the base stated: (a) 3 + 2 in base 4 (b) 5 + 8 in base 9 (c) 4 + 6 in base 8 (d) 2 + 2 in base 3 (e) 6 + 7 in base 9 (f) 3 + 4 in base 6
  3. In what number bases could each of the following numbers be written: (a) 123 (b) 112 (c) 184
  4. Carry out each of the following calculations in the base stated: (a) (^13) + 23 in base 4 (b) (^120) + 314 in base 5 (c) 222 + 102 in base 3 (d) 310 + 132 in base 4 (e) 624 + 136 in base 7 (f) 211 + 142 in base 5 (g) 333 + 323 in base 4 (h) 141 + 424 in base 5 Check your answers to parts (a), (c) and (e) by converting to base 10 numbers.
  5. Carry out each of the following multiplications in the base stated: (a) 3 ร— 2 in base 4 (b) 4 ร— 3 in base 5 (c) 4 ร— 2 in base 6 (d) 3 ร— 5 in base 6 (e) 2 ร— 2 in base 3 (f) 8 ร— 8 in base 9
  6. Carry out each of the following multiplications in the base stated: (a) (^121) ร— 11 in base 3 (b) (^133) ร— 12 in base 4 (c) 13 ร— 24 in base 5 (d) 142 ร— 14 in base 5 (e) 161 ร— 24 in base 7 (f) 472 ร— 32 in base 8 (g) 414 ร— 22 in base 5 (h) 2101 ร— 21 in base 3 Check your answers to parts (a), (c) and (e) by converting to base 10 numbers.