Professional Documents
Culture Documents
TOPIC
1
2.2 2.2.1 BINARY
NUMBER
SYSTEM 2.2.2 HEXADECIMAL
&
REPRESENTATION 2.2.3 CONVERSION BETWEEN
BINARY AND HEXADECIMAL
TOPIC
2
2.2 NUMBER SYSTEM & REPRESENTATION
2.2.1 Binary
2.2.2 Hexadecimal
2.2.3 Conversion Between Binary and
Hexadecimal
Learning Outcomes:
After this lesson, student should be able to:
(a)Represent data in binary form
Remarks:
Machine recognises two state: 0 and 1.
TOPIC
3
2.2.1 BINARY
Number System
4
2.2.1 BINARY
Definition:
Number system base 10 that consists of numbers 0-9
(0,1,2,3,4,5,6,7,8,9)
5
2.2.1 BINARY
Example:
How 615 is represented in decimal numbers
6 x 100 1 x 10 5x1
TOPIC
600 + 10 + 5 = 61510
7
2.2.1 BINARY
Binary Numbers
Binary digit
1 1 02 Base
TOPIC
Binary number
8
DECIMAL BINARY
2.2.1 BINARY 0 0
1 1
2 10
3 11
Comparison 4 100
between 5 101
decimal numbers 6 110
and 7 111
binary numbers 8 1000
9 1001
10 1010
11 1011
12 1100
TOPIC
13 1101
14 1110
15 1111
16 10000
9
2.2.1 BINARY
Example 1:
Solution:
Desired base is 2, so we repeatedly divide the given
TOPIC
decimal number by 2.
10
2.2.1 BINARY
11
2.2.1 BINARY
Example 2:
Convert the number 4010 to the binary
number system.
Solution:
Desired base is 2, so we repeatedly divide
the given decimal number by 2.
TOPIC
12
2.2.1 BINARY
2 1 ---- 0
0 ---- 1
Hence, 4010 = 1010002
13
2.2.1 BINARY
Example 3
Solution:
Divide the given decimal number by 2.
TOPIC
14
2.2.1 BINARY
Solution
18
2
9
2 ---- 0
4
2 ---- 1
2 Binary
2 ---- 0
2 1 ---- 0 number
TOPIC
0 ---- 1
Hence, 1810 = 100102
15
2.2.1 BINARY
16
2.2.1 BINARY
Example 1
2^4 2^3 2^2 2^1 2^0 2210
16 8 4 2 1
1 0 1 1 0
16 x 1 8x0 4x1 2x1 1x0
16 + 0+ 4+ 2+ 0=
TOPIC
Example 2
Convert the binary number 10111002 to decimal
number
Solution:
18
2.2.1 BINARY
Example 3
Convert the binary number 11101102 to decimal
number
Solution:
2^6 2^5 2^4 2^3 2^2 2^1 2^0 11810
1 1 1 0 1 1 0
64 x 1 32 x 1 16 x 1 8 x 0 4 x 1 2 x 1 1x0
64 + 32 + 16 + 0+ 4+ 2+ 0=
TOPIC
19
2.2 2.2.1 BINARY
2.2.2 HEXADECIMAL
NUMBER
SYSTEM
2.2.3 CONVERSION BETWEEN
& BINARY AND HEXADECIMAL
REPRESENTATION
TOPIC
20
2.2 NUMBER SYSTEM & REPRESENTATION
2.2.1 Binary
2.2.2 Hexadecimal
2.2.3 Conversion Between Binary and
Hexadecimal
Learning Outcomes:
After this lesson, student should be able to:
(a) Represent data in hexadecimal form
TOPIC
21
2.2.2 HEXADECIMAL
Hexadecimal Numbers
22
DECIMAL HEXADECIMAL
0 0
1 1
2 2
3 3
4 4
Comparison
5 5
between
6 6
decimal
7 7
numbers
8 8
and
9 9
hexadecimal 10 A
numbers 11 B
12 C
TOPIC
13 D
14 E
15 F
16 10
23
Hexadecimal Numbers
Hexadecimal Decimal Binary
Digit Equivalent Equivalent
0 0 0
1 1 1
2 2 10
3 3 11
4 4 100
5 5 101
6 6 110
7 7 111
8 8 1000
9 9 1001
A 10 1010
TOPIC
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
24
2.2.2 HEXADECIMAL
Solution:
Desired base is 16, so we repeatedly divide the given
TOPIC
25
2.2.2 HEXADECIMAL
A=10
Solution:
B=11
C=12
16 1341 D = 13
16 83---- 13
16 5 ---- 3
0 ---- 5 Hex Number
TOPIC
Hence,134110 = 53D16
26
2.2.2 HEXADECIMAL
Example 2
Solution:
Desired base is 16, so we repeatedly divide the given
TOPIC
27
2.2.2 HEXADECIMAL
A=10
Solution
B=11
C=12
16 860 D = 13
16 53 ---- 12
16 ---- 5
3 Hex Number
TOPIC
0 ---- 3
Example 3
Solution:
Desired base is 16, so we repeatedly divide the
given decimal number by 16.
TOPIC
29
2.2.2 HEXADECIMAL
Solution
16 2020
16
16
Hex Number
TOPIC
Hence, 202010 =
30
2.2.2 HEXADECIMAL
4096 256 16 1
31
2.2.2 HEXADECIMAL
Example 1
Example 2
Example 3
Convert AFFA16 to decimal number
Solution:
16^3 16^2 16^1 16^0 4505010
A (10) F(15) F(15) A(10)
4096 x 10 256 x 15 16 x 15 1 x 10
40960 + 3840 + 240 + 10 =
TOPIC
35
2. NUMBER SYSTEM & REPRESENTATION
1. Binary
2. Hexadecimal
2.2.3 Conversion Between Binary and
Hexadecimal
Learning Outcomes:
36
3. CONVERSION BETWEEN
BINARY AND HEXADECIMAL
37
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Example 1:
Convert the binary number 110102 to hexadecimal.
Long Solution:
Step 1 Step 2
38
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Solution:
2^4 2^3 2^2 2^1 2^0 2610
1 1 0 1 0
16 x 1 8x1 4x0 2x1 1x0
16 + 8+ 0+ 2+ 0=
TOPIC
39
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Solution:
16 26
16 1 ---- 10-a
Hex number
0 ---- 1
TOPIC
40
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
1 A
20 23 22 21 20
1 8 + 2 = 10
Example 2
Convert the binary number 100102
to hexadecimal.
TOPIC
43
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Solution:
2^4 2^3 2^2 2^1 2^0 1810
1 0 0 1 0
16 x 1 8 x 0 4 x 0 2 x 1 1x0
16 + 0 + 0 + 2+ 0=
TOPIC
44
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
16 18
16 1 ---- 2
Hex number
0 ---- 1
TOPIC
45
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
1 0 0 1 0
1 2
Hence, 100102 = 1216
46
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Example 3
Convert the binary number 11112 to
hexadecimal.
TOPIC
47
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
48
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
16 15
0 ---- 15 Hex number
TOPIC
49
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
23 22 21 20
8 + 4 + 2 + 1 = 15
TOPIC
Step 2 Step 1
51
3. CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Example 1
Convert the hexadecimal number 3FD to
binary number
Step 2 Step 1
52
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Solution:
16^2 16^1 16^0 102110
3 F D
256 x 3 16 x 15 1 x 13
768 + 240 + 13 =
TOPIC
53
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
2 3 ---- 1
2 1 ---- 1
0 ---- 1
Hence, 3FD16 = 11111111012
54
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Convert the hexadecimal number 3FD16 to binary number
Short Solution:
1. Divide the number
into single digit 3 F D
2. Divide each number
by 2
2 15 2 13
2 3 2 7 ---- 1 2 6 ---- 1
TOPIC
55
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
15 13
2 2
7 2 6 ---- 1
2 3 2 ---- 1
2 1 ---- 1 2 3 2 3 ---- 0
---- 1
2 0 ---- 1 1 2 1 ---- 1
2 ---- 1
0 0 ---- 1
---- 1
TOPIC
11 1111 1101
56
Hence, 3FD16 = 11111111012
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Convert the hexadecimal number 3FD16 to binary number
Short Solution:
1. Divide the number
into single digit 3 F D
2. Create each hexadecimal number into 4 digit binary number
3 F (15) D (13)
23 22 21 20 23 22 21 20 23 22 21 20
8 4 2 1 8 4 2 1 8 4 2 1
TOPIC
0 0 x x x x 0 x
0 0 1 1 1 1 1 1 1 1 0 1
Example 2
Convert the hexadecimal number 1A216 to
binary number
TOPIC
58
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Solution:
256 + 160 + 2=
59
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
2 209 ---- 0
2 104 ---- 1
2 52 ---- 0
26
Binary number
2 ---- 0
2 13 ---- 0
6
TOPIC
2 ---- 1
2 3
---- 0 Hence,
2 1 1A216 = 1101000102
---- 1
---- 1
60 0
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
1 1 0 1 0 0 0 1 0
TOPIC
Short Solution:
1. Divide the number
into single digit
1 A 2
2. Create each hexadecimal number into 4 digit binary number
1 A (10) 2
23 22 21 20 23 22 21 20 23 22 21 20
8 4 2 1 8 4 2 1 8 4 2 1
TOPIC
1 1 0 1 0 0 0 1 0
Example 3
63
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
Solution:
1
16^
1
25
TOPIC
64
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
350
Binary number
43
2
2 10
TOPIC
2
0
Hence, AF116 =
65
2.2.3 CONVERSION BETWEEN BINARY
AND HEXADECIMAL
23
8
TOPIC
Hence, AF116 =
67
Summary
Number system
Binary numbers
Decimal numbers
Hexadecimal numbers
Convert binary to hexadecimal
Convert hexadecimal to binary
TOPIC
68
Summary
2 16 power of number
69