0% found this document useful (0 votes)
20 views

Lesson 3 - Binary Maths

This document provides a lesson on binary math. It begins by reviewing binary to decimal conversions and counting in binary. It then covers performing addition in binary by explaining the four golden rules of binary addition and working through examples. The purpose is to teach learners how to work with and perform calculations using the binary number system.

Uploaded by

Ali Papila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Lesson 3 - Binary Maths

This document provides a lesson on binary math. It begins by reviewing binary to decimal conversions and counting in binary. It then covers performing addition in binary by explaining the four golden rules of binary addition and working through examples. The purpose is to teach learners how to work with and perform calculations using the binary number system.

Uploaded by

Ali Papila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 128

Computing

Lesson 3: Binary maths

Data representation

Ali Papila
In this lesson you will:

Recap binary to decimal conversions

Count in binary

Perform addition in binary

Perform binary shifts

2
Converting from binary to decimal

Draw this table now. 128 64 32 16 8 4 2 1

3
Convert these numbers from binary to decimal

4
111

7 6

5
111

7 6

6
1101

14 13

7
1101

14 13

8
10110

22 21

9
10110

22 21

10
1110

11 12

13 14
11
1110

11 12

13 14
12
10000011

128 131

129 132
13
10000011

128 131

129 132
14
Converting from decimal to binary

Try these conversions from decimal to binary. 128 64 32 16 8 4 2 1

A. 65
B. 129
C. 160
D. 210
E. 176

15
Converting from decimal to binary: solutions

Try these conversions from decimal to binary. 128 64 32 16 8 4 2 1


65 1 0 0 0 0 0 1
A. 65
129 1 0 0 0 0 0 0 1
B. 129
160 1 0 1 0 0 0 0 0
C. 160
210 1 1 0 1 0 0 1 0
D. 210
176 1 0 1 1 0 0 0 0
E. 176

16
Counting in binary

17
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 0

Let’s take a look at how we count in decimal first.

18
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 1

Let’s take a look at how we count in decimal first.

19
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 2

Let’s take a look at how we count in decimal first.

20
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 3

Let’s take a look at how we count in decimal first.

21
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 4

Let’s take a look at how we count in decimal first.

22
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 5

Let’s take a look at how we count in decimal first.

23
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 6

Let’s take a look at how we count in decimal first.

24
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 7

Let’s take a look at how we count in decimal first.

25
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 8

Let’s take a look at how we count in decimal first.

26
Counting in binary

Before you can perform addition in binary, you need to 1000 100 10 1
learn to count in binary! 9

Let’s take a look at how we count in decimal first.

27
Counting in binary

There are no digits left to use in the number system, so 1000 100 10 1
we move to the next column. 9

28
Counting in binary

There are no digits left to use in the number system, so 1000 100 10 1
we move to the next column. 1 0

29
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 1

30
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 2

31
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 3

32
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 4

33
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 5

34
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 6

35
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 7

36
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 8

37
Counting in binary

And now we work our way through all of those digits 1000 100 10 1
again. 1 9

38
Counting in binary

Until we run out of digits! 1000 100 10 1


1 9

39
Counting in binary

And have to increment the next column. 1000 100 10 1


2 0

40
Counting in binary

And so it continues... 1000 100 10 1


2 0

41
Counting in binary

In binary it works in exactly the same way, we just 8 4 2 1


have less digits to use! 0

A 1 and a 0.

42
Counting in binary

In binary it works in exactly the same way, we just 8 4 2 1


have less digits to use! 1

A 1 and a 0.

43
Counting in binary

No more digits left, move to the next column. 8 4 2 1


1

44
Counting in binary

No more digits left, move to the next column. 8 4 2 1


1 0

45
Counting in binary

Start again... 8 4 2 1
1 1

46
Counting in binary

No more digits left, move to the next column. 8 4 2 1


1 1

47
Counting in binary

No more digits left, move to the next column. 8 4 2 1


1 0 0

48
Counting in binary

And this process continues... 8 4 2 1


1 0 1

49
Counting in binary

And this process continues... 8 4 2 1


1 1 0

50
Counting in binary

And this process continues... 8 4 2 1


1 1 1

51
Counting in binary

No digits left! 8 4 2 1
1 1 1

52
Counting in binary

Move to the next column. 8 4 2 1


1 0 0 0

53
Counting in binary

We move up the columns much faster because we only 8 4 2 1


have 2 digits instead of 10. 1 0 0 0

54
Let’s count to 1010 in binary.

55
8 4 2 1
0

010

56
8 4 2 1
1

110

57
8 4 2 1
1 0

210

58
8 4 2 1
1 1

310

59
8 4 2 1
1 0 0

410

60
8 4 2 1
1 0 1

510

61
8 4 2 1
1 1 0

610

62
8 4 2 1
1 1 1

710

63
8 4 2 1
1 0 0 0

810

64
8 4 2 1
1 0 0 1

910

65
8 4 2 1
1 0 1 0

1010

66
The four golden rules of binary addition

Rule 1 0
+ 0
0+0=0 0

In decimal, 0 + 0 = 0

67
The four golden rules of binary addition

Rule 2 0
+ 1
0+1=1 1

In decimal, 0 + 1 = 1

68
The four golden rules of binary addition

Rule 3 1
+ 1
1 + 1 = 10 1 0

In decimal, 1 + 1 = 2

69
The four golden rules of binary addition

Rule 4 1
1
1 + 1 + 1 = 11 + 1
1 1

In decimal, 1 + 1 + 1 = 3

70
Binary addition

1 0 0
+ 1 0
=

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

71
Binary addition

1 0 0
+ 1 0
= 0

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

72
Binary addition

1 0 0
+ 1 0
= 1 0

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

73
Binary addition

1 0 0
+ 1 0
= 1 1 0

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

74
Binary addition

100 + 10 = 110 in binary


1 0 0
4 + 2 = 6 in decimal + 1 0
= 1 1 0

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

75
Binary addition

1 0 0
+ 1 0 1
=

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

76
Binary addition

1 0 0
+ 1 0 1
= 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

77
Binary addition

1 0 0
+ 1 0 1
= 0 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

78
Binary addition

1 0 0
+ 1 0 1
= 1 0 0 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

79
Binary addition

100 + 101 = 1001 in binary


1 0 0
4 + 5 = 9 in decimal + 1 0 1
= 1 0 0 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

80
Binary addition

1 0 1
+ 1 1
=

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

81
Binary addition

1 0 1
+ 1 1
= 0
1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

82
Binary addition

1 0 1
+ 1 1
= 0
1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

83
Binary addition

1 0 1
+ 1 1
= 0 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

84
Binary addition

1 0 1
+ 1 1
= 0 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

85
Binary addition

1 0 1
+ 1 1
= 1 0 0 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

86
Binary addition

101 + 11 = 1000 in binary


1 0 1
5 + 3 = 8 in decimal + 1 1
= 1 0 0 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

87
Are you with me so far?

If not, pause and rewind

88
Binary addition

1 1 1
+ 1 1
=

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

89
Binary addition

1 1 1
+ 1 1
= 0
1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

90
Binary addition

1 1 1
+ 1 1
= 0
1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

91
Binary addition

1 1 1
+ 1 1
= 1 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

92
Binary addition

1 1 1
+ 1 1
= 1 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

93
Binary addition

1 1 1
+ 1 1
= 1 0 1 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

94
Binary addition

111 + 11 = 1010 in binary


1 1 1
7 + 3 = 10 in decimal + 1 1
= 1 0 1 0
1 1

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

95
Binary addition: try it yourself!

A. 100 + 1 = ?
B. 110 + 11 = ?
+
C. 101 + 100 = ?
=
D. 11 + 111 = ?
E. 1010 + 1111 = ?

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

96
Binary addition: solutions

A. 100 + 1 = 101
B. 110 + 11 = 1001
+
C. 101 + 100 = 1001
=
D. 11 + 111 = 1010
E. 1010 + 1111 = 11001

Rules

● 0+0=0
● 0+1=1
● 1 + 1 = 10
● 1 + 1 + 1 = 11

97
Binary shifting

98
Binary shifting

Binary shifting is shifting the bits to the left or


to the right.

If we shift to the left then we multiply.

If we shift to the right then we divide.

Source: Pixabay

99
Binary shifting

Take a look at this example. 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 0
I want to multiply 1002 by 102

100
Binary shifting

Take a look at this example. 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 0
I want to multiply 1002 by 102

I shift the bits to the left by one place

101
Binary shifting

Take a look at this example. 128 64 32 16 8 4 2 1


0 0 0 0 1 0 0 0
I want to multiply 1002 by 102

I shift the bits to the left by one place

102
Binary shifting

Take a look at this example. 128 64 32 16 8 4 2 1


0 0 0 0 1 0 0 0
I want to multiply 1002 by 102

I shift the bits to the left by one place

410 x 210 = 810

Or

1002 x 102 = 10002

103
Binary shifting
x2 x2

You can use binary shifts to multiply by 2, 4, 8, 16 etc. 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 0
If you want to multiply by 4 then you shift left by 2
spaces.

104
Binary shifting
x2 x2

You can use binary shifts to multiply by 2, 4, 8, 16 etc. 128 64 32 16 8 4 2 1


0 0 0 1 0 0 0 0
If you want to multiply by 4 then you shift left by 2
spaces.

105
Binary shifting
x2 x2

410 x 410 = 1610 128 64 32 16 8 4 2 1


0 0 0 1 0 0 0 0
1002 x 1002 = 100002

106
Binary shifting

Let’s try one! 128 64 32 16 8 4 2 1


0 0 0 0 0 1 1 1
1112 x 10002 = ?

107
Binary shifting

Let’s try one! 128 64 32 16 8 4 2 1

1112 x 10002 = ?

This is multiplying our number by 8.

How many shifts do you need to do to get from 1 to


8?

108
Binary shifting
x2 x2 x2

Let’s try one! 128 64 32 16 8 4 2 1

1112 x 10002 = ?

This is multiplying our number by 8.

How many shifts do you need to do to get from 1 to


8?

109
Binary shifting

Let’s try one! 128 64 32 16 8 4 2 1


0 0 0 0 0 1 1 1
1112 x 10002 = ?

This is multiplying our number by 8.

This means that we need to shift our bits three spaces


to the left.

110
Binary shifting

Let’s try one! 128 64 32 16 8 4 2 1


0 0 1 1 1 0 0 0
1112 x 10002 = ?

This is multiplying our number by 8.

This means that we need to shift our bits three spaces


to the left.

111
Binary shifting

128 64 32 16 8 4 2 1
0 0 1 1 1 0 0 0
1112 x 10002 = 1110002

Or

710 x 810 = 5610

112
Which direction do you shift to multiply?

LEFT RIGHT

113
Which direction do you shift to multiply?

LEFT RIGHT

114
Binary shifting

In order to divide, we do the same thing but step to the 128 64 32 16 8 4 2 1


right! 0 0 0 0 0 1 0 0

115
Binary shifting

Let’s try this one: 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 0
1002 / 102 = ?

116
Binary shifting
/2

Let’s try this one: 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 0
1002 / 102 = ?

We are dividing by 2 so we shift to the right by one


place.

117
Binary shifting
/2

128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 0
1002 / 102 = 102

Or

410 / 210 = 210

118
Binary shifting

Let’s try another one: 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 1
1012 / 1002 = ?

119
Binary shifting

Let’s try another one: 128 64 32 16 8 4 2 1


0 0 0 0 0 1 0 1
1012 / 1002 = ?

Here we are dividing by 4 so we need to shift the


values to the right by 2 places.

120
Binary shifting

Let’s try another one: 128 64 32 16 8 4 2 1


0 0 0 0 0 0 0 1
1012 / 1002 = ?

Here we are dividing by 4 so we need to shift the


values to the right by 2 places.

121
Binary shifting

128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 1
1012 / 1002 = 12

In binary shifting, we can only work with whole


numbers.

Any remainders are discarded.

122
Binary shifting

128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 1
1012 / 1002 = 12

If we do the same division with our decimal numbers


then we are left with a decimal value.

510 / 410 = 1.2510

123
Which direction do you shift to divide?

LEFT RIGHT

124
Which direction do you shift to divide?

LEFT RIGHT

125
Binary shifting: try it yourself!

MULTIPLY 128 64 32 16 8 4 2 1

A. 11012 x 1002 = ?
B. 1112 x 102 = ?
C. 1111112 x 102 = ?
Draw a table to help you!
DIVIDE

D. 11002 / 102 = ?
E. 11100002 / 1002 = ?
F. 1100002 / 10002 = ?

126
Binary shifting: solutions

MULTIPLY 128 64 32 16 8 4 2 1

A. 11012 x 1002 = 1101002


B. 1112 x 102 = 11102
C. 1111112 x 102 = 11111102

DIVIDE

D. 11002 / 102 = 01102


E. 11100002 / 1002 = 00111002
F. 1100002 / 10002 = 0001102

127
Share your work with Oak National

If you'd like to, please ask your parent or carer to share your work on Instagram, Facebook
or Twitter tagging @OakNational and #LearnwithOak

You might also like