Week No. 06: Numbering Systems Numbering System: A numbering system defined as A set of values used to represent quantity. OR A number system is a term used for a set of different symbols or digits, which represent a numerical value. Types of Numbering System: Numbering Systems are basically of two types: 1. Non-Positional Numbering System 2. Positional Numbering System 1. Non-Positional Numbering System: In early days, human being counted on fingers, stones, pebbles (stones/sand) or sticks (woods) were used to indicate values. This method of counting an additive approach or the non-positional number system. In this system, we have symbols such as I, II, III, IV etc. 2. Positional Numbering System: In positional numbering system, there are only few symbols called digits, and these symbols represent different values depending on the position they occupy in the number. The value of each digit in such a number is determined by three considerations: The digit itself, The position of the digit in the number, and The base of the number system. Types of Positional Numbering System: The following are some basic positional numbering systems: Decimal Number: It has ten digits: 0 9 Decimal number system has a base of 10. Each digit in decimal number represents a certain value or quantity If a value or quantity is greater than nine, two or more digits then, For example: - 23 = 2 10 1 + 3 10 0 = 2 x 10 + 3 x 1 = 20 + 3 = 23
Weight: Weight for whole numbers are positive powers of ten that increase from right to left and beginning with 10 0 =1 and weight depend on position of the digit. So decimal number system has a base of 10..10 4 10 3 10 2 10 1 10 0 For fractional numbers: Weights are negative powers of 10 that decrease from left to right and beginning with 10-1 = 0.1.... 10 3 10 2 10 1 10 0. 10-1 10-2 10-3.. Decimal Point Examples: (1) Express 47 as sum of the values of each digit. (2) Express 568.23 as sum of the values of each digit. Sol 01: 47 = 4 10 1 + 7 10 0 = 4 x 10 + 7 x 1 = 40 + 7 = 47 Sol 02: 568.23 = (5 10 2 + 6 10 1 + 8 10 0 ) + (2 10-1 + 3 10-2 ) = (500 + 60 + 8) + (0.2 + 0.03) = 568 + 0.23 = 568.23 Binary numbers: Another way to represent quantities The binary number system uses two digits to represent numbers: the values are 0 & 1. This numbering system is sometime called the Base 2 numbering system: (0, 1) 2 BInary digit is often referred to the common abbreviation of BIT. Thus, a bit in a computer terminology means either a 0 or a 1. This number system is natural to an electronic machines or devices as their mechanism based on the OFF or ON switching of the circuits. Therefore, 0 represent the OFF & 1 represent ON state of the circuit. Less complicated then decimal system because it has two digits, 0 or 1. Weights in binary numbers are based on powers of two. It has two digits (bits) 0 or 1. It has a base of 2 e.g..2 3 2 2 2 1 2 0 For fractional numbers:..2 3 2 2 2 1 2 0. 2-1 2-2 3-3.. Binary Point LSB (Least Significant Bit) is the right most bit e.g. 2 0 = 1 MSB (Most Significant Bit) is left most bit, it depend on the size of binary numbers. For fractional numbers: MSB is the left most bit e.g. 2-1 = 0.5 LSB is the right most bit e.g. 2 -n
Octal Number: Like the hexadecimal number system, the octal number system provides a convenient way to express binary numbers and codes; however, it is used less frequently than hexadecimal. The octal number system is composed of eight digits which are: 0, 1, 2, 3, 4, 5, 6, 7 The octal number system has a base of 8. Each octal digit represents a 3 bits binary number. Weight:.8 3 8 2 8 1 8 0 Table: Hexadecimal Number: Hexadecimal number system has sixteen characters. The hexadecimal number system consists of digits 0-9 and letters A - F. The hexadecimal number has a base of sixteen. It is composed of 16, numeric and alphabetic characters. Each hexadecimal digit represents a 4-bits binary number. Weight:.16 3 16 2 16 1 16 0 Ten numeric and six alphabetic characters make up the hexadecimal number system. Table: Decimal Binary Octal 0 0 0 0 0 1 0 0 1 1 2 0 1 0 2 3 0 1 1 3 4 1 0 0 4 5 1 0 1 5 6 1 1 0 6 7 1 1 1 1 7 Decimal Binary Hexadecimal 0 0 0 0 0 0 1 0 0 0 1 1 2 0 0 1 0 2 3 0 0 1 1 3 4 0 1 0 0 4 5 0 1 0 1 5 6 0 1 1 0 6 7 0 1 1 1 7 8 1 0 0 0 8 9 1 0 0 1 9 10 1 0 1 0 A 11 1 0 1 1 B 12 1 1 0 0 C 13 1 1 0 1 D 14 1 1 1 0 E 15 1 1 1 1 F
Conversions: Binary to Decimal conversion: Examples: (1) Convert 1 1 0 1 1 0 1 to Decimal Number (2) Convert 0.1 0 1 1 to Decimal Number Sol. 01: 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 1 0 1 1 0 1 = 1 x 2 6 + 1 x 2 5 + 0 x 2 4 + 1 x 2 3 + 1 x 2 2 + 0 x 2 1 + 1 x 2 0 = 1 x 64 + 1 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1 = 64 + 32 + 0 + 8 + 4 + 0 + 1 = 109 Sol. 02: 2 0. 2-1 2-2 2-3 2-4 0. 1 0 1 1 = (0 x 2 0 ) + (1 x 2-1 + 0 x 2-2 + 1 x 2-3 + 1 x 2-4 ) = (0 x 1) + (1 x 0.5 + 0 x 0.25 + 1 x 0.125 + 1 x 0.0625) = (0) + (0.5 + 0 + 0.125 + 0.0625) = 0 + 0. 6875 = 0. 6875 Related problems: Convert 1 0. 1 1 1 to decimal number Binary to Octal conversion: Binary to Octal conversion has the following procedure: Start with the right-most group of three bits Moving from right to left but in fraction moving from left to right. Convert each 3-bit group to the equivalent octal digit. If there are not three bits available for the left-most group, add either one or two zeros to make a complete group. These zeros don t affect the value of binary number. Examples: Convert each of the following binary numbers to octal: a. (110101) 2 b. (101111001) 2 c. (100110011010) 2 d. (11010000100) 2 a. 110101 b. 101111001 c. 100110011010 6 5 = (65) 8 5 7 1 = (571) 8 4 6 3 2 = (4632) 8
d. 011010000100 3 2 0 4 = (3204) 8 Now convert binary number (containing fraction) to octal: a. (11.1011011) 2 b. (0.101111010101) 2 Sol: a. 011.101101100 b. 000.101111010101 3. 5 5 4 = (3.554) 8 0. 5 7 2 5 = (0.5725) 8 Related Problem: 1. Convert the binary number: (1010101000111110010) 2 to octal. 2. Convert the binary number: (101010100011111.0010) 2 to octal. 3. Convert the binary number: (111.111) 2 to octal. 4. Convert the binary number: (0.101111010101) 2 to octal. 5. Convert the binary number: (110110.011) 2 to octal. 6. Convert the binary number: (1111.1101) 2 to octal.