0% found this document useful (0 votes)
91 views

01) NUMBER SYSTEM - Sushil Goel

number system sushil goel book pdf

Uploaded by

rjtrix000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
91 views

01) NUMBER SYSTEM - Sushil Goel

number system sushil goel book pdf

Uploaded by

rjtrix000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 22
3.1 Introduction Number systems are very important to understand because the design and organisation of a computer is dependent upon the number systems: Wé are familiar with the decimal number system which is usedin our day-to-day work. The computer, however, does not use the decimal number system. It uses the binary number system which has base 2. This base 2 system uses only two digits, namely 0 and 1, Auser who works on a computers allowed to use decimal digits 0, 1, 2, letters A, B,C, ez nanyG, .ss:nZ, usual special symbols, +, for his convenience. The decimal digits, letters, special symbols etc. are converted to binary codes in the form of 0's and 1's within the computer. To understand the | operation of a computer a knowledge of binary, octal and hexadecimal number system is essential. This chapter deals with these number systems. 3.2 Number Systems Number system is a system in which different numbers can be represented by different ways. In early days, people used to count with the help of stones, fingers, sticks etc. These methods were not adequate. Nowadays, numbers are represented depending upon the position of digit and their specific weights. Definition : P 1. Number System : Anumber system of base (or radix) | risa system that uses different symbols for representing | different digits. | 2. Base or Radix : The base of the number systemisthe |! number of different symbols or digits used in it. 3 [64] a 3.2.1 Types of Number Systems There are two types of number systems : (a) () (a) Non-positional number systems Positional number systems Non-positional number systems In non-positional number system the Position of the symbols or digits is not fixed. One example of g non-positional number system is Roman number system. This system has symbols such as | for 1, Il for 2, III for 3, IV for 4, V for 5 etc. But, there is no symbol corresponding to zero. Dué to absence of zero, this'system is quite inefficient. Arithmetic calculations are very difficult when such systems are used. For example, it is very difficult to us if we want to multiply XI by Vil. (b) Positional number systems In positional number systems, the value of each symbol is determined by its ~ position. For example, the 4 in 400 has a different value than 4 in 40000. Hence the value of each digit (or symbol) in a number depends upon the following: (a) The face value of the digit (b) The base of the number system (c) The position of the digit in the number. One example of positional number system is our familiar decimal number system. In decimal system, there are 10 symbols (0, 1, 2, 3 9). Since it has ten symbols, it has a base (or radix) of 10. Every positional number system has a base or radix. The base of a number system is defined as number of different symbols it recognizes. All number systems have the highest numerical symbol having a value one less than the base. Other number systems of our interest are binary number system, Octat-number system and Hexadecimal number system having base of 2, 8 and 16 respectively. [aN | The largest digit or symbol in a positional number I system is one less than its base. | | The smallest digit or symbol in a positional number system is always zero. Ses ee ee [65] 3.4.1 Necessity of Binary Number System 3.5 The reasons are : 4, _ Electronic components by their nature, Operate in a binary mode. A switch is either on (1 state) or off (0 state); a transistor is either conducting (1) or non- conducting (0) 2, Computer circuits have to handle only twobinary digits (bits) rather than 10. So, binary system simplifies the design, reduce the cost and improve the reliability of computer system. 3. Everything that can be done with decimal system can also be done in binary system. The binary numbers can.be converted into decimal numbers and decimal into binary numbers. A binary number having n bits in its integer part and m bits in its fractional part can be changed to decimal number by the formula : d, 2+ d,_, 27% td, 29d 2d 2 +. td om Where d, is the most significant bit and d__ is the least significant bit of the binary number. For example, a binary number 1010 (written as (1010),) is represented in decimal number as : (1010), = 1 x 2°+ 0x 2?+1x2'+0x2° =8+0+2+0=10 Thus, the binary number (101 0), is equal to the decimal number (1)... Octal Number System Octal number system has a base of 8 andit uses the digits 0, 1, 2,3, 4,5, 6, 7. The .. 8°, 8, 8', 8% 8 Values assigned to the Consecutive places in the sytems are ... aa ‘al numbers can be converted . Where 8° place is the unit place. The oct - into decimal numbers and vice-versa. e [67] Example 3.1 Convert the following decimal numbers into binary : (i) 25, (ii) 121 Solution : (i) \ \ 25 Remaintlers ...Least significant digit ...Most significant digit 121 Remainders 60 1 30, 0 15 0 7 1 3 1 al ah 0 I Thus (121),, = (1111001), Example 3.2 Convert the following decimal numbers to octal number (i) 125 (ii) 952 Solutio (i) Thus (125),, 125 _- Remainders 15 5 23 a 0 i = (175), 169] Therefore (135),. = (2013), 3.8 Conversion of Fractional Decimal Number toa Number in Another Base : Following steps are used to conven a‘fractional decimal number to a number in another base. : : 1. Multiply the given decimal fractional by the value of thenew base. 2. Record the integral (orcarry) part of the product as the most significant digit (MSD) of new’base fractional. 3. Multiply the fractional part of fhe product by the value of the new base. * 4. “Record the integral (or carry) part of the product as the.next significant igi. 5. Repeat:steps (3) and (4) until the fractional part of the prduct becomes zero or we get the previous or repeated fractional part. Record the last integral (or carry) part of the product as the least significant digit (LSD) of new base fractional. (71) example 3.6 convert the decimal number 116.5625 to binary golution : 0} Integral Part 2 | 116 Remainders memset Lo zoo wel ia i 2 as 1 i. Tz... Thus (116),, = (1110100), =a) ti _— Fractional Part 5625 Carry 2 : 1 1250 2 0 . 2500 2 0 . 5000 2 1 0000 Thus (.5625),, = (.1001), w(2)_ from (1) and (2) (116.5625), = (1110100.1001), [73] Example Bi i a Convert the following decimal numbers to octal number (i) 0.625, (ii) 225 .225 Solution : (i) ar i ks : Cooma: Carty 5 8 ies ee) ~ 000 Thus (.625),,. = (-5), (ii) (a) Integral Part (225) 8 225 Remainders Rayer [ee 1 ‘s,s 0 3 Thus (225). = (341), (b) Fractional Part (.225) 225 Carry ae) 1 800 ee 6 400 i 8 3 .200 8 1 600 8 Thus, (.225),, ="(.16314 (6314), Recurring Hence, (225.225),,= (341.16314(6314)), \ [74] 3.9 Conversion From Another Base ante to Decimal} Number The Following steps are used to convert a number in any other base to a decima| number. 1. Determine the positional value of each digit according to the position of the digit and the base of the number system. 2. Multiply the obtained positional value of step 1 by the respective digit 3. Sumup the product calculated in step 2. The total is the equivalent value in the decimal. Example 3.9 Convert the following binary numbers into decimal form (i) 110 (ii) 10101010 (iii) 1100.001 Solutions : (i) (110), 1x2? + 1x2" + 0x2” ~ ono) = 6 Hence (110), = (6), {ii) (10101010), = — 1x27 + 0x25 + 1x25 + 0x24 + 1x23 + 0x22 41x21 + 0x29 = 128+0+32+0+8+0+2+0 = 170 (i) (1100.001), = 1x23 + 1x22 + 0x2" + 0x29 + Ox2"1 + 0x22 + 1x29 = Br4 4040404042 eee a5) Example 3.10 Convert the following octal numbers to decimal numbers (i) 305 (ii) 7532.1 625 | Solution : (i) (05), =~ 3x8? + 0x8! + 5x80 192+ 0 +5 = 197 [74] eee ie () 7582625 = 7x89 4 x52 4 3x81 + 2x80 + 6x8-14 2x82 + 5x8- = 3584 + $204.24 4240754 0.03125 + 0.009765625 = 3930.791015625 = 3930,791 ~ Example 3.11 Convert the following hexadecimal numbers into their decimal equivalents : (i) (BFA. 8),, (i) (SBFC),, Solution : (i) (GFA8),, = 8x16? +Fx161 + Ax169 + 8x16-1 = 3x256 + 15x16 + 10x1 + = 768+240+1040.5 2 = 10185 Thus (3FA.8),, = (1018.5),, (i) (BBFC), = 3x168 + Bx162 + Fx161 + C x16 meee = 8x4096 + 11x 256 + 15x16 + 12x1 = 12288 + 2816 + 240 +12 = 15356 Thus (3BFC),, = (15356), Example 3.12 : Solve (3012), = (?),, Solution : (3012), = 3x 6°+0x6?+1 x6'+2x 6° = 648+0+6+2 = 656 There (3012), = (656), 3.10 Conversion of Octal Number into Binary & Vice-Versa Octal system has.a base of 2° = 8, so for binary to octal conversion make groups Of the three digits from right to left in the integer part of the binary number and an left to right in the binary fractional part. These groups of three are replaced by their Octal equivalents as shown in the table 3.2. [77] Asthe rightmost; iaeiblice 1011 a0) he (54), (v) (11110000101), 011 «110 " o o (3605), (vi) (.11911), 110 110,- (Note) wn we Sue (.66),. (vi. 1010.1010 = 001 010.101 (Note) 1 2 5 000 ween ee ° (12.50), ~ " Example 3.14 ° Convert the following octal numbers into their binary equivalents : (i) 305 (ii) 225.34 Solution : Replace each octal digit by aset of three binary digit and group these together. (i) (305), = 3 0 5 nnn = 011 000 101 = (011000101), = (11000101), i) 225.34 = 2 32S eee ewer ere 5 010 010 101- .011 100 = (010010101.011 100), pe = (10010101,0111), i (79) (i) (1101011101), = 0011 0101, 1101 “en ee = 3 5 gingeD = (35.D),, (ii) 0.10110 = 0.1011 0000 wn = EB © = (0.B0),,, = (0.B),5 Example 3.16 Convert the following hexadecimal numbers into their binary equivalents. (i) A4. B (ii) 1BCE Solution : () (A4.B), = A 4 B wr een ee = 1010 0100 1011 = (10100100.1011), (i) IBCE = 1 BS Ce ae ween Oe = 0001 1011 1100 1110 = (11014 1100 111 0), 3.12 Conversion of An Hexadecimal Number into Octal Number and Vice-Versa Steps are : 1. Convert the source number to a binary number. 2. Convert the binary number so obtained to the target number. (81) 48. Solve the following : ( A9)jq * Ms (i) (1000), = (ro (ill) (B77B),g = ("a (iv) (22011), = (Mo (Y) (B77) yo = (Ps (Wi) (241401)g = (*ro (vil) (8584) ,9 = (Me (vill) (221) = (Pro Answers 9 (iii) 307 (v) 26.875 (wii) 22 (i) 10011 (ili) 1101101,001 (v) 10001.01001 (1001) (i) 183.328125 (iii) 923.077 (i) 231.2 (iii) 1262.5 (v) 413.(7534121727024365605) (i) 555.5 (iii) 153.52 (i) 10101001.010101 (i) 4246625 (iii) 2748.1250 (i) 149F (ii) 1096.4 (i) AeD (iii) 5C.8A (i) 10101011 1100 (ili) 10 1011 0011 1100 0100 1111.0101. (ii) (iv) (vi) (ii) (iv) (ii) (iv) (ii) (iv) (ii) 109 3510 27.375 1101111 11011101,0011 345.296875 174.724609375 666.1 3234.01463 (1463) 24723.54 1101010111.01111001 687.625 1961 416.4 4D2.C 3D 1011 1100 11011 110. 101

You might also like