Consider the decimal number 78

Download Report

Transcript Consider the decimal number 78

Counting in the decimal
system
© D Hoult 2010 ODWS
We use the decimal system for counting because,
© D Hoult 2010 ODWS
We use the decimal system for counting because,
we have 10 fingers !
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
1’s
© D Hoult 2010 ODWS
10’s
1’s
© D Hoult 2010 ODWS
10’s
1’s
© D Hoult 2010 ODWS
10’s
1’s
© D Hoult 2010 ODWS
100’s
10’s
1’s
© D Hoult 2010 ODWS
×100
© D Hoult 2010 ODWS
×101
×100
© D Hoult 2010 ODWS
×102
×101
×100
© D Hoult 2010 ODWS
×102
×101
×100
© D Hoult 2010 ODWS
etc
× 104
× 103
×102
×101
×100
© D Hoult 2010 ODWS
Counting in the binary system
© D Hoult 2010 ODWS
A computer is like a person
© D Hoult 2010 ODWS
A computer is like a person who only has two
fingers...
© D Hoult 2010 ODWS
A (digital) computer counts using electronic
circuits which are only allowed to be in one of two
states: ON or OFF
© D Hoult 2010 ODWS
A (digital) computer counts using electronic
circuits which are only allowed to be in one of two
states: ON or OFF
The OFF state (usually) represents a 0 and the ON
state (usually) represents a 1
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
© D Hoult 2010 ODWS
1’s
© D Hoult 2010 ODWS
2’s
1’s
© D Hoult 2010 ODWS
4’s
2’s
1’s
© D Hoult 2010 ODWS
20
© D Hoult 2010 ODWS
21
20
© D Hoult 2010 ODWS
22
21
20
© D Hoult 2010 ODWS
22
21
20
© D Hoult 2010 ODWS
22
21
20
© D Hoult 2010 ODWS
22
21
20
© D Hoult 2010 ODWS
23
22
21
20
© D Hoult 2010 ODWS
23
22
21
20
© D Hoult 2010 ODWS
23
22
21
20
© D Hoult 2010 ODWS
23
22
21
20
© D Hoult 2010 ODWS
23
22
21
20
The number 1 0 1 1 in binary represents
© D Hoult 2010 ODWS
23
22
21
20
The number 1 0 1 1 in binary represents 11 in
decimal
© D Hoult 2010 ODWS
Converting decimal numbers to
binary numbers
© D Hoult 2010 ODWS
Consider the decimal number 78
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
20
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
21
20
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
22
21
20
4
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
23
22
21
20
8
4
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
24
23
22
21
20
16
8
4
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
25
24
23
22
21
20
32
16
8
4
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
26
25
24
23
22
21
20
64
32
16
8
4
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
It is 26 (64)
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
It is 26 (64) so we need a 1 in that column
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
It is 26 (64) so we need a 1 in that column
78 - 64 = 14
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
It is 26 (64) so we need a 1 in that column
78 - 64 = 14 so we now repeat the process for the
number 14
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
1
It is 26 (64) so we need a 1 in that column
which means we need a 1 in the 23 (8) column
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
1
It is 26 (64) so we need a 1 in that column
which means we need a 1 in the 23 (8) column
Continuing the process gives...
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
1
1
It is 26 (64) so we need a 1 in that column
which means we need a 1 in the 23 (8) column
Continuing the process gives...
© D Hoult 2010 ODWS
Consider the decimal number 78
First find the biggest power of 2 which is less than
(or equal to) the number you want to convert
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
1
1
1
It is 26 (64) so we need a 1 in that column
which means we need a 1 in the 23 (8) column
Continuing the process gives...
© D Hoult 2010 ODWS
So the decimal number 78 is
1
0
0
1
1
1
0
in binary
© D Hoult 2010 ODWS
Each binary digit is called 1 bit
1
0
0
1
1
1
0
© D Hoult 2010 ODWS
Each binary digit is called 1 bit
1
0
0
1
1
1
0
least significant
bit (lsb)
© D Hoult 2010 ODWS
Each binary digit is called 1 bit
1
0
most significant
bit (msb)
0
1
1
1
0
least significant
bit (lsb)
© D Hoult 2010 ODWS
Each binary digit is called 1 bit
1
0
most significant
bit (msb)
0
1
1
1
0
least significant
bit (lsb)
A number (or word) of 8 bits is called 1 byte
© D Hoult 2010 ODWS