0% found this document useful (0 votes)
17 views109 pages

Lesson 2 Number Bases

The document discusses number bases and binary numbers. It explains that computers use binary to represent data as combinations of 1s and 0s. It defines a bit and discusses how binary uses a base-2 system with place values that double from right to left. The document also explains how to convert between binary and decimal numbers by multiplying the digits by their place values and adding the results.

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)
17 views109 pages

Lesson 2 Number Bases

The document discusses number bases and binary numbers. It explains that computers use binary to represent data as combinations of 1s and 0s. It defines a bit and discusses how binary uses a base-2 system with place values that double from right to left. The document also explains how to convert between binary and decimal numbers by multiplying the digits by their place values and adding the results.

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/ 109

Computing

Lesson 2: Number bases

Data representation

Ali Papila
In this lesson you will:

Define the term ‘bit’

Explain the difference between base 2 and base


10 number systems

Convert between binary and decimal numbers

2
Computers and electricity

Computers use electric circuits and switches to


represent all data and instructions.

What are the tiny switches inside computers called?

Transistors. These are tiny at around 7 nanometers.

How many do you think would fit across a human


hair?

Source: Wikimedia commons, Human-hair-1

3
14,285 transistors can fit across a single human hair

4
Computers and electricity

These transistors allow electricity to be on or off in a


circuit.

We combine lots of circuits to represent data.

Everything in a computer is represented with


combinations of 1s and 0s.
These switches could represent 10101110 in binary.

5
Number bases

What is the value of this number?


9 0 1 9
9019

6
Number bases

What is the value of this number?


9 0 1 9
9019

Nine thousand and nineteen

7
Number bases

Why does the first 9 hold more value than the last 9?
9 0 1 9

8
Number bases

Why does the first 9 hold more value than the last 9?
9 0 1 9
Each number has a place value

9
Number bases

What are the place values in this number?


9 0 1 9

10
Number bases

What are the place values in this number? 1


9 0 1 9

11
Number bases

What are the place values in this number? 10 1


9 0 1 9

12
Number bases

What are the place values in this number? 100 10 1


9 0 1 9

13
Number bases

What are the place values in this number? 1000 100 10 1


9 0 1 9

14
Number bases
x 10 x 10 x 10

You work out the next place value by multiplying by 1000 100 10 1
10 as you move from right to left. 9 0 1 9

15
Digits

How many digits are there in our decimal number


system?

Source: Pixabay

16
Digits

How many digits are there in our decimal number


system?

We have 10 digits:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Source: Pixabay

Our number system is a base 10 number system


because it has 10 digits.

17
Binary

Binary is a base 2 number systems. 1


1 0 0 1
This is because it uses only 2 digits: 0 and 1.

Make a prediction

What do you think the place value might be of each of


the numbers in this table?

18
Binary

Binary is a base 2 number systems. 2 1


1 0 0 1
This is because it uses only 2 digits: 0 and 1.

Make a prediction

What do you think the place value might be of each of


the numbers in this table?

19
Binary

Binary is a base 2 number systems. 4 2 1


1 0 0 1
This is because it uses only 2 digits: 0 and 1.

Make a prediction

What do you think the place value might be of each of


the numbers in this table?

20
Binary

Binary is a base 2 number systems. 8 4 2 1


1 0 0 1
This is because it uses only 2 digits: 0 and 1.

Make a prediction

What do you think the place value might be of each of


the numbers in this table?

21
Binary
x2 x2 x2

You work out the next place value by multiplying by 2 8 4 2 1


as you move from right to left. 1 0 0 1

22
Binary
x2 x2 x2

You work out the next place value by multiplying by 2 8 4 2 1


as you move from right to left. 1 0 0 1

Each binary digit is called a bit.

23
Number bases

To work out the value of a number, you need to know 1000 100 10 1
its place value. 9 0 1 9

You then multiple the digit by its place value.

24
Number bases

To work out the value of a number, you need to know 1000 100 10 1
its place value. 9 0 1 9
9 x 1000 0 x 100 1 x 10 9x1
You then multiple the digit by its place value.

25
Number bases

To work out the value of a number, you need to know 1000 100 10 1
its place value. 9 0 1 9
9 x 1000 0 x 100 1 x 10 9x1
You then multiple the digit by its place value.
9000 0 10 9

26
Number bases

Finally, you add all of those numbers together. 1000 100 10 1


9 0 1 9
9 x 1000 0 x 100 1 x 10 9x1
9000 0 10 9

27
Number bases

Finally, you add all of those numbers together. 1000 100 10 1


9 0 1 9
9 x 1000 0 x 100 1 x 10 9x1
9000 0 10 9

Nine thousand and nineteen

28
Number bases

You do exactly the same thing with binary numbers. 8 4 2 1


1 0 0 1

29
Number bases

You do exactly the same thing with binary numbers. 8 4 2 1


1 0 0 1
You multiply the digit by its place value.
1x8 0x4 0x2 1x1

30
Number bases

You do exactly the same thing with binary numbers. 8 4 2 1


1 0 0 1
You multiply the digit by its place value.
1x8 0x4 0x2 1x1
8 0 0 1

31
Number bases

Then you add all of the values together. 8 4 2 1


1 0 0 1
1x8 0x4 0x2 1x1
8 0 0 1

32
Number bases

Then you add all of the values together. 8 4 2 1


1 0 0 1
1x8 0x4 0x2 1x1
8 0 0 1

Nine

33
Number bases

Then you add all of the values together. 8 4 2 1


1 0 0 1
1x8 0x4 0x2 1x1
8 0 0 1

In binary it is a little easier because you are always


Nine
multiplying by either 1 or 0.

You don’t really need to multiply.

34
Number bases

How can you tell the number base of a number that


you are presented with?

e.g.

101

35
Number bases

You can use a subscript at the end of the number to


state the number base.

1012 A base of 2 means that it is a binary number.

A base of 10 means that it is a decimal number.


10110

36
Binary?

Base 10 Base 2

37
Binary?

Base 10 Base 2

38
How many digits does decimal
have?

10 2

39
How many digits does decimal
have?

10 2

40
Converting from binary to decimal

In order to convert from binary to decimal you need 128 64 32 16 8 4 2 1


to know the place value of each digit in the number.

When you are just starting to learn how to do this it is a


good idea to always use a table like this one.

41
Converting from binary to decimal

In order to convert from binary to decimal you need 128 64 32 16 8 4 2 1


to know the place value of each digit in the number.

When you are just starting to learn how to do this it is a


good idea to always use a table like this one.

Draw this table now.

42
Converting from binary to decimal

If I give you the binary number 111 then you place the 128 64 32 16 8 4 2 1
digits from right to left in the table.

43
Converting from binary to decimal

If I give you the binary number 111 then you place the 128 64 32 16 8 4 2 1
digits from right to left in the table. 1

44
Converting from binary to decimal

If I give you the binary number 111 then you place the 128 64 32 16 8 4 2 1
digits from right to left in the table. 1 1

45
Converting from binary to decimal

If I give you the binary number 111 then you place the 128 64 32 16 8 4 2 1
digits from right to left in the table. 1 1 1

46
Converting from binary to
decimal
Then you need to look at their place value and add 128 64 32 16 8 4 2 1
those values together. 1 1 1

4+2+1=7

47
Converting from binary to
decimal
Then you need to look at their place value and add 128 64 32 16 8 4 2 1
those values together. 1 1 1

4+2+1=7

111 in binary is 7 in decimal

48
Converting from binary to
decimal
Let’s try another. 128 64 32 16 8 4 2 1
1 0 1 0
Convert 1010 from binary to decimal.

49
Converting from binary to
decimal
This time you have some 0s. These can be left out of 128 64 32 16 8 4 2 1
your calculation. 1 0 1 0

50
Converting from binary to
decimal
This time you have some 0s. These can be left out of 128 64 32 16 8 4 2 1
your calculation. 1 0 1 0

8 + 2 = 10

51
Converting from binary to
decimal
This time you have some 0s. These can be left out of 128 64 32 16 8 4 2 1
your calculation. 1 0 1 0

8 + 2 = 10

1010 in binary is 10 in decmial

52
Converting from binary to
decimal
Let’s try a slightly larger binary number. 128 64 32 16 8 4 2 1
1 0 1 1 1 1
Convert 101111 from binary to decimal.

53
Converting from binary to
decimal
Let’s try a slightly larger binary number. 128 64 32 16 8 4 2 1
1 0 1 1 1 1
Convert 101111 from binary to decimal.

54
Converting from binary to
decimal
Let’s try a slightly larger binary number. 128 64 32 16 8 4 2 1
1 0 1 1 1 1
Convert 101111 from binary to decimal.

101111 in binary is 47 in decimal

55
Converting from binary to
decimal
Use your table to help you answer the following quick 128 64 32 16 8 4 2 1
fire questions.

56
Convert these numbers from binary to decimal

57
101

5 6

58
101

5 6

59
1111

14 15

60
1111

14 15

61
10111

23 21

62
10111

23 21

63
1110

11 12

13 14
64
1110

11 12

13 14
65
10000011

128 131

129 132
66
10000011

128 131

129 132
67
Converting from decimal to binary

It is a little tricker to convert from decimal to binary. 128 64 32 16 8 4 2 1

You need to work from left to right.

And you need to subtract, not add.

68
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

69
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

You start by looking for the highest value that fits into
the number 5.

70
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

You start by looking for the highest value that fits into
the number 5.

71
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

You start by looking for the highest value that fits into
the number 5.

72
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

You start by looking for the highest value that fits into
the number 5.

73
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

You start by looking for the highest value that fits into
the number 5.

74
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1

You start by looking for the highest value that fits into
the number 5.

75
Converting from decimal to binary

Let’s start with a small decimal number. 128 64 32 16 8 4 2 1


1
5

You start by looking for the highest value that fits into
the number 5.

76
Converting from decimal to binary

Once you have found a value, you enter a 1 in that 128 64 32 16 8 4 2 1


column. 1

You then take that value away from your current


number (5). 5-4=1

77
Converting from decimal to binary

Then you start looking for the highest value that fits 128 64 32 16 8 4 2 1
into your remaining number. 1

5-4=1

78
Converting from decimal to binary

Then you start looking for the highest value that fits 128 64 32 16 8 4 2 1
into your remaining number. 1

5-4=1

79
Converting from decimal to binary

Then you start looking for the highest value that fits 128 64 32 16 8 4 2 1
into your remaining number. 1 0

5-4=1

80
Converting from decimal to binary

Found it! 128 64 32 16 8 4 2 1


1 0 1

5-4=1

1-1=0

81
Converting from decimal to binary

Finally, you are left with your decimal to binary 128 64 32 16 8 4 2 1


conversion. 1 0 1

5 in decimal is 101 in binary

82
Converting from decimal to binary

You can double-check your maths by doing a quick 128 64 32 16 8 4 2 1


conversion back to binary to just make sure. 1 0 1

101 in binary is 5 in decimal!


5 in decimal is 101 in binary
This becomes more essential with higher numbers,
especially if you are in an exam!

83
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1

Convert the decimal number 60 into binary.

84
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1

Convert the decimal number 60 into binary.

What is the highest number in our table that will fit


into 60?

85
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1
Convert the decimal number 60 into binary.

What is the highest number in our table that will fit


into 60?

86
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1
Convert the decimal number 60 into binary.

Take 32 away from 60, what are you left with?


60 - 32 = ?

87
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1
Convert the decimal number 60 into binary.

Take 32 away from 60, what are you left with?


60 - 32 = 28

88
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1
Convert the decimal number 60 into binary.

What is the highest value that fits into 28?


60 - 32 = 28

89
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1
Convert the decimal number 60 into binary.

Take 16 away from 28, what are you left with?


60 - 32 = 28

28 - 16 = ?

90
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1
Convert the decimal number 60 into binary.

Take 16 away from 28, what are you left with?


60 - 32 = 28

28 - 16 = 12

91
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1
Convert the decimal number 60 into binary.

What is the highest value that fits into 12?


60 - 32 = 28

28 - 16 = 12

92
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1
Convert the decimal number 60 into binary.

What is the highest value that fits into 12?


60 - 32 = 28

28 - 16 = 12

93
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1
Convert the decimal number 60 into binary.

Take 8 away from 12, what are you left with?


60 - 32 = 28

28 - 16 = 12

12 - 8 = ?

94
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1
Convert the decimal number 60 into binary.

Take 8 away from 12, what are you left with?


60 - 32 = 28

28 - 16 = 12

12 - 8 = 4

95
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1
Convert the decimal number 60 into binary.

What is the highest value that fits into 4?


60 - 32 = 28

28 - 16 = 12

12 - 8 = 4

96
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1
Convert the decimal number 60 into binary.

What is the highest value that fits into 4?


60 - 32 = 28

28 - 16 = 12

12 - 8 = 4

97
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1
Convert the decimal number 60 into binary.

Take 4 away from 4, what are you left with?


60 - 32 = 28

28 - 16 = 12

12 - 8 = 4

4-4=?

98
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1
Convert the decimal number 60 into binary.

Take 4 away from 4, what are you left with?


60 - 32 = 28

28 - 16 = 12

12 - 8 = 4

4-4=0

99
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1 0 0
Convert the decimal number 60 into binary.

There is nothing left so we enter 0s in the remaining


60 - 32 = 28
columns.
28 - 16 = 12

12 - 8 = 4

4-4=0

100
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1 0 0
Convert the decimal number 60 into binary.

We have our answer!


60 in decimal is 111100 in binary

101
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1 0 0
Convert the decimal number 60 into binary.

Now we double-check that we were right.


32 + 16 + 8 + 4 = ?

102
Converting from decimal to binary

Let’s try a higher number. 128 64 32 16 8 4 2 1


1 1 1 1 0 0
Convert the decimal number 60 into binary.

Now we double-check that we were right.


32 + 16 + 8 + 4 = 60

103
Converting from decimal to binary

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

A. 128
B. 120
C. 80
D. 200
E. 190

104
Converting from decimal to binary: solutions

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


128 1 0 0 0 0 0 0 0
A. 128
120 1 1 1 1 0 0 0
B. 120
80 1 0 1 0 0 0 0
C. 80
200 1 1 0 0 1 0 0 0
D. 200
190 1 0 1 1 1 1 1 0
E. 190

105
Converting from decimal to binary: solutions

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


128 1 0 0 0 0 0 0 0
A. 128
120 1 1 1 1 0 0 0
B. 120
80 1 0 1 0 0 0 0
C. 80
200 1 1 0 0 1 0 0 0
D. 200
190 1 0 1 1 1 1 1 0
E. 190

106
Converting from decimal to binary: solutions

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


128 1 0 0 0 0 0 0 0
A. 128
120 1 1 1 1 0 0 0
B. 120
80 1 0 1 0 0 0 0
C. 80
200 1 1 0 0 1 0 0 0
D. 200
190 1 0 1 1 1 1 1 0
E. 190

107
Converting from decimal to binary: solutions

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


128 1 0 0 0 0 0 0 0
A. 128
120 1 1 1 1 0 0 0
B. 120
80 1 0 1 0 0 0 0
C. 80
200 1 1 0 0 1 0 0 0
D. 200
190 1 0 1 1 1 1 1 0
E. 190

108
Converting from decimal to binary: solutions

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


128 1 0 0 0 0 0 0 0
A. 128
120 1 1 1 1 0 0 0
B. 120
80 1 0 1 0 0 0 0
C. 80
200 1 1 0 0 1 0 0 0
D. 200
190 1 0 1 1 1 1 1 0
E. 190

109

You might also like