COMPUTER SYSTEM AND ORGANISATION MODULE 36 BY Mrs
COMPUTER SYSTEM AND ORGANISATION (MODULE 3/6) BY Mrs. SUJATA PRADHAN PGT(SS), AECS, ANUPURAM
Number System A Number System is defined as a system of writing to express numbers. It is the mathematical notation for representing numbers of a given set by using digits or other symbols in a consistent manner. The same sequence of symbols may represent different numbers in different numeral systems. The number system or the numeral system is the system of naming or representing numbers. There are various types of number systems like binary, decimal, octal etc. . Number System with a specific type provides a unique representation of every number. The value of any digit in a number can be determined by: • The digit • Its position in the number • The base of the number system
TYPES OF NUMBER SYSTEM • Decimal number system uses ten unique digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Any decimal number can be represented using these ten digits only. Since there are ten unique digits in Decimal number system, the base or radix of the Decimal number is 10. • Binary number system has two unique digits 0 and 1. Any binary number can be represented using these two digits only. Since there are 2 unique digits in Binary number system, the base or radix of a binary number is 2. • Octal number system uses eight unique digits 0, 1, 2, 3, 4, 5, 6, 7. Any Octal number can be represented using these 8 digits only. Since there are 8 unique digits in Octal number system, the base or radix of an Octal number is 8. • Hexadecimal number system has sixteen unique digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10(A), 11(B), 12(C), 13(D), 14(E), 15(F). So every hexadecimal number can be represented using these 16 digits only. Since there are sixteen unique digits in Hexadecimal number system, the base or radix of a Hexadecimal number is 16.
Decimal number system Decimal Number System consists of 10 digits which are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. As base of this system is 10 , it is to be shown as (Decimal Number)10 Ex. (435)10. This is based on positional value where the weightage of a digit is as per its position. For ex- In the analysis of number 435 , the value of 5 is 5(=5 X 100) as it is in unit’s place, value of 3 is 30(=3 X 101 as it is in tenth place and value of 4 is 400(=4 X 102 ) as it is in hundredth place in Decimal Number representation. We can write the following numbers as: 526 = 5 X 102 + 2 X 101 + 6 X 100 25. 32 = 2 X 101 + 5 X 100 + 3 X 10 -1 + 2 X 10 -2 The left most digit is called MSD (Most Significant Digit ). The right most digit is called LSD (Least Significant Digit ). Numbers can be represented in any of the number system categories like binary, decimal, hex, etc. Any number which is represented in any one of the number system types can be easily converted to another. Let us learn how to convert a decimal number into binary, octal and hexadecimal and vice versa using various examples.
Decimal to Binary Method to convert a Decimal number into its Binary equivalent: 1. Divide the decimal number by 2. 2. Take the remainder and record it on the side. 3. Divide the quotient by 2. 4. Repeat the same until the decimal number cannot be further divided. 5. Write the remainders in reverse order to get the resultant binary number. Convert the Decimal number (125)10 into its Binary equivalent. Repeated Division by 2 Quotient Remainder 125 / 2 62 1 62 / 2 31 0 31 / 2 15 1 15 / 2 7 1 7 / 2 3 1 3 / 2 1 1 1 / 2 0 1 Reading the remainders from bottom to top Answer: (1111101)2 ∴ (17)10 = 100012
Decimal fraction to Binary Method to convert a Decimal number into its Binary equivalent: 1. Multiply the given fraction by 2. Keep the integer in the product aside and multiply the new fraction in the product by 2. 3. Continue the process i. till the required number of decimal places. Or ii. till you get zero in the fraction part. 4. Read the integers in direct order as its binary equivalent. 1. Convert the Decimal fractional number (0. 47)10 to Binary. 0. 47 * 2 = 0. 94 Integral part: 0 0. 94 * 2 = 1. 88 Integral part: 1 0. 88 * 2 = 1. 76 Integral part: 1 0. 76 X 2 = …… Reading the integers from top to bottom Answer: (0. 011)2 2. Convert the Decimal fractional number (0. 75)10 to Binary. 0. 75 X 2 = 1. 50 Integral part: 1 0. 50 X 2 = 1. 00 Integral part: 1 Reading the integers from top to bottom Answer: (0. 11)2
EXAMPLE • • To convert a Decimal integer into Binary keep dividing by 2 until quotient is 0(zero). Collect the remainders in reverse order to get the binary equivalent. To convert a fraction, keep multiplying the fractional part until it becomes zero. Collect the integers in direct order to get the binary equivalent. Convert (105. 15)10 to binary Let us convert 105 first. …. 128 64 32 16 8 4 2 1 …. 27 26 25 24 23 22 21 20 1 1 0 1 0 0 1 So (105)10 = (1101001)2 Let us convert (0. 15) 10 Multiply 0. 15 by 2 [0]. 30 Multiply 0. 30 by 2 [0]. 60 Multiply 0. 60 by 2 [1]. 20 Multiply 0. 20 by 2 [0]. 40 Multiply 0. 40 by 2 [0]. 80 Multiply 0. 80 by 2 [1]. 60 Reading the integers from top to bottom (0. 15)10 = (0. 001001)2 Final result (105. 15) 10 = (1101001. 001001)2
Decimal to Octal Conversion Decimal to Octal : Method to convert a Decimal number into its Octal equivalent: 1. Divide the decimal number by 8. 2. Take the remainder and record it on the side. 3. Divide the quotient by 8. 4. Repeat the same until the decimal number cannot be further divided. 5. Write the remainders in reverse order to get the resultant octal number. Decimal fraction to Octal: Multiply the given fraction by 8. Keep the integer in the product as it is and multiply the new fraction in the product by 8. Continue the process and read the integers in the products from top to bottom.
Decimal to Octal Conversion
Decimal to Hexadecimal Method to convert a Decimal number into its Hexadecimal equivalent 1. Divide the decimal number by 16. 2. Take the remainder and record it on the side. 3. Divide the quotient by 16. 4. Repeat the same until the decimal number cannot be further divided. 5. Write the remainders in reverse order to get the resultant octal number. Decimal fraction to Hexadecimal: Multiply the given fraction by 16. Keep the integer in the product as it is and multiply the new fraction in the product by 16. Continue the process and read the integers in the products from top to bottom. Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B Decimal 1 2 3 4 5 6 7 8 9 10 11 12 0 C D E F 13 14 15
Solved Problems
New Base System to Decimal Number System A decimal number can be expressed as : (14. 5 )10 = 1 x 101 + 4 x 100 + 5 x 10 -1 A binary number in Decimal form : (1011. 1)2 = 1 x 23 + 0 x 22 + 1 x 21 + 1 x 20 + 1 x 2 -1 An octal number in Decimal form: (335. 17)8 =3 x 82 + 3 x 81 + 5 x 80 + 1 x 8 -1 + 7 x 8 -2 A hexadecimal number in Decimal : (1 BC. 2)16 = 1 x 162 + C x 161 + F x 160 + 2 x 16 -1
Conversion of Binary to Decimal 1. Convert 101012 to Decimal. 101012 = ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10 = (16 + 0 + 4 + 0 + 1)10 = 2110 2. Convert (11011. 101)2 to Decimal. 24 23 22 21 20. 2 -1 2 -2 2 -3 1 1 0 1 1 . 1 0 1 11011. 1012= (1 x 24)+ (1 x 23)+ (0 x 22)+ (1 x 21)+ (1 x 20)+ (1 x 2 -1)+ (0 x 2 -2)+ (1 x 2 -3) = 16+8+0+2+1+0. 5+0+0. 125 = (27. 625)10
Octal &Hexadecimal to Decimal conversion Convert 2158 into decimal. 2158 = 2 × 82 + 1 × 81 + 5 × 80 = 2 × 64 + 1 × 8 + 5 × 1 = 128 + 5 = 14110 Convert ( 2 1 )8= ( ? )10 21. 21 8 = 2 x 81 + 1 x 80 + 2 x 8 -1 + 1 x 8 -2 = 2 x 8 + 1 x 1 + 2 x ( 1 / 8 ) + 1 x ( 1 / 64 ) = 16 + 1 + ( 0. 2 5 ) + ( 0. 0 1 5 6 2 5 ) = 17 + 0. 265625 = 17. 265625 Therefore ( 2 1 )8 = ( 1 7. 2 6 5 6 2 5 )10
SUMMARY • Types of Number System • Decimal to Binary, Octal and Hexadecimal conversion for both integer and fraction • Binary , Octal , Hexadecimal to Decimal conversion for both integer and fraction • Numerous examples for all types of conversions
THANK YOU
- Slides: 16