CHAPTER Computer
2 SYSTEM
2.2.1 BINARY
2.2
2.2.2 HEXADECIMAL
NUMBER
SYSTEM
&
REPRESENTATION
Learning Outcomes :
- Represent information in binary form
Number System
A set of numerals for
representing numbers
Binary Numbers (base 2)
Decimal Numbers (base 10)
Octal Numbers (base 8)
Hexadecimal Numbers (base 16)
Binary Numbers
Computer uses the binary digit (bit) 0 and 1
Bits 0 and 1 and are joined together to form
binary numbers
Binary number represents numeric values
using two symbols 0 and 1
Machine recognizes two states – 0 and 1
Binary Numbers
Binary digit
110
Binary number
Decimal Numbers
Familiar use in everyday life
Consists of numbers 0-9
Decimal digits are joined together to form
longer decimal numbers
Example: 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,
12,………
Decimal Numbers
Also known as the base 10 numbering system
How 615 is represented in decimal numbers
102 101 100
6 x 100 1 x 10 5x1
600 + 10 + 5 = 615
DECIMAL BINARY
0 0
1 1
2 10
3 11
Comparison
4 100
between decimal
5 101
numbers and
6 110
binary numbers 7 111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111
2.2.1 BINARY
2.2
2.2.2 HEXADECIMAL
NUMBER
SYSTEM
&
REPRESENTATION
Learning Outcomes :
- Represent information in hexadecimal form
- Convert from binary to hexadecimal
- Convert from hexadecimal to binary
Hexadecimal Numbers
Uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, A, B, C, D, E and F.
9B416 is example of hexadecimal
numbers.
DECIMAL HEX
0 0
1 1
Comparison 2 2
between decimal 3 3
numbers 4 4
and 5 5
hex numbers 6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
Hexadecimal Numbers
Hexadecimal Digit Decimal Equivalent Binary 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
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
2.2.1 BINARY
2.2
NUMBER 2.2.2 HEXADECIMAL
SYSTEM
2.2.3 CONVERSION BETWEEN BINARY
& AND HEXADECIMAL
REPRESENTATION
Learning Outcomes :
- Convert from binary to decimal
- Convert from decimal to binary
- Convert from binary to hexadecimal
- Convert from hexadecimal to binary
Binary to Decimal conversion
In binary number, the column weights
(again from right to left) are as follows:
(23) (22) (21) (20)
8 4 2 1
Binary to decimal conversion
Example 1
Convert the binary number 101102 to decimal
number
Solution:
24 23 22 21 20
1 0 1 1 0
16 x 1 8x0 4x1 2x1 1x0
16 + 0+ 4+ 2+ 0= 22
Hence, 101102 = 22
Binary to decimal conversion
Example 2
Convert the binary number 10111002 to
decimal number
Solution:
26 25 24 23 22 21 20
1 0 1 1 1 0 0
64 x 1 32 x 0 16 x 1 8 x 1 4 x 1 2 x 0 1 x 0
64 + 0+ 16 + 8+ 4+ 0+ 0= 92
Hence, 10111002 = 92
Binary to decimal conversion
Example 3
Convert the binary number 11101102
to decimal number
Solution:
26 25 24 23 22 21 20
1 1 1 0 1 1 0
64 x 1 32 x 1 16 x 1 8 x 0 4 x 1 2 x 0
1 1x0
64 + 32 + 16 + 0+ 4+ 0
2 + 0= 116
118
Hence, 11101102 = 118
Binary to decimal conversion
Decimal to Binary conversion
Example 1:
Convert the number 22 to the binary
number system
Solution:
Desired base is 2, so we repeatedly divide
the given decimal number by 2.
Decimal to binary conversion
Solution
2 22
2 11 ---- 0
2 5 ---- 1
2 2 ---- 1
Binary
2 1 ---- 0 number
0 ---- 1
Hence, 22 = 101102
Decimal to binary conversion
Example 2:
Convert the number 40 to the binary
number system.
Solution:
Desired base is 2, so we repeatedly divide
the given decimal number by 2.
Decimal to binary conversion
Solution
2 40
2 20 ---- 0
2 10 ---- 0
2 5 ---- 0 Binary
number
2 2 ---- 1
2 1 ---- 0
0 ---- 1 Hence, 40 = 1010002
Decimal to binary conversion
Example 3
Express 18 in binary number form
Solution:
Divide the given decimal number by 2.
Decimal to binary conversion
Solution
2 18
2 9 ---- 0
2 4 ---- 1
2 2 ---- 0
Binary
2 1 ---- 0 number
0 ---- 1
Hence, 18 = 100102
Decimal to binary conversion
Decimal to hexadecimal conversion
Example 1:
Convert the decimal number 1341 to hex
number
Solution:
Desired base is 16, so we repeatedly divide the
given decimal number by 16.
Decimal to hex conversion
Solution:
16 1341
16 83 ---- 13 (D)
16 5 ---- 3
Hex Number
0 ---- 5
Hence,1341 = 53D16
Decimal to hex conversion
Example 2
Convert the decimal number 860 to hex
number
Solution:
Desired base is 16, so we repeatedly divide the
given decimal number by 16.
Decimal to hex conversion
Solution
16 860
16 53 ---- 12 (C)
16 3 ---- 5
Hex Number
0 ---- 3
Hence, 860 = 35C16
Decimal to hex conversion
Example 3
Convert the decimal number 2020 to hex
number
Solution:
Desired base is 16, so we repeatedly divide the
given decimal number by 16.
Decimal to hex conversion
Solution
16 2020
16 126 ---- 4
16 7 ---- 14 (E) Hex Number
0 ---- 7
Hence, 2020 = 7E416
Decimal to hex conversion
Hexadecimal to Decimal conversion
In hex number, the column weights (again
from right to left) are as follows:
(163) (162) (161) (160)
4096 256 16 1
hex to decimal conversion
Example 1
Convert AFB216 to decimal number
Solution:
163 162 161 160
A F B 2
4096 x 10 256 x 15 16 x 11 1x2
40960 + 3840 + 176 + 2= 44978
Hence, AFB216 = 44978
hex to decimal conversion
Example 2
Convert BA816 to decimal number
Solution:
162 161 160
B A 8
256 x 11 16 x 10 1x8
2816 + 160 + 8= 2984
Hence, BA816 = 2984
hex to decimal conversion
Example 3
Convert AFFA16 to decimal number
Solution:
163 162 161 160
A F F A
4096 x 10 256 x 15 16 x 15 1 x 10
40960 + 3840 + 240 + 10 = 45050
Hence, AFFA16 = 45050
hex to decimal conversion
Binary to Hexadecimal conversion
Step 1 : Convert binary to decimal
Step 2 : Convert decimal to hexadecimal
binary to hex conversion
Example 1:
Convert the binary number 110102 to
hexadecimal.
binary to hex conversion
Step 1: Convert binary to decimal
Solution:
24 23 22 21 20
1 1 0 1 0
16 x 1 8x1 4x0 2x1 1x0
16 + 8+ 0+ 2+ 0= 26
Step 2: Convert decimal to hex:
Solution:
16 26
16 1 ---- 10 (A)
Hex number
0 ---- 1
Hence, 110102 = 1A16
binary to hex conversion
Example 2
Convert the binary number 100102 to
hexadecimal.
binary to hex conversion
Step 1: Convert binary to decimal
Solution:
24 23 22 21 20
1 0 0 1 0
16 x 1 8x0 4x0 2x1 1x0
16 + 0+ 0+ 2+ 0= 18
binary to hex conversion
Step 2: Convert decimal to hex:
Solution:
16 18
16 1 ---- 2
Hex number
0 ---- 1
Hence, 100102 = 1216
binary to hex conversion
Example 3
Convert the binary number 11112 to
hexadecimal.
binary to hex conversion
Step 1: Convert binary to decimal
Solution:
23 22 21 20
1 1 1 1
8x1 4x1 2x1 1x1
8+ 4+ 2+ 1= 15
Step 2: Convert decimal to hex:
Solution:
16 15
0 ---- 15 (F) Hex number
Hence, 11112 = F16
Hexadecimal to Binary conversion
Step 1 : Convert hexadecimal to decimal
Step 2 : Convert decimal to binary
hex to binary conversion
Example 1
Convert the hexadecimal number 3FD16 to
binary number
hex to binary conversion
Step 1: Convert hex to dec
Solution:
162 161 160
3 F D
256 x 3 16 x 15 1 x 13
768 + 240 + 13 = 1021
hex to binary conversion
Step 2: Convert decimal to binary
2 1021
2 510 ---- 1
2 255 ---- 0
2 127 ---- 1
2 63 ---- 1
2 31 ---- 1 Binary number
2 15 ---- 1
2 7 ---- 1
2 3 ---- 1
2 1 ---- 1 Hence, 3FD16 = 11111111012
0 ---- 1
hex to binary conversion
Example 2
Convert the hexadecimal number 1A216 to binary
number
hex to binary conversion
Step 1: Convert hex to decimal
Solution:
162 161 160
1 A 2
256 x 1 16 x 10 1x2
256 + 160 + 2= 418
hex to binary conversion
Step 2: Convert decimal to binary
Solution:
2 418
2 209 --- 0
2 104 --- 1
2 52 --- 0
2 26 --- 0 Binary number
2 13 --- 0
2 6 --- 1
2 3 --- 0
2 1 --- 1 Hence, 1A216 = 1101000102
0 --- 1
hex to binary conversion
Example 3
Convert the hexadecimal number AF116 to
binary number
hex to binary conversion
Step 1: Convert hex to decimal
Solution:
162 161 160
A F 1
256 x 10 16 x 15 1x1
2560 + 240 + 1= 2801
hex to binary conversion
Step 2: Convert decimal to binary
2 2801
2 1400 ---- 1
2 700 ---- 0
2 350 ---- 0
2 175 ---- 0
2 87 ---- 1
2 43 ---- 1
2 21 ---- 1 Binary number
2 10 ---- 1
2 5 ---- 0
2 2 ---- 1 Hence, AF116 = 1010111100012
2 1 ---- 0
0 ---- 1
hex to binary conversion
Summary
Number system
Binary numbers
Decimal numbers
Hexadecimal numbers
Convert Binary to Decimal
Convert Decimal to Binary
Convert Decimal to Hexadecimal
Convert Hexadecimal to Decimal
Convert Binary to Hexadecimal
Convert Hexadecimal to Binary