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

Number System

The document provides an overview of number systems, categorizing them into non-positional and positional systems, with examples such as Roman numerals and various positional systems like decimal, binary, octal, and hexadecimal. It explains the significance of digit positions and weights in these systems, along with methods for converting numbers between different bases. Additionally, it details the steps for converting numbers from any base to decimal and vice versa.

Uploaded by

sam.vir909
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
9 views

Number System

The document provides an overview of number systems, categorizing them into non-positional and positional systems, with examples such as Roman numerals and various positional systems like decimal, binary, octal, and hexadecimal. It explains the significance of digit positions and weights in these systems, along with methods for converting numbers between different bases. Additionally, it details the steps for converting numbers from any base to decimal and vice versa.

Uploaded by

sam.vir909
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 18
INTRODUCTION Number system is a system in which different numbers can be represented by different ways. In past times, numbers are counted on fingers or represented by number of lines. Nowadays numbers are represented depending upon the position of digit and their specific weights. So number system can be classified into two broad categories 1. Non-positional number system 2. Positional number system Non-positional number system : In non-positional number system the position of the digits is not fixed. ROMAN number system is an example of Non-positional number system. Roman numbers has symbols as | for 1, Il for 2, IIT for 3, IV for 4 etc. But the main drawback of non-positional number system is that there is no symbol corresponding, to zero. Due to the absence of zero, this system is quite inefficient. In. this type of system, arithmetic calculations are very difficult 2 Positional number system :- The most widely used number system is the positional number system. In this system the position of a digit indicates the significance to be attached to that digit. Positional number systems have a radix or base: We will discuss in detail the positional number systems In the followin; Binres OF NUMBER SYSTEMS tay tional number systems are of different types that are used to represent numeric data. System is characterised by <= oi symbols used in the system. system that are combined to represent numeric daty (a) Base Le. number of distinct (0) Set of distinct symbols used in the The different number systems are = 5.1.1 Decimal number system In this number system there are ten digits which are used symbols are from 0 to 9. So the base of this number system is 10. Every digit in this system is assigned a weight. These weights are as follows = to form decimal numbers. They concen 104, 108, 107, 104, 10° If the decimal number contains a decimal point, the weights are 108, 10%, 10, 108, 10, 10-4, 10°, 10, eg. the decimal number ZH5 that can be written as (2345)i9 consists of the digit 5 in the units position. 4 in the tens position, 3 in the hundreds position and 2 in the thousands Position and its value can be 21D 631 esx tOle Sx 1? = DOD + M+ We Se DS and (567 89),o can be represented by 510 660108 6 71 81 9% 107 = S00 + +7 +08 + 00) = 6789 Soa decimal number with n integer and m decimal digits can be expressed as any 2 2, 2 ant 10! + ag.2 10” Fa WP oat sage sag om where a) is the coefficient of the weight 10! 5.1.2 Binary number system In binary number system there are two di form yumibers- » digits or bits which These bits are and 1. So the base of this number system ie 2. Each poate ne nub Tepresents a power of the base ie. 2. Every digit in this system is, islet cel = follows > 223,22, 21, 20, If there is a decimal point in a number then the weights are + 24,23, 22, 21,20, 2-1 92 9d Abinary no. with n integers and m decimal di ant 271 + agg 224, its can be expressed as : MM sare eagrey oo + gy 2 A NUMBER SYSTEM binary number 1011 = eg the binary O that can be written as (10110)p, its value in decimal can be: (10110), TxA O Me areatyg so 164044424005 (OA, — =1x23 49,92 +1x 214190 =84+042414054025 =(11.75)19 41x24 41x22 5.1.3 Octal number system In octal number system there are 8 digits which are used to form octal numbers. These digits are 0, 1, 2, 3, 4, 5, 6, 7. So the base of this number system is 8. Every digit in this system is also assigned a weight as follows - 89, 82, 81, 90, If there is a decimal Point in a number, then the weights are 83, 82, 81,80 g-1g-2 53 An octal number with n integers and m decimal digits can be expressed as:- tan OM eg. the octal number 675 that can be written as (675)g its value in decimal can be an 8° + ang 82 +. + a9 80+ ai8l+a 8? (675)g =6x87+7x 8145x280 = 384 +56 +5 =(445)19 (125.75) = 1x 82+2x81+5x894+7x8145x82 4 + 16 +5 + 0.875 + 0.078125 = (85.953125)19 ber in binary make group of three bits from Octal Number System : To represent octal num wary make gr tight to left in ie part of binary number and from left to right in fractional part. It represents the number that consists digits from 0 to 7 only. Octal Number Binary Number Decimal 0 000 : 1 001 2 010 7 3 ou | a 4 100 4 5 101 | 5 6 no: \ 6 7 im 7 =a mene 5.1.4 Hexadecimal number system here are sixteen digits which are used to form hexadecima, In hexadecimal number $) tem tl : adecimal nu yaa, 4, 5, 6 7 8 9 & B,C, D, EF So the base of this number jeight as follows numbers. These digits are 0, 1, 2, 3, 4 > system is 16. Every digit in this system is assigned a W' 162, 162, 161, 16° If there is a decimal point ina number then the weights are 163, 162, 161, 16°, 167, 162, 16°, thn integers an mal digits can be expressed as dm deci 1p ag lo? tm (IAP)16 its value in decimal can be ‘A hexadecimal number wit +amio™ GP 24 cane ag 169+ AA 167 an-1 16°) + an-2 1 the hexadecimal no. [AF which can be written as eg. (IAB)g = 1x16? + Ax 161 + Fx 16° = 256 +10x 16 + 15x1 = 256 + 160 + 15 = (431)10 (45816 = 4x16" 45% 16048x 167 = 6445 +05 = (69.5)10 Hexa-Decimal Number System : The digits from 0t09 10 is represenied by ATI by B, 12 by C, 13 by D, 14 by Ean representted by 10 in hexadecimal system ; 17 by 11; 18 by 127 lises the digits 0 to 9 and A to F. Since it has base 2! = 16, therefi are same as decimal number system d 15 by F. The decimal number 16% 19 by 13, 20 by 14 and so on. It ore every hexadecimal digit can berepresented asa group of 4bitsas shown in table Decimal Octal Number Binary Number 0 0 0000 1 | 0001 : 2 0010 : 3 0011 : : 0100 ; 2 0101 _ c 0110 4 ou . 8 . 1000 9 : 1001 A n : 1010 1011 NUMBER SYSTEM 9° or ee 5.5 | oe ¢ 1100 D n01 J4 E 1110 15 F uu EAI CONVERSIONS FROM ONE NUMBER SYSTEM TO ANOTHER "(1/1 We use decimal numbers in our daily life. However in computer, numbers can be in different forms like binary, octal or hexadecimal. So any number value in one number system can be represented in any other number system. So numbers are to be converted from one form into another form. And there are various methods and techniques to convert a number in one form into a number in another form. §.2.1 Converting from any number system into decimal number system There are three steps for converting any number system into decimal : 1. Consider the weight associated with each digit position. 2. Multiply each digit with the weight associated. 3. Add all of them to get the decimal equivalent. 1. Binary to decimal conversion Ex.1 (110010)2=( 10 Solution Step1 Weights = 25, 24, 23, 22, 21, 2° Step2 Starting from LSB to MSB 1x 2541 %2440x23 +0x2241x2! +020 Step3 32+16+0+0+2+0=(50)10 Ex2 (1011101)2=(_)10 Solution 1x26 40x25 +1x2t+1x23 41x22 40x21 41x20 =64404164844+0+41=(93)10 Ex.3 (1011.11)2=( 10 Solution 1x23 40x 22+ 1x2! +1x2041x21 41x27 =84+04+241+05+0.25 =(11.75)10 NUMER Sy Ex.4 — (11110.0101)2=( 10 3 2a x2! 40x2040x21 + 1x2? 0x2" 41x24 Solution 1x 24+1x23+1x =16+84442+0+04025 +0 + 0.0625 = (30.3125)10 2. Octal to decimal conversion Ext (456)8=( 10 Solution Step1- Weights = 82, 8!, 80 Step2. 4x8245x8l+6x80 Step3 256 +40 + 6 = (302)10 Ex.2 (7525)g=( 10 Solution 7x 83-+5x82+2x8! 45x80 = 3584 + 320+ 16 +5 = (3925)10 Ex.3 (502327)g=( 10 5x82+0x8142x804+3x81+2x82+7x89 =5x64404+2%14+3/842/64+7/512 = (322.4199)10 Ex.4 — (12754)g=( )10 1x824+2x8147x8045x81 44x82 =64416+7+5/8+4/64 = 87 +.0.625 + 0.0625 = (87.6875)10 Solution Solution 3. Hexadecimal to decimal conversion Ex.1 (1A5)16=( 10 Solution : Step1 Weights =162, 161, 160 Step2 1x162+Ax16145x 160 Step3 256+ 10x 16+5x1 = (42110 = NUMBER SYSTEM p.2 — FIAIE=(— ag solution FRIG + 1X 1674 Ax 1647 160 15x 4096 + 256+ 10x16 4.7 = 61440 + 256 + 160 +7 = (61863)1 Ex.3 (A23D)i6=( ig 1 Solution 1x16 + AX 16142168 43x 1614 Date? = 256 + 160 +2+3/16 + 13/256 = (418.238)19 Ex (6B0.8)16=(—)io Solution 6x 167 +Bx 16! 40x 162 48x 161 = 1536 + 176+0+05 =(1712.5)19 4, Any other base to decimal conversion Ex. (425)6=( 10 Solution 4x62+2x6145x69 =1444+124+5=(161)10 Ex2 (1425.55) =( 10 Solution 1x93 44x92 42x91 45x90 +5x91+5x97 = 729 +3244 18+5+5/9+5/81 = (1076.6057)10 5.2.2 Converting decimal number system into any number system For these types of conversions dibble dabble method is used. Steps for this conversion are (for numbers without decimal point). 1. The decimal number is successively divided by 2 —— = recorcled. The first remainder found is called least significant digit (LSD) and the last is called most significant digit (MSD). m MSD to LSD gives the target number the steps are: yy the base of the target number till the 3. The remainder written fro! i i rt, lf the number has a decimal point then for this fractional pa a 1. The fractional partis multiplied successively By farget Past. EF 5 | ra ‘ 2. The carry over part and fractional part are sepa J ll the product ofthe facta, continue 3. The fiat carry isthe MSD andl he Pre required number of digits are obtained. Oor part and target number becomes 1, Decimal to binary conversion Bel (@noe(a fed by 2 continuously until the is divic Solution To convert this to the binary number It | remainder is 1 Pemarter 2 | ¢o | 0(LS8) 2) 0/0 2] s/t 2 ' z) 3/1 So binary equivalent of 60 = (111100) Ex2 n0=( n Solution we 9 i; 2 s7/| 1 | 2) 2 0 | 2) val 0 2] zis 2 ait 2) (MS) (22919 = (11100101)2 Ex3 O7n0=( 2 Solution — To convert a fractional number it is multiplied by 2 continuously until the product becomes 0 or upto required number of digits. "NUMBER SYSTE, 2. The carry over part and fractional part are separated. 3. The first carry is the MSD and the process is continued till the product of the fractional part and target number becomes 0 or the require 1. Decimal to binary conversion Ex.1 Solution. (6010 = 2 d number of digits are obtained. To convert this to the binary number it is divided by 2 continuously until the remainder is 1. Remainder 2 | 60 | O(LSB) 4 2|30|0 2) ei! oe 2) 3)1 2| 1+ (MsB) So binary equivalent of 60 = (111100) Ex.2 (229)10 = ( M2 Solution Remainder 2 | 229) 1 (LSB) 21114] 0 2| 57) 1 2} 28) 0 2| 14] 0 2) 741 21 8)1 2 | 141 (Msp) (229)19 = (11100101)2 Ex.3 75)10=( )2 Solution To convert a fractional number it is multi becomes 0 or upto required number of di; plied by 2 continuously until the product gits. NUMBER SYSTEM 5.9 | 0.75x2=150 va 0.50 x2= 1.00 1 (LSB) So (0.75)10 = (0.11) Ex.4 (27.575)10=(—)2 Solution Remainder 2/27 |1(MSB) 2|a3 {4 2} 6\0 2 3} 1 2 +91 (LSB) Carry 0.575 x2 = 1.150 1MSB 0.150 x 2 = 0.30 0 0.30 x 2 = 0.60 0 0.60 x 2 = 1.20 1 0.20x2=0.40 0 (27.575)10 = (11011.1001)2 upto 4 decimal points. 2. Decimal to octal conversion Ex (696)10 = ( 18 Solution To convert this into octal number it is divided by 8 continuously until the quotient becomes 0. Remainder 8 |596| 4 (LSD) a| 74/2 8/9 {1 8 | 1-71 (MSD) So (596)10 = (1124)8 Ex.2 Solution Ex.3 Solution Ex.4 Solution UNUMBER'SYSTEM, (6692)10 = ( 18 So (6692)10 = (15044)8 i (0812)10=( 8 To convert a fractional number it is multiplied by 8 continuously until the product becomes 0 or upto required number of digits. 5 Carry 0.812 x 8 = 6.496 ~ 6 (MSD) 0.496 x 8 = 3.968 3 0.968 x 8 = 7.744 7 0.744 x 8 = 5.952 5 (LSD) So (0.812)10 = (0.6375)g (877.75)10=( 8. Remainder 8 | 877| 5(LSD) 8 | 109] 5 8] 13] 5 8] 1—)1 (Msp) Carry 0.75 x8 = 6.00 : 6 0.00x8=0 0 So (877.75)10 = (1555.60) 3. Decimal to hexadecimal conversion Ex.1 Solution (995)10 = (16 To convert this into hexadecimal, divide this number continuously by 16 until the quotient becomes 0. NUMBER SYSTEM 995) 3 (LSD) 16} 62 | 14 16 3—»3 (Msp) (995)10 = (3E3)16 Ex.2 (7125)10=( jig Solution 16|1712) 0 (LSD) 16107} 14 16) 6—»6 (Msp) Carry 0.5 x 16 = 8.08 8 0.0x16=0 0 (1712.5)19 = (6B0.8)16 Ex3 (1990.975)10 = ( 16 Solution 16/1990] 6 (LSD) 16} 124| 12 16) 7-7 (MSD) Carry 0.975 x 16 = 15.600 15 0.6 x 16=9.6 s 0.6 x 16 = 9.6 9 So (1990.975)19 = (7C6.F99)16 Decimal to any other base Bl 55610 =( 97 Solution Divide this number continuously by 7 until the quotient becomes 0. 5.12 (NUMBER SYStEq 7 |5556| 5 (LSD) 7 |793| 2 7 | 113] 0 7\19| 5 7 | 2-4b2 (MSD) So (5556)19 = (25025)7 Ex.2 (675.75)10=( 9 Solution 9 | 675] O(LSD) 9|75 |3 9 | 8—»9 (MSD) Carry 0.75x9=6.75 6 0.75 x9 = 6.75 6 So (675.75)10 = (930.66)9 5.2.3 Converting from a base other than 10 to a base other than 10 There are the following two steps for converting a base other than 10 to a base other than 10. 1. Convert the source number to a decimal number 2. Convert the decimal number obtained to the target base. Ex. (2345)6 =( 4 Solution Step1 Convert from base 6 to base 10 2x6 43x62+4x6l45T 60 =2x216+3%3642445 = 432 + 108 +24 +5 = (569)19 Step2 Convert (569)19 to base 4 Remainder 4 |569) 1 (LSD) 4 |142| 2 4| 35} 3 * » ° 4| 2-emsp) So (2345)6 = (20321)4 NUMBER SYSTEM Ex.2 (8755)8=( )12 Solution step] 5x82+7x8l45xe045xg-1 = 320 +56 +5 40.625 = (381.625)19 Step 2 12| 381| 9 12) 31 | 7 24 Carry 0.625 x 12 = 7.500 7 05x 12=6.0 6 = (279.76)12 So (575.5)g = (279.7612 Ex.3 (101011.11)2=( )g Solution 6 Stepl 1x29 40x2441x23+0x22+1x2b+1x0+1xrts1x22 32404+84+04+24+1+054+0.25 = (43.75)10 Step2 (43.7510 =(_)8 Carry 0.75 x 8 = 6.00 6 So (101011.11)2 = (53-6)8 = rape /UNUMBER'SYSTER Ex.4 (101101.101)2=( 16 nes Solution Step 1 125 40x 2b 1x34 12022 40x 241x204 1xZF Ox TP 41x29 32x0+8444+041405+040.125 = (45.625)10 Step2 (45.62510=( 16 0.625 x 16 = 10.00 10 So (101101.101)2 = (2D.A)16 5.2.4 Relationship between decimal, binary, hexadecimal and octal number system Table : 5.1 Decimal Binary Octal Hexadecimal | 0 0 0 0 1 1 1 1 2 10 2 2 3 u 3 3 4 100 4 4 5 101 5 5 6 no 6 6 7 1 7 7 8 1000 10 8 2 1001 nl 9 10 * 1010 2 a a 1011 B B 2 1100 4 s 13 1101 15 ms 4 110 16 15 11 7 F 16 10000 < i NUMBER SYSTEM 5.15 5.2.5 Shortcut method for binary to octal Conversion step 1 * step 2 Ex.1 Solution step 1 Step 2 Ex.2 Solution Step 1 Step 2 Divide the group to 3 bits Startis from left after decimal point. ting from the right before decimal point and starting Convert each group of 3 bits into one octal digit from the table 1.1 (1010110) =( jg 001 010 110 Lo ay | (1 26)g (101111.101)2 =(_ )g 101 il | Apt LJ eS] (57.5)g 5.2.6 Octal to binary conversion Step 1 Step 2 Ex.1 Solution Step 1 Step 2 Ex.2 Solution Step 1 Step 2 Convert each octal digit to a 3 digit binary number Combine all the binary groups into a single number (765)8 =( )2 11110101 (111110101)2 (523.75)g = ( )2 101 010 011-111 101 (101010 011.111101)2 5.2.7 Shortcut method for binary to hexadecimal conversion Steps for this conversion ar 1. Divide the binary digits i into groups of 4 starting from right before decimal point and starting from left after decimal point. 2. Convert each group into om e hexadecimal digit from table 5.1 y REST Ex.1 (101011010101)2 = ( )16 Solution Step 1 1010 1101 0101 fC LJ Step 2 A D 5 (AD5)16 Ex.2 (0101 0111 1001 . 10101)2 =( )16 Solution 0101 ou 1001. 1010 1000 Ey eS Ey EST a) 5 7 9 10 8 (579.A8)16 5.2.8 Hexadecimal to binary conversion (shortcut method) Steps for this conversion are : 1. Convert each hexadecimal digit into a 4 bit binary number from table 5.1 2. Combine all the resulting binary groups into a single binary number Ex.1 (8A9)16 =( )2 Solution Step 1 10001010 1001 Step 2 (100010101001)2 Ex.2 (B65.75)16 = ( )2 Solution Step 1 1011 0110 0101 0111 0101 Step 2 (101101100101.01110101)2 BIT, BYTE, NIBBLE, WORD In computer date and instructions are stored in the memory as some unique combination zero’ 2 = one’s. These zero's and one’s are called bits (binary digits). A bit is the small possible ‘unit of data. The memory space i js ; Pres ace is measured in terms of bytes. One bytes is equal © NUMBER SYSTEM = Fig. 5.1: One Byte Each individual bits are numbered g (the left most bit). Normally a single ch will occupy one byte of memory. tarting with 0 (for the right most bit) and extending to 7 ‘aracter (e.g. a letter, a single digit or a psecial character) The size of computer’s memory is us ual i 10 Hoaeiered bie (kilobyte), ly expressed in some multiples of 2!° = 1024 bytes. The memory of small personal computer has capacity of 256 k bytes. So, as many as 256 x 1024 = 262, 144 characters can be stored in the computer's memory. 1024 byte make kilobyte or 1 kb, 1024 kb make one megabyte or 1 MB and 1024 MB make one gigabyte or 1 GB, 1024 GB make one terabyte or 1 TB. One nibble is equal to four bytes. Large computers have memories that are organized into words rather than bytes Each word will consist of a relatively large number of bits typically 32 or 36. The bitwise organization of 32 bit word is shown. Fig. 5.2 : One 32 Bit Word e computer to another. A computer word may be 8-bits, ary from ont The length of the wore Vy words can perform complicated arithmetic calculations Ié-bits, 32-bits etc. Computer with long Y ds and store large number than computers with small words Term Definition : at’ or I’. It is the smallest unit of information. 1 Bit single binary digit, "or Beas a is made up of eight bits. It is a group of eight binary digits used to : oe ‘one unit of data in computer's memory. rep! it of four bits. : oo. memory containing a standard number of bits are called “ a in y aes ee ther subdivided into smaller units called bytes. words whi

You might also like