230 likes | 324 Views
Chapter 19. Representation of Data within the Computer. Information stored in a computer is in two states:. ON OFF. They are represented by the binary digits ‘1’ and ‘0’ respectively. As the number of bits increases, the bit pattern is increased and more information can be stored.
E N D
Chapter 19 Representation of Data within the Computer
Information stored in a computer is in two states: • ON • OFF
They are represented by the binary digits ‘1’ and ‘0’ respectively. • As the number of bits increases, the bit pattern is increased and more information can be stored.
19.1 Number Systems • Numbers can be represented in different number systems: • Denary number system • Binary number system
Octal number system • Hexadecimal number system
Denary Number System • Digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 are used to represent numbers. • It is a base-10 number system. • A number is formed by the combination of the digits, for example 2110, 10310, 0.310.
Denary Numbers in Expanded Form Example 19.1 The denary number 419210 in expanded form is:
i.e. + 9 101 419210 = 4 103 + 1 102 + 2 100
Example 19.2 The decimal fraction 0.21310 in expanded form is:
i.e. 0.21310 = 2 10–1 + 1 10–2 + 3 10–3
Binary Number System • Digits 0 and 1 are used to represent numbers. • It is a base-2 number system. • A number is formed by the combination of the digits, for example 102, 1102, 0.012.
Binary Numbers in Expanded Form Example 19.3 The binary number 11112 in expanded form is:
i.e. + 1 21 11112 = 1 23 + 1 22 + 1 20
Example 19.4 The binary fraction 0.10112 in expanded form is:
i.e. + 1 2–3 0.10112 = 1 2–1 + 0 2–2 + 1 2–4
Octal Number System • Digits 0, 1, 2, 3, 4, 5, 6 and 7 are used to represent numbers. • It is a base-8 number system. • A number is formed by the combination of the digits, for example 1238, 4708, 54318.
Octal Numbers in Expanded Form Example 19.5 The octal number 3578 in expanded form is:
i.e. + 7 80 3578 = 3 82 + 5 81
Hexadecimal Number System • Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and letters A, B, C, D, E, F are used to represent numbers. • It is a base-16 number system.
A number is formed by the combination of the digits and the letters, for example 2C4D16, A9516.
Hexadecimal Numbers in Expanded Form Example 19.6 The hexadecimal number 2C3D16 in expanded form is:
i.e. 2C3D16 = 2 163 + 12 162 + 3 161 + 13 160