You are on page 1of 47
[piers System | INTRODUCTION : Weall are well conversant with the decimal number used in our daily life. But in computer am as it iS si and other digital systems different types of st sys sysems were developed. «8, binary number unter Ocal number system, hexadecimal number syste swe in addition (0 different number systems different ag ystems like BCD codes, ray code, ASCII code, coding ode cc. were developed to show alphanumeric eee in binary systems, to check correct reception dl of data ete In this chapter we shall study different number ', conversion from one system into other system, ser pathematical operations and different codes. different Digital Computer and Digital Systems : Digital computer is the system comprising of ieren devices with the help of which mathematical falelaions can be performed and logical decisions can te taken. Data is stored in its memory by using key board. Calculations are performed and logical decisions are taken in its arithmati¢ and logic unit. Result is stored in memory from where the result is obtained in the output unit All these are done by the control unit. For this computer is given instructions known as programme. Block diagram : Block diagram of a digital computer is shown in Fig. 1 dd a FIG. 1.1 : BLOCK DIAGRAM OF A DIGITAL COMPUTER Functions of different blocks are as follows. IB 1. Input Unit : Instructions and data are stored in the memory Unit of central processing unit (CPU) through the input Unit. Input is entered with the help of key board or magnetic tape 2 Central Processing Unit (CPU) + CPU is made up of three main part. (1) Memory Unit (2) Arithmatic and Logic Unit (ALU) (3) Control Unit CPU is called the brain of computer (i) Memory Unit : Data and programme are stored in memory unit. The results of arithmatic and logic unit are also stored in memory (ii) Control Unit : Control instructions from memory unit and gives instructions to different units. (ii) Arithmatic and Control Unit (ALU) Calculations are performed and logic decisions are taken in this unit and the results are stored unit receives in memory unit. 3. Output Unit = This unit receives data and results are displayed on the monitor (This is called soft copy) If necessary it is, printed on paper using printer (This is called hard copy) Types of computer : Classification of computer can be made on different basis. The types on the basis of physical size are as follows. (1) Main frame Computer @) Mini Computer (3) Micro Computer Main frame computers are bigger in size. In addition to the parts mentioned above, it includes peripheral devices like magnetic tape, magnetic disc ete Mini computers are smaller in size than the main frame computers. These are used in inductrial control systems and in research laboratories. Its. processing capability is smaller than the main frame computers. Microcomputers are smaller than the mini computers. Micro processor chip and other integrated circuits are used in them. These too have key board and display. The processing capability is less than mini computers. Digital Systems : wot daily rede systems Digital systems have alent) wn ree ante Wife and its use ae increasing 489 PO gui ON ay oes CN ig medica Are employed! im andustres Pe TN ing bold equipments ike washing MAT ogo EN equipments cx: These 0 AP Tg, ATM: OU Taitway and air racket 0nd FET gy syste ding of SE gg Duc to this main reason of sfr0iN Ty cari Ns developments of digital MFT ante WR devie micrapmacecenrs, memes: FUE ig ancreasing au have been developed am! STEM LP i s z SUM rc there are characters (0 SHOW In any umber 0 eaghtage 10 each position of depends upon the base of fed R. then any number can be — ’ Reet! + rte OR? + OR? + ORE + OR? 2 Rt + ORT + rams + OR™ ‘L pit separating the whole part and the fractional pat By following the above general rule any number tet can be developed. But the following four types cf number systems are developed and used in practice : 1. Decimal Number System Binary Number System Octal Number System 4 Hexadecimal Number System 1.2.1 Decimal Number System = This system is used in our daly life. In this system, base or redix is 10, and there are ten characters, These are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. More than one characters are used to show number more than 9. Each position cof number is given definite weightage, for example 5297 means 5297 = 5000 + 200 + 90 +7 = 5x10 +2 1249 x 10! +7 x 10 Thus, face value of 7 is 7 and its place value is 7 face value of 9 is 9 and its place value is 90 face value of 2 is 2 and its place value is 200 and face value of 5 is 5 and its place value is 5000, Basics of Digital Eleg ner orm of decimal SSE IS 8 SOW {108+ OIF OIE + OIF + O10! OW 2 On ee OlOT + O02 + Gig” + te Decimal point or example 8075.63 is decimal number gc 1 Ox 17K 1 +S x Ign, +6x 1043 xy 68 lb 3000 +04 104 58 1H 100 * 875463 1.2.2 Binary Number System : In our daly life decimal number system js y But in the working of the computer System it jy convenient. Binary number system 8 USEC it com and other digital systems. In this system there are two characters, 0 and 1. These show (WO dif conditions. These two conditions can be Fepresenteg 1 switch, punched card or tape oF Wansislor in cy or saturation. For example open switch shows 0 yay and closed switch shows | state. In punched tape or cay hole shows | state and position without hole shows state, When transistor is in saturation, collector becomes 0 and when transistor is in cut Off state, ty collector voltage becomes approximately +V.,. So in transistor, collector voltage is shown by 0 state and ix off transistor, the collector voltage is shown by 1 ste In all these, state between 0 and 1 is not valid. So they are little chances of error. Due to this, binary numbey system has proved to be very useful. There are only two characters in binary system 0 and 1. Base or redix is 2 General form of binary number system is a follows : OS + OM + OB + OF + O2 + OF + 6 Ort + O27 + 027. tL Binary point For example binary number 101001 means 1x 40x24 1x B+Ox 24+0x 2+ 1x? =1x3240x 164+1x84+0x440x241x1 =32+8+1 241 So (101001); = Vio a ICs syste 101001 in binary syste —— Jt gee peas ta number = WA 404 Dea OIF 6 1 «0015625 ais Peamal system = 426 + 05 ai ims there are only two characters : 0 = ams + 0.046875) eg pinay al is @ in biNATY and 1 in decimal is 46875 joi oa ‘are no characters 10 show decimal Thus (652.43), © (426 546875), ip DIA ore. So characlehs perso In octal number system, there are & characters 0 1 Mee 2am Mer 28 represented hy 10. Similarly 3] |. 2.3, 4, 5,6 and 7. So characters 0 to 7 are common oe oh py 14 by 100 and 5 hiathaes by | both in decimal system and octal system. To show — equivalent of some decimal | decimal number 8 and higher value, more than one jo are sho"? Characters are used. Decimal number 8 is represented by w able-L.1 + Binary equivalent 10 in octal system. In table 1.2, octal equivalent of some vmvers of 006 decimal numbers decimal numbers are shown 7 Binary | Decimat | Binary Table 1.2 : Octal equivalent Fpeimal | Equivalent | Number | EAuivalent numbers of some decimal numbers ber Number T Nomber | Nom Decimal | Octal Octal 0 12 1100 Equivalent | De! | Equivalent 9 | 2 +—-—_;—___ | | Number Number -—T 13 1101 Number Number : 1 -—] 10 14 1110 0 0 13 15 _ 15 im ! ! in 16 4 100 16 10000 2 2 15 7 : 5 101 17 10001 3 3 16 20 6 110 18 10010 4 4 7 21 7 ut 19 10011 5 5 18 2 8 1000 20 10100 6 6 19 23 9 1001 21 10101 @ 7 20 24 10 1010 2 | 10110 8 10 21 25 ul 1011 23 lol 9 u 2 26 10 12 23 2 123 Octal Number System : Ta oor In octal number system, base or redix is 8 and there iz a are 8 characters : 0, 1, 2, 3, 4, 5, 6 and 7. It should be rembered that 8 is not the character in octal system. General form of octal system is OB +08? + O8! + (08° #8! + O87. tL octal point For example (652.43), is a number shown in octal system, $0 j fhlon.©? * decimal equivalent can be found as OF +542 w+ a) 81 4) 8? 1 = 6x 6445 x 1 B42x1e4axt eax Beer 1.2.4 Hexadecimal number system : ‘This number system is very useful in microprocessor. In this base or redix is 16. Sixteen characters are 0, 1, 2. 3,4, 5,6, 7, 8, 9, A, B, C, D, E and F. General form of hexadecimal number system is as shown below oO. & 163 + () 16 + () 16! + () 16% £0) 16! + () 167 + tL Hexadecimal point For example, let us find decimal equivalent of hexadecimal number 35D.62. Oe Cy (3) 16? 6-5 (16)! 4D 16)" + 6 (Oy! + 2.16)? ' 16” 2 1 FR WHYS KIBET 2x 16 TOS + 80 4 13 + 6 x O.0H25 + 2 x 0.00390625 = 861 (OAS + OOO7R125) = 861.8878125 So (38D-62),,, = (861 3878125),9 In decimal number system and hexadecimal number System, characters 0 to 9 are common. For number 10 im decimal system equivalent number in hexadecimal number system is A, B for 11, C for 12, D for 13, E for 14 and F for 1S. More than one characters are used to represent number 16 and above. For example decimal umber 16 is written as 10 in hexadecimal system. In table no. 1.3 are shown hexadecimal equivalent of some decimal numbers Basics of Digit Ey 1.3 CONVERSION OF NUMBERS SR SYSTEM TO OTHER Sysppq, 'ROy ol We have studied fOUF types OF muy becomes necessary {0 Express a number wy, into other system. We shall study the ga” number from one system into other ayy" 1.3.1 Conversion From’ Decimal to Bing, To convert a decimal number into binary, the number is divided by 2 progressively until 0 is obtained in A. the quotient. Remainders are arranged in reverse order. This method is called 2 -$- ‘double dable’ method. For example _8_ let us convert decimal number 19 into c binary. Dividing 19 by 2. we get 9 AZ. as the quotient and remainder as 1, "| 4 This 1 is taken as LSB (least "0 significant bit). rt ‘Then dividing 9 by 2, we get 4 712 as quotient and remainder as 1. This “U> 1 is taken as digit before LSB. ‘Then dividing 4 by 2, we get 2 as quotient and 0 as remainder. This 0 is written on to the left. Then dividing 2 by 2, we get 1 as the quotient and 0 as ty remainder. This remainder is also written to the left Ty process is not yet completed. As there is still | as th quotient. Dividing 1 by 2, we get O the quotient ax remainder as 1. This | is written as MSB. Fence binay equivalent of decimal number 19 becomes 10011. Iti written as (19)jq = (10011). This process can also be written in the ladder fom as shown below. This occupies less place and iti A To 2. 1001; convenient too. H|njslolsS rr] rlrlio lel ei |— 0 Remainder is read from top to bottom and writle from right to left as shown below. 10011 Table 1.3 : Hexadecimal equivalent numbers of some decimal numbers [om PE] oe [es | Nember | Number | Number | Number {Lo | 0 7 u ii i 18 12 2 | 2 19 B | 3 | 3 20 14 4 4 21 1s Sl 5 22 16 6. | 6 2B 7 7 a 24 18 8 8 25 19 9 9 26 1A 10 A 27 IB i B 28 Ic a c 29 ID . D 30 _IE 14 E 31 le 15 F 32 20 16 10 ——___ 1 iat us Conver decimal Reading carry from top to heaton and writing (ro 112 into binary Heft to right after decimal point, we get 1100 . 2 | m2 | : (OTIS 49 = ONION) 2 Ss ; fn] 6 Let us take another crample Convert 06 mw ie 06 "4 eta HD 12 Cary i+ xt ' 92204 Cory o | pba 04 2 = O% Carry 0 —o 08 «2 = 16 Carry 1 (112), = (1110000), 06 «2 = 1.2 Carry | vert fraction decimal number into binary, the “ (0.6)ig = (OAOOIIOOL —) To com uccessively multiplied by 2 until O is I is seen that there is no end to this in this example numbst “Carry is read from top to bottom and written | 5. we shou ined. Carry 1 poi we ld stop somewhere depending upon the ee accuracy desired wert decimal fraction 0.78125 into For example, con’ Hence (06), = (0.10011001), sony 78125 x 2 = (1.5625 carry | 0562s x 2 = 1125 cany | 012s x 2 = 025 camy 0 02 =x 2 = OS camy 0 os x 2 = 10. cany 1 132 Conversion From Binary to Decimal : To convert binary number into decimal number weightage of each digit is taken into account. This will become ear from the following example. Convert 1001011 into decimal : x B+ Ox B+Ox Mel xB+rOxPeixterx YP x 6440x 3240x1641 x8+0xK441x2+1x1 1001011 =64+040+8+042+1 =75 (1001011) = (75)i9 ‘Another method is streamline method. In this binary weightages are written in the tabular form. Binary number is written in the table. Weightages where binary number is 1 are added. Weightages where binary number is 0 are ignored. For example, convert binary number 10110111 into decimal. Table is prepared with weightages and binary numbers are entered into it : siz | 256 | 128 | 6 | 32 | 16 8 eel aa 1 | 0 eal 0) 1 1 1 (ION101I1), = 128 + 32+ 16444241 = 183 (OI10111)) = (183)i9 Weightages of fractional numbers are as follows : 21, 27,23, 2-4 means 0.5, 0.25, 0.125, 0.0625 ‘This will be clear from the following example. Convert binary number 0.101011 into decimal : bet xrlsox2e i xr eox rei Basles of Digital i Ss 0.10101 rei wre = 05 +0 +.0.125 +0 + 0.03125 + 0.015625 0.671875 (0.101011), = (0.671875),9 Let us take another example, Convert (1101.1001), into decimal : (uoLtoon,= 1x Bed x Be Ox We Le D+ 1 xl 4Ox TF Ox IY 28444041405 +0 +0 + 0:0625 = 13,5625 (101.1001), = (13.5625),9 We can also use the streamline method : [6 | 8 4 2 1 05] 025 | 0.125 | 0.0625 L 1 0 1 1 0 0 1 8 +441 405 + 0.0625 = 13.5625 (101.1001), = (13.5625)yo 1.3.3 EXAMPLES : Example-L.l : Convert the following decimal numbers into binary numbers. (a) 537 (b) 111. Ans. : (a) 537 () 1 2 ,ur[ 4 ots essze lel 2 [a] 2 [3 [4 2 | 6 | 0 2 3 1 2 1 1 0 — (UID, = (HOLL) (537), = (1000011001), Le (019 # (1100101), (ted fy ad 7 | 12 | 0 2 | «4 0 : 2 32 0 eae |e 0 2 8 0 2 4 0 2 2 0 2 1 1 0 = (256), = (100000000), ~ Example-1.3 + ‘Convert decimal number 0.58 in to binary numbers. Ans. > Multiplying by 2 continuously and writing carry, Carry OS8x2=116 + 1 0.16 x 2. >= 0 032 x 2 = 0 0.64 x 2 si 0.28 x 2 = 0. > 0 056 x 2 12 + 1 ORx2=02% + 0 evi of Dial Elecwonies 2022 /2 ee II Let us stop considering that these digits are sufficient, So (0.58), = (0.101010), Example-1.4 : Convert decimal number 0.875 into binary number. Ans. : 0875 x2= 1750 + 1 075 x2=150 7+ 1 GF x2=e10 = 1 (0.875)19 = ON), Example-1.5 : Convert decimal number 35.17 into binary. Ans. Let us first convert integer number 35 into binary : 2 a5 1 2 17 I 2 8 oO 2 4 i) 2 2 oO 2 1 1 0 (100011) ‘Now let us convert fractional part 0.17 into binary : 0.17 x 2 = 034 + 0 0.34 x 2 = 0.68 > 0 068 x2= 13691 0.36 x 2 = 0.72 3 0 0.72x2= 14491 0.44 x 2 = 088 3 0 t 088 x 2= 1.76 91 Let us stop here. (35.17)j9 = (100011.0010101), Example-L6 : Basics of Digital Ek trong] Convert binary number 11001101 into decimal number using weightage method. Ans, : Ex Me Lx Be Ox Bs Ox Mex Ber x Peon wet xP = 1B 4644040484 44041 = 205 (11001101), # (205),9 Example-1.7 : Convert binary number 1101010101 into decimal number with the help of streamline method, Ans. : S12] 256 | 128 | 64 32 ie | 8 | 4 2 1 1 1 0 1 0 1 0 1 0 1 = 512 + 256 + 64+ 16+ 441 = 853 (1101010101), = (853)j9 Example-1.8 : 1.3.4 Tutorial Problems = Convert binary number 0.10101 into decimal | Example-T-1 : ber. Convert following binary numbers into decimal Ans. : numbers Using streamline method. (a) 11.0111 (b) 10011 (c) 100110 (4) 1000 05] 025] 0.125 | 0.0625 [0.03125 [Ans, : (a) 3.4375 (b) 19 () 38 (A) 16) 1 o 1 0 1 Example T-2 : = 05 + 0.125 + 0.03125 = 0.65625 10101), = (0.65625), Example-1.9 : Convert binary number 111.111 into decimal. ‘Ams. : * Using streamline method : 0.125 | al = 44241405 +025 + 0.125 = 7.875 (ULIID, = (7875) 4 2 1 05 | 0.25 1 1 1 1 1 Convert the following decimal numbers ine binary : (a) 125 (b) 109 (©) 132 (d) 94 (@) 67 9 [Ans. : (a) HIT1101 (6) 1101101 (€) 1odo0H (@ 1O1L110 — (e) tOGGOLT (A) HII! 1.3.5 Conversion from Decimal to Octal : In converting decimal into binary, we divided number by 2 progressively until we got 0 as the quoties This method is known as double dabble method. I+ similar way to convert decimal number into 0% number, the number is divided by 8 (redix or bis! progressively until is found in quotient. This is called ‘octal dabble’ method. Remainder is read it top to bottom and written from right to left. For examph fet us write decimal number 247 into octal : Binary System 3 |247| 7 8 | 0] 6 : Tare 67, 0 $0 (247),9 * 367 Let us take another example. Convert decimal mmber 1506 into, octal ut g | 1806) 2 sf iss] a 8 | afl? — ; 7 (2742), To $0 (1506), = (2742), If the decimal number is fraction, it is multiplied ty 8 successively and carry is written aside. The c, i read from top 10 bottom and is written from left to rent after the octal point. The process will be clear from the example, Let ts convert decimal number 0.32 into octal number : 0.32 x 8 = 2.56 carry 2 0.56 x 8 = 4.48 carry 4 0.48 x 8 = 3.84 carry 3 0.84 x 8 = 6.72 cary 6 0.2436 ... Process continues further. We can stop here (0.32),9 = (0.2436), 136 Conversion from Octal to Decimal : To convert octal number into decimal number, digits are multiplied by respective weightage and these are added. For example, let us convert octal number 345 into decimal. 3x 844x845 x 80 =3xO644x84+5x1 = 192 +3245 = 229 + B4S)g = (229), Take another example. Convert (5701), into decimal, 5x8 47x 840x841 x 80 =5x5I2+7x 6440 841x1 = 2560 + 448 +0 +1 = 3009 (5701), = (3009), When the octal number fraction, then also Fespective weightage are written. For example, convert (0.596), imo decimal SeR' ett ooee! = Se O.125 4 1 015625 + 6 « 0.001953125 = 0625 + 0.046875 + 001171875 = 068359375 $0 (0.536), = (068359375) 5 13.7 Conversion from Octal to Binary : Conversion from octal to binary is comparatively simple. For this binary numbers for each digit are written, This will be clear from the example, Convert ‘octal 36 into binary, Fitss write numbers 3 and 6 keeping Space between them, Then binary equivalent of each number is written, 0 of MSB is not omitted. 3 6 + L ol 110 So (36), = (O11 110), It becomes easy to write and read if a space is left after 3 bits, Consider another example (5207), = () 5 2 0 7 + L t L 101 010, 00a (5207)g = (101 010 000 111), If octal is a fraction number, then also the same method is adapted. For example : (0.326), = (2), 3 2 6 t L 4 ol 0100 So (0.326), = (0.011 010 110) ‘Take another example. (17.625), = 17 6 2 5 Feo 8 ool it 110 O10 101 (17.625), = (OOL ILL + 110 010 101), nv Il LAR Comveraiam from inary to Octal CCwmverian from inary mb te cctal mum 1S a ahic prone of bite are fered om cach alae aimgte Pe ek the tiny pint Required number of (are added con onch side or example (HOE 1001). = 7. Making prea of three bits on each side of the and adding required number of 7670s trary pein wm tO t t Added 0 Added 0 4 4 4 4 \ soe 4 4 (1101 1001), = 1S 44), Conversion from octal to binary can be done casily When a decimal number with more no. of digit has (0 tre converted into binary, double dabble method becomes tong and tedws. Ifthe decimal number is first converted ‘nto octal and then octal number is converted into binary, 4 becomes simple For example (53949 = Ch Furst conven decimal number into octal number $0 ($397),y # (12425), Now converting octal inlo binary 2 4775 Ce ty ol 010 100 010101 So ($397), © (001 010 100 O10 101), 1.3.9 Examples Example-1.10 : Convert the following decimal numbers into octal numbers ; (a) 509 (b) 888 Rasics of Digitay Vie tr Ans. (a) 869 a [| 1 _ a[ajo sjujt | (1570), (888) * (1570), Example-LU : Convert decimal number 2907.38 inte number. . Ans, : First convert integer into octal withthe help of ogy dabble: method 8/2907) 3 8 [ao] 3 slasls (S839), 8 3 s 0 Now convert 0.38 into octal Cany OW x Re IO 8 00x 8 = 032 + 0 O32 x8 = 25 + 2 050K B= dB 4 Cn Mopping here, (2907.38) )9 = (9839.90243), cc ay System en AAD: gxample Convert the Following octal umber, int numbers () S040 (a) 7632 ans! ) 78 THM FORM eV e RG ry go fTHSID+O xO eae R DY, = ISR + 4+ 24 2 = 3004 (7632), = 3994), oy) SKB 4OKR 4 4x B14 Ox QO 25x 5124043240 = 2560 + 32 = 2592 (5040), = (2592)j Example-1.13 = Convert the following octal numbers into decimal numbers. (a) (0.1376), (b) (0.53), Ans. : (a) (0.1376), 1x 8! 43% 8247x8346 x 34 A 8 64 512 4096 = 0.125 + 0.046875 + 0.013671875 + 0.00146484375 = (0.187011718) 19 (b) (0.53), Sx B43 x 8? + ry gle = 0.625 + 0.046875 = 0.671875 (0.53), = (0.671875), 164 Convert octal number 217.5 into decimal number Ane. + ee ee DeMsduBoteios 8 (1k + 24 6 7) © 625 159.625 (237 5)y = 159.625); Example-1.15 ; Convert octal number 367 into binary number. Ans. : 367), = (%)y 3 6 a L t + on 110 ut So (367), = (O11 110 111), Example-1.16 : Convert octal number 111.101 into binary number. Ans. : ie tot 1 tt Loboe 001 001 001 + 001 000 OI CLL LODg = (001 001 001 + 001 000 001), Example-1.17 : Convert binary number 11010101 imto octal number. Ans. : Writing bits in groups of three bit from LSB. Oll O10 101 tty a2 (1010101), = (325)g dQ Brample-t.18 : Convert binary. number octal umber, Ams. : 10101 into ‘Writing binary bit in groups of 3 bits on either side of binary point O11 101 On + 101 O10 boyy bo 3 S$ 3 6 5 2 (101011. 10100)2 = ( 13M10 Tutorial Problems : Example-T.3 : Convert the folowing binary numbers into octal ‘umbers, (@) (utonLAD, © (0 ) (it), ACH), (4) (1010.110), (Ans. : (a) (73.6), (b) (3.7), (©) (55.54)y (A) (12.6) Example-T-4 ; Convert the following octal numbers into decimal numbers, ©) GS, 0) 352, Ams. + (a) (421); () (221 35)iq Example-T.s : Conver the following decimal numbersint octal (@) (221.25), (by (ULI), (Ans, : (a) (335. De (b) (13.0702),) Example-T6 ; Convert the following octal ‘numbers into binary, () ($4442), (645.15), (Ans. : (a) (101 100 100 100 010), (b) (101 O11 100 101.111 101))) way hexadabble method theg number imo binary. For gy. ee oe converted into binary jg divide ot ey unl 0 is obtain in the quoi, Ren 16S top to bottom and is written from aN more than 9 is written in the hex, He ‘ For example, IW conte a Ma \ ino hexadecimal number ima x 16 | 3875) 3 ; 5 B87 = 23), Take aother example, Con, 42219 into hexadecimal number Reading from top to bot Mand to lef. 8 ing A4EB (2219) = (AEB, When decimal number is frac : my tuliplied by 16 progressively and ten Cany is read from top to hexadecimal point. For exam umber 0.35 into heradeci bottom and Pl, le scone imal number - 035 x 16 = 566 cany 5 06 x 16 = 96 cary 9 06 16 = 96 cany 9 96 x 16 = 96 cany 9 Stopping here, 0.5999 (035),9 = (05999),, por sem a Conversion From Wexndectinst inte tectonay for thi WIRMINEES A Ned Hendin dig i CIE IB ry age t pele eS 16! 6 6x 160 ete Ses oe aks ROSH MaNd (DH)g * C414), ta ws take another example Conver = 10% 105+ 9x 162 + 14 x 16! = 4349177734375 (ASESCT)g © (43491,77734375),, 4.113 Conversion from Hexadecimal to Binary : To convert hexadecimal number into binary _ each hexadecimal digit is converted into binary For example, let us convert hexadecimal number imo binary number : 5s 0 DC Lod tog 0101 0000 1101 1100 (50DC),, = (0101 0000 1101 1100), Let us take another example. Convert 3EF-2C into umber. 3 6 F + 2 C€ 4oboe bod Ol! 110 111 * 00101100 (GEF.2C)jg = (11 1110 1111 + 0010 1100), 14 Conversion from Binary to Hexadecimal : This is similar to the conversion from binary to I number system. In this 4 bit groups are formed of 2 bit groups. Beginning of group is done from } and is advanced to the left, 0 is added if needed omen 0 wh we All the POducte wre then Rader Wo rind Its] wtheaRe hie depends apnn the praition oh differen digies ore 40 fattnws Om, (V1 Hexadecimal print for example Ft WS convert HeRdccimal number 18, enn drcimat (A9E3.C7),4 imo decimal A 16) + 9 (16)? + EB (16)! ¢ V6 © Cx 161 4 ay 162 +9106 1D Te 162 = 40 960 + 2304 + 224+ 3+ 075 + OOr74375 For example, let us convert binary number 11000 1010 11010 into hexadecimal number 011 C001 o101 1010 4 boy + 3 1 3 A So (1000101011010), = BISA, {In case of fractional number, groups are written on the right hand side of the binary digit. For example, let US convert binary number LILLO1L1O1.1OLL101 into hexadecimal number : OO NOL OL + ton 1010 4 bog 44 3. oD oD . BUA So (IIOI101-1011101), = @DD-BA),, 1.3.15 Conversion from Hexadecimal to Octal : For this first hexadecimal number is converted into binary ‘Then groups of 3 bits are formed. Then it is converted into octal number. eI For example, convert, hexadecimal number S3E2 ins sesame 5 3 E 2 tL + tL t O10l COIL 1110 0010 New make groups of 3 bits and adding 0 to the left if negessary. 000 101 ool ut 100 010 ° 3 1 7 4 2 So (S3E2)jg = (31742)g Take another example. Convert (9C0.2B);¢ into octal number. 9 c oO . 2 B + L t t t 1001 1100 0000 + 0010 1011 100 111 000 000 + O01 O10 110 tL tL L + + L + 4 7 o Oo ¢ 1 2 6 (9CO.2B);4 = (4700.126)g 1.3.16 Conversion from Octal to Hexadecimal : For this octal number is converted into binary number. The group of 4 bits are formed. Then it is converted into hexadecimal numbers. For example, let us convert octal number 45307.631 imto hexadecimal number. 4 5 3 0 7 + 6 3 1 tobobo tog tog + 100 101 O11 000 111 + 110 O11 O01 We should add one zero to the left and three zeros to the right. 0100 1010 1100 O111 + 1100 1100 1000 + t L L + + + 4 10 12 «7 ¢ 12 120 «8 4 A Cc 7 + c oc 8 (45307.631))4 = (4AC7.CC8)g 1.3.17 Conversion of Some Decimal Numbers into Binary, Octal and Hexadecimal Numbers : In table 1.4 are shown binary, octal and hexadecim: numbers of some decimal numbers. Basics of Digital Table 1.4 Conversion of some deg i into binary, octal and hexadecien imal Zz HU Decimal | Binary | Octal Ty numba Number Number | Number — 0 | 0000 [| o ~~ Nene 1 oom bata.” 2 00010 2 [oS 3 oo | 3 ~~ 4 00100 4 Do 5 00101 5 oa 6 00110 6 ea 7 oo1lt 7 [oS 8 01000 to S~ 9 1001 u ; [10 | o1010 2 WW 1011 a ar 12 01100 14 a 13 oro! 15 5 14 o1nlo 16 5 15 out 17 F 16 10000 20 10 17 10001 21 " 18 10010 2 | on 19 10011 23 | on 20 10100 24 mi 21 10101 25 5 2 10110 26 16 1.3.18 Advantages of Octal Number System (1 Hexadecimal Number System : The following are the advantages of octal nun system over the hexadecimal number system = 1. The octal number system uses only | numerical digits. While in hexadecimal nu system, some alphanumeric digits # ' used. So there is no complications in the « number system. 2. Conversion from binary number into ® number is easy. [Binary System 3. Similarly conversion from octal number to decimal number is also casy, 4. Arithmeties of octal number system is easy 1.319 Advantages of Hexadecimal Number System Over Octal Number System : ‘Advantages of hexadec octal number system are as listed below : 1, It becomes easy when the word length is divisible by 4 instead of 3, 2. The system becomes easy when the word length is long like 48 bit or 64 bit, 3, When binary number is converted into octal and hexadecimal number system number of digits in hexadecimal number system is less than in octal number system. 1.3.20 Examples : Example-1.19 = Convert the following decimal numbers into hexadecimal numbers. a) 3509 (b) 9000 Ans. (a) 3509 16 | 3509 16 219 16 13 0 DBS (3509),9 = (DBS)ig (b) 9000 16 | 9000] 8 16: [ $62. [2 16 [| 35 | 3 ion] oe 0 2328 (9000)19 = (2328), Example-1.20 : Convert the following decimal numbers into hexadecimal numbers. (a) 1299.7 (b) 5555.55 Basics of Digital Electronics / 2022 / 3 5) Ans. : (a) 1129.7 First we shall convert the who! then we shall convert the fraction part Je number part and 16 11299 3 16 706 2 ee = 16 | 44 | 12 #C 2C23 w [| 2 | 2, 0 To convert 0.7 into hexadecimal numbers multiply it progressively by 16. 0.7 x 16 = 11.2 carry Il = B | 0.2 x 16 = 3.2 carry 3 0.2 x 16 = 3.2 carry 3 Stopping here. B33 (IL 299.7)j9 = (2C23.B33)16 (b) 5555.55 16 | 5555 3 16 | 347 [1 16 Ta 16 ee 0 and 0.55 x 16 = 88 carry 8 08 x 16 = 128 cary 12 =C 08 x 16 = 128 cary 12=C So (5555.55)iq = (1SB3.8CC) ig 15B3 Example-1.21 : Convert the following hexadecimal numbers into _ decimal numbers. (a) BCDO Ans, : (a) BCDO = B x 163 + C x 16 + Dx 16! + 0 x 16° = I x 163 + 12 x 16+ 13 x 16+ 0x1 = 45056 + 3072 + 208 + 0 = 48336 (BCDO),, = (48 336)1o (b) 130AF Petit De 16 Oe 6 eA TBE A Re 16 See De ee Oe ee Is! Ce = 77000 AP 4g # (77 9%) Wxmmgete- 1.22 Convert the following hexadecimal numbers inte decimal mumbers, (a) @.IC7 (b) BRCCD Ams (a) 0.107 wel eC 14 7 IE? er tel 6 1D 162 4 716? = 0.0625 + 0.046 875 + 0.001 708 98 = 0.110 8398 () BB.CCD a1 x 16! eM x 18 + 12 x 16 #12 x 162 + 13 x 16? = 176 + 11.075 + 0.046 875 + 0.003 1738 = 187.800 0488 (BB.CCD),, # (187.800 0488) 9 Example-1.23 : Convert the following hexadecimal numbers into binary sumbers. (a) 90BF —(b) BECAS Ans: (a) 90BF 9 0 B FE Looe 1001 0000 «101 INI (9OBF),, = (1001 0000 1011 1111), (b) BECAS B E£ Cc 4 5 tol 1011 1110 1100 0100 0101 (BECAS),, = (1011 1110 1100 0100 0101), Peample-h. 24 : Convert the flog Mexadecimval mura iy (a) 9287 (hy ABCD.ER Am: () 90 » 9 2 . 4 7 ‘ ‘ ‘ L oot tor 0910 1H 44 292.87);4 # (091! 1001 0910 100 gy, \ a (b) ABCD.EF i yb tod 1 1010 1011 1100 1101 . 110 11 (ABCD.EF) 6 = (1010 101t 1100 1101 - thio Wy Example-1.25 = s Convert the following binary mumbery ig, hexadecimal numbers : (@) 1101111110001 (b) 1010101011 Ans. > (a) 101111110001 = 001 1011 4 4 1 B Fou (1101111110001), = (BF), (b) 1010101010101 000! 0101 L t 1 5 5 5 (1010101010101), = (1555),, 1111 0001 Lo¢ 101 0101 Example-1.26 + Convert the following binary numbers is hexadecimal numbers. (a) 11111111.001011 (b) 1OLN1LIL Ans. : (a) 11111111.001011 TL LE #0010 1100 bog Lod F F ° 2 c (ULE HILL - 001011), = (FF2C)i6, aad a C0 SoS Qt system z - oat 9 | ott O11 O10 140 Vor 4g —I | o 10 iwi 110 1 1 1 100+ 100 100 OOL HT | qe 1 ti proud ; : : E DOG Olt. IID; * QFE, OSAC 90), = 32654 A417), | : (b) Wont 127 Pent the flowing hexadecimal numbers into 7 : Roo ’ 4 4 L ‘ ‘ pumbers ° oat 0s (b) AISIF 9001 9001 0900 0091 + 0901 001 0901 01 000 100 000 001 + 000 100 010 001 . pcs vy tere rr gina convert hexadecimal number into binary ang| ! © 4 0 1 + 0 4 2 1 pen convert it into octal. (HOLA) = (10401.0421), B t i ; Example-1.29 : ‘ Convert the following octal numbers into Lou 109 00 0 0 101 a. hexa¢cimal numbers : cot OF 110 000 000101 (a) 65302 (b) 7542 oll Ans. : Ao 0 Os (@ 65302 (BC05);6 * (136005), First convert octal number into binary and then (0) ALSF make groups of 4 bits, and convert into hexadecimal, A 1 5 9 FE 6 5 3 0 2 a J L 4 L J Jo 10 000! O101 1001 4 tit Lo lolol 00 oto o10 100 «OO 0100 «110 soos Yo ot fe bobo 24 te Gs (ALS9F),¢ = (2412637), ono 1010 1100 0010 L L 4 4 6 A ¢ 2 (65302), = (6AC2)16 Example-1.28 : (b) 7542 Convert the following hexadecimal numbers 7 a. ee 1 ia | (@) 35AC.90F (b) 101.111 tol 10 o10 Ans. : ao to ote (s) 35AC.90F 1111 0110 0010 J YT F 7 F 6 2 s A 0 Ly J 1_0000_ 1111 Ss (T5425 = (F62)16 3 t J OQ! 101 1010 1100 + 4 Em) Example-1.30 : Convert the fotlowis hexadecimal numbers ; (a) 3764.670 ing octal numbers into (b) tILO1 Ans, : (a) 3764670 3 7 6 6 7 yt L 4 todd oui Wo 00 + Ho 90 OLN TLL 0100 & Hot 1100 0000 tog 4 oY oe "Dc o (3764670), = (1F4.D00),, ® 1no1 is 1 oo uy QoL ool 001 of + 90901 9010 0100 1001+ 000 0100 ,oLog Lod 2 4 9 . 0 4 CULO, = (249.04), 1321 Tutorial Problems : Example-T-7 ; Convert the following decimal numbers into hexadecimal numbers : (8) (2419.78) 4 (0) (1093.6)45 TAns. = (a) (973.C7TAEL)g —(b) (445.999),6] Example-T-8 : Convert the following hexadecimal numbers into decimal numbers : (a) (IF.A)yg (b) (223.AB), (©) (129.CD) 1, {Ans. : (a) (31.625)jo (b) (547.66796875) (©) (281,80078125) g] Example-T-9 : Convert the following hexadecimal numbers into binary : (a) (O.BF85), —(b) (AT2E)yg [Ans, : (a) (0.1011 1111 1000 0101), (b) (1010 O111 0010 1110),) Basis of Digital Bec Example-T-10 coving esky” mandy “ Convert the hexadecimal numbers @ ntortD; [Ans. (b) (LID, : (a) GBC), (by GE, “ Example-T-I1 = imal number, Convert the following ams ery ing, octal numbers ¢ (a) BENe (©) (ABCD 6 Ans. + (a) Os , (©) (125T15)g (A) (134799, (b) (ABC.AB),, (d) (B9CD),, (©) (5274 53, Example-T-12 = (b) (55.54)g [Ans. + (a) (A72E)j¢ (b) 2D), 14 ARITHMETICAL OPERATIONS wWity BINARY NUMBERS : ‘Arithmetic operations like addition, subvractig multiplication and division are done in decimal nun. system, Similarly these mathematical operations can akg be performed in the binary number system 1.4.1 Binary Addition : Rules for binary addition are given in Tables Table-1.5 : Rules for binary addition Number ‘Sum am A B A+B 0 0 0 0 l 0 1 0 0 1 1 0 u 1 0 l For example add 101011 and 110110. Cary 1111 Check roll B + 1otlo0 3 1100001 97 , ay Syne (e heck the APEEALON, CHT WNATY MEH jy To go dccumal THE SH IS Made An decimal coated ips answe 8 converted IM in inary am syst A wots telly HAS HOU AECESSATY 19 AMY chee ee ake another example AMM LOTT and “ne nol! . cay HUN ronnie + 1O101L Vooooro ry Subtraction : 142 Bina in Table-16 are given the rules for binary subr0" Table-1.6 : Rules for binary subtraction For example, subtract 11010 from 1101011 check 1101011 107 - 11010 - 6 1010001 Bl Consider another example, subtract 1011011 from 11000001 check 11000001 193 = 10101 - 91 1100110 102 Binary subtraction can also be performed using method of 1's and 2's complement. ‘This will be discussed in the later sections. 143 Binary Multiplication : Rules for Tes binary multiplication are given in ad ‘Tale 1.7 | utes for Wnary maltiptiewtion Muttiptie ation | Number A ” Aww | 0 0 0 | ' 0 0 | Vor example multiply 1010011 by 101 check oroott a a “ais 0000000-% 1o1oo x troorriune Consider another cxample. Multiply 1010101 by HL check 1ororosdt BS xt “1S roro1r0)8)d 1275 1o1rorotx 1o1rorol x x 1o10101 x x x roorrrrrord 1.44 Binary Division + Division process in binary system 1s similar to that in decimal system. Rules for binary division are shown in Table-1.8 ‘Tuble-1.8 ; Rules for binary division B HONO1 by 101 loro torfvioron lor Check oor nose 1or Remainder is 4 o1o0r ior ‘1001 101 “100 Quotiant = 101011 and Remainder = 100 Conside another example, divide HITTIN by 1 100100 nein Check Bat 255 +7= 36 0011t Remainder is 3 ut “0011 Quotiant = 100100 and Remainder = 11 LS EXAMPLES : Example-1.31 : Perform binary additions : (a) (11011011), + (01011101), (b) (10011001), + (00111100), pid ol ort Tit ‘Answer : (10011 1000), (b) coe 1 1 0 ¥ O0 1 ! 1 0 0 Answer : (1101 0101), ON Basics of Digi Perform the following binary Division by 0 is not possible, For example, divide “iy, (a) (111.001), + (1010.10), (oy (10011010); + CHILLIN, Ans. ! Aaiion of fractional inary nme, ‘imilar to that of the whole numbers, Py 1 ¥ it. oot . 1010-10 ooo! 1oT (10001.101), Answer: roiedo ue rooll.oll roid dil aw wat Too011. 010 ‘Answer + (100011.010), Example-1.33 + Perform binary subtraction of the (a) (1101), - (0111), ‘ov (by (1010111), - (111011), ‘Ans. : @ 1101 -o11l 0110 Answer : (0110), (bo) po1r1d0irll riiold o11100 Answer : (011100), (b) Example-1.34 : Perform subtraction : (a) (101.110), ~ (100.011), (b) (101010,0101), - (1111111), ‘Ans. : @ 1101. 110 - 100.011 1oo1. oll Answer : (1001011), — : Oe Oo ean ————— 1 oor. 10 betray Oy yee at On oon 1 Answer : (10100110, any TTT Torii a ple138 : rroorlol Perm HRY mshi, Co nu : 11001101xx @ (HOD, x oon, © doo, x anon, L1001lO1xxx Ans. PLool1rotxxxx o re lOoTTTOOTIIOOT at ‘Answer : (1011100.111001), aoe wea Example-1.37 ; 000000, Perform the following binary divisions : 000000 x, (®) 10110 + 10 TO iso (©) 10000111 + 101 eee rilloragy Au: Answer : (LUL101111), ® tout wore wo loons 10 xLLto1 dort aa Lo Titloit Gary —— a) 1ootid 10 000000x VW 10011ixx Dividend = 1011 1HOOLLixxx Remainder = 00 LO01LIxxxx Tooottoiois arot! ny a 101 [Toooorn Answer : (10001101011), Lol Example-1.36 : 101 Perform the following binary multiplications : pat (@) 1101.11 x 1.01 (6) 11001.101 x 11.101 —mn = 101 « rror.aa 008 7 oa Dividend = 11011 biiad Cary Rameinee = 00 Oe ie ys Example-1.38 : Coo00d0. Perform the binary divisions : Llotiixx (@) M0101 + 11 100010011 Answer : (10001,0011), (b) 110011001 + 1011 x ][-— Ams, : (a) \ un un fom 100 Dividend = 111 Remainder = 100 « looiol rou [Preerreo hort Oro lout T1011 boul TO Dividend = 100101 Remainder = 10 1.6 TUTORIAL PROBLEMS : Example-T-13 : Perform the following binary additions. (a) (110111), + (110011), (b) (O11), + (OID), + (10.10, [Ams. : (a) (1101010), (b) (1001101).1 Example-T-14 = Perform following binary subtractions. (a) (1101101), - (10110), (b) (11010), - (O11), + (a) (IOI0II) (6) (Dl (Ans. Example-T-15 : Perform the following binary multiplications (a) (101.10), * (LD, (b) (1111.00), * (1.01), [Ams. + (a) (1000010), > pty 0001 OL 101 = 101 1 6 D (555), = (16D)i6 (1D, = (053),6 a) 1000 (1000), = (200), Example 1.50 : Attempt the following. (Oct/Nov. 2005) () TAO == = Dy 7 A 6 t + t Olll = 1010 O110 (7A6)jg = (111 1010 0110), Now take groups of 3 bits ol 110 100110 L 4 bog 3 6 4 6 (TA6)y6 = (3646), TA6 = 1(16? + 10(16)! + 616) = 1792 + 160+6 = 1958 Ab )6 = (1958)9 ® O56 = yg = =O 16 | 256 | 0 16 | 16 | 0| efi fa 0 (256)ig = (100), Converting in to binary 1 0 0 ‘ 4 ‘ 9001 9000 0000 Now writing groups of 3 bit 000, 100 000 000 ‘ 4 ‘ + 0 4 0 0 (256). = (400), Binary form is already done above ie. (256) = (10000 0000), Example-151 : Do as directed. (D) Convert binary to decimal. (@) 1011 () 1111 ‘Ans. : () 1011 sfa[2yi | 8+2+1e=11 (1013), = (Do ® unt 16 8 4 2 1 1 1 1 1 I (AprivMay 2006) 16+8+4+2+1=31 (IID, = BD (2) Convert decimal to binary. (a) 3 (b) OS Ans. @) @ —_ Wnt (63)j9 = (UII), 2} a/0 Tom Now convert 0.5 into binary OS x 2= 10 cany | $0 5) = Oy (40.5)y9 = (101000.1), (3) Convert hexadecimal to binary. ) aE A (b) CCA Am. : (a) 4FA 4 FO OA 4 L ‘ 100, 11111010 (4FA),¢ = (0100 1111 1010), (b) CCA coco: ‘ t ‘ 1100 1100 1010 (CCA)ig = (1100 1100 1010), (4) Convert binary to hexadecimal. (a) 11011010 (b) 11110011 Ans. (a) 11011010 1101 1010 bog DoA (11011010), = (DA)y (b) 11110011 Wit Oo L t F 3 (II1O011), = F3)yg im) ans ‘onvert octal to XQ First convert 40) into inary (w) 312 (by 358 Basis of Digg Ans, (a) 32 3 1 2 4 4 o4 Il 001 oto (B12, = CLI 9) O10), (b) 385 305 5 bog L ou 101 101 (355), = O11 101 ton, (6) Convert binary to octal, (a) 101011101 (b) 110101001 Ans. + (@) 101011101 Making groups of 3 bits 101 oll 101 ‘ 4 4 Sees (101011101), = (535, (b) 10101001 10 101 ool ‘ 4 + Ghee ee (110 101 001), = (651), (7) Convert hexadecimal to decimal. () FA (b) 100 Ans. : (a) FA 15 (16)! + 10 (16)? = 240 + 10 = 250 (FA)yg = 2509 (b) 100 1 (16? + 0 (16)! + 0 16!" 256 +0 + 0 = 256 (100) = (2560 — 8 : FF OM = (23Dg (9) Convert decimal to hexadecimal, (a) 125. (b) 256 Ans. = (a) 125 16 | 25 | 13 =D 1 | 7 [7 a (12519 = 7 Dig (b) 256 16 | 256) 0 16 16 a: 0 (256)1) = (Dig (10) Find 1's complement of (a) 11011 (b) 101101 Ans, : @) Mon 1's complement = 00100 (b) 101101 1's complement = 010010 sis of Digital Elecronics/ 2022 1 6 ee [pies Seem — eee |e) ) Convert hexadecimal octal, — (11) Find 2's complement of (a) 1101 ob) 0 Ans. : (my 110018 Vs Complement of 111011 + 000100 ot 2's complement 900101 (b) 101010 1's complement —» o10108 ot 2's complement 10110 Example-1.52 : Convert the following. (Nov. 2006) (a) Decimal to binary (1) 214 (2) 251.82 Ans. : ay 214 First convert 21 into binary 2 a2 2 2 2 10101 Now convert 0.4 into binary 04 x 2 = 08 cary 0 08 x 2 = 1.6 cary | 06 x 2 = 12 cany 1 02x 2 0.4 carry 0 Now it will be repeated. +(0.4),g = (0.0110), (21.4)10 = (10101.0110), (2) 281k? Tino = 1.64 carry | = 1.28 carry | = 0.56 carry 0 = 112 carry I = 0.24 carry 0 0.24 x 2 = 0.48 carry 0 0.48 x 2 = 0.96 carry 0 0.96 x 2 = 1.92 carry 1 We shall stop here. So 0.11010001 (251.82)19 = (b) Binary to octal sumber (4) 20111.011 (2) 1011.10111 ) 10111011 Writing in groups of three oo «tl = ONS t + + 2 7 . 3 (OI11.011), = 27.3)g (2) 1011.10111 oor «Ol . 101110 iL L L 1 3 . 5 6 (O1L10111), = (13.56), (©) Decimal to excess-3 code a 6&8 (2) 55 O82 x 064 x 0.28 = 0.56 x 0.12 x NNN NNN 11111011-11010001), Ans. ay 68 6 3 p38 O76 i L 1001-0110 (63))9 = (OO O110y,, , (2) 55 5 5 +3 +3 8 8 L L 1000 1000 (55)j9 = (1000 1000), 5 (d) Hexadecimal to binary (1) A3FC 2) S4FA Ans. = () A3FC A 3 F c 1 L tL L 1010 O01! 111L 1100 (A3FC) jg = (1010 OOLL 1111 1100, (2) S4FA 2 4 F A L + L 4 0101 0100 1111 1010 (S4FA)ig = (101 0100 1111 1010, (©) Octal to hexadecimal () 734 Gi) 623 Ans. : (1) 734 First convert octal to binary, then com into hexadecimal | ind we ba 4 4__109 “T 13=D 12s! (734)g = (IDO)ig — ae ts] oa SY ] @ 0 6 2 3 (2) 10001 - 1111 1 | 4 I's complement of 1111 0000 wy ee o4 2's complement > +! 0001 1 9 3 (6235 = (193)j6 Adding re 10001 example 1" Pernyo as directed. (Nov, 2006) + 0001 | Add 38CA-S078 + SEBDSTES + SeBEIC 10010 2) hes? Avoiding carry answer is 10. Comveing oe - 7 adding aE ’ 1 14 1 | | Do as directed. (May/June 2007) aby an eo 1010 + 0101 xD o111 tomy |) Multly following binary numbers. De () 1101 x 101 (2) 1100.1 x 101.1 nr | og yy panes yor tL HHOL > 100L OLN oot w Hol Let us first add these two. _ coll 1011 1100 1010 . 0101 0000 0111 1000 =r too HO 101 OL. 1001 OL stat oot Tor To 1000 1 THO 1000 OTT Tor HOtxx SFBEXC 1000001 Ans. : 1000001 4 i 1 : 1 i 1 @ 1100-1 oir MIL 1011 1110 00101100 x 101.1 his Toor 101 1010 1000 0111. 1110 1000 o110 1011 Hootx + O1OL =11tL «1011. 1110 0010 1100, 1001xxx 1110 0000 1000 O01! . 1100 1011 0010 1011 —_—___ Vyeyy yay 1000100- Ans. : 1000100-11 Boo} fe 7 cp 2 (b) Divide following binary numbers. £083.CB2B (b) Subtract using 2's complement : (1) 1110 - 1100 (2) 10001 - 1111 Ans. : (1) 1110 - 1100 I's complement of 1100 — ool! +1 2's complement > 100 Adding this to 1110 1110 + 100 10010 Avoiding carry answer is 10. (1) 11101 + 101 (2) 11011 = 10.1 Ans. : (1) 11101 + 101 101 Horjitror 101 1oor 101 100 Quotient = 101 Remainder = 100 2) ton + 101 Multiplying numerator and denominat Hon x10 10.1% 10 y 10 _ Hono tol 1o1o-11001 tol 110 101 1000 101 110 lol 1 We stop here. ‘Ans. : 1010-11001 Example-LSS : Do as directed. (a) Convert following binary numbers into decimal ‘and hexadecimal numbers. () 110101 (2) 110010 Ans. (a) 110101 Using stream line method mle] s[4[2[t rfifofifoft =32+16+441 =33 (110101), = (53)9 And 110101 Ma .ing groups of 4 bits ool! = 0101 4 4 3 5 (110101), = G5)j6 (b) Conve (1) ABG — 32 + 16 +2= 50 (110010), * (5049 ‘And 110010 Making groups of 4 bits ool! 0010 L ‘ 3 2 (110010), = Bg rt following hexadecimal name jmal numbers. (2) 2EB7 Ans. = w Q) © Ans. AB6 ACL? + BIO)! + 616)? 10 x 256 + 11 x 16 +6 = 2560 + 176 + 6 = 2742 (ABO) ig = (274219 2EB7 22x 18 + 14 x 16 + Ix 16! 4745 8192 + 3584 + 176 +7 11959 (2EBT) ig = (11959),g Perform subtraction : (1) 110110 - 011001 (2) 1010101 - 11011 (1) 110110 - 011001 We shall use 1's complement meth 1's complement of 011001 is 100110 Adding it into 110110 we got 110110 100110 1011100 Lys TH101 Ans. : 11101 + o 1010101 - 110110 I's complement of 10110 ig 0100) Add. 1010101 | | + 001001 TOO Le | nin | ans: HL gy Convert following. decent © cambers. (1) 1408 ans. 1408 rrumbers to octal (2) 38464 8 1408, lalele 8 | 8 8 | 2600 (1408) 9 = (2600), (2) 38464 & velo Sal al al al -lolu J 8 I 0 —__ 105210 (35464) q = (105210), Example-1.56 : Do as directed, Sample-156 : Do as directed. (©) Find the 10's complement of (Nov/Dec. 2007) (1 4069 and (2) 1056.074 Ans, : (4069 9999 = 4069 5930 9's complement 2) ts6074 9999 999 1056074 — $943,925 9's complement +1 $943,926 10's complement (©) Convert (1) 10101, 2) 11011101, to decimal bers, Ans, : () 10101, Using stream tine method. 16 +i 4[2],1 '}ott 0 1 + ede ten (10101), = (21),9 @ 01.101 6] 8 nn a 2 [1 Josyo2s Tors tyifyifoyt 16+8+2+1405 +0125 = 27.625 (HON.101, = (27.625),5 (©) Convert 164.8754, and 105.15, to binary numbers. Converting first 164 into binary ° 2 | 164) 0 2[alo 214 1 2|w\0 2 | 0 2 3 1 2[2To 2th 0 (164),9 = (10100100), -Now converting 0.875 into binary 0875 x 2 = 1.75 cary | 075 x 2 = 150 cary 1 050 x 2 = 100 cary 1 (0875) = ClID, (164.875)j9 = (10100100.111), [ae] (@) Convert octal numbers (1) 256 and (2) 2035 to hexadecimal numbers. Ans. : (286 2 5 6 t tL ‘ 000 O10 101 110 4 ‘ 4 0 W0nA 14nk (256), = (AB)ig (2) 2038 2 0 3 5 ‘ ‘ Ls 010 000 oll 101 ‘ 4 4 4 1 =D (2035), = (41D)ig (©) Convert hexadecimal numbers AB6 and AO8F.EA to decimal numbers. Ans. : (1) ABG = 10 (16 + 11 (16)! + 6 (16) = 2560 + 176 + 6 ‘ = 2742 (AB6)j6 = (274219 (2) ASF.EA 10 (16) + 0 (16? + 8 (16)! + 15 (16) + 14 (l6y! + 10 (16)? = 40960 +0 + 128 + 15 + 0.875 + 0.0390625 = 41103.91406 (ADSFEA);¢ = (41103.91406), (Convert decimal numbers 1248.56 to hexadecimal numbers. Ans. + First convert 1248 in to hexadecimal 1248 (1248)j9 = GED), Basics of Digital Elegy Now convert 0.56 into hexadecimal 0.56 x 16 = 8.96 carry 8 0.96 x 16 = 15.36 cary IS = F 0.34 x 16 = 5.76 Cary 5 0.36 x 16 = 12.16 Carry 12a Stopping here (0.56), = (O.8F5C)y6 (1248.56) jq = (4E0.8FSC) (g) Convert binary numbers 1101101101101,19,, to hexadecimal numbers. : Ans. : Arranging in groups of 4 Bits on either side of hexapoints, and adding required zeros. 0001 1011 O10 MOL * 1011 9 bobo bo hoe by 1 Wl2B 6 D : B44 Ans. : (IB6D-B4)ig (h) Convert hexadecimal numbers AB6 and 2687, binary numbers. Ans. : AB6 A B 6 L L 4 1010 1011 O110 (ABO), = (1010 1011 0110), 2EB7 2 E B 7 4 L Log 0010 «1110 101 Ol (2EB7),, = (0010 1110 1011 O11); Main parts of digital computer are CPU inpyn device and output device CPU comprises of memory unit, ALU and contro! unit On the basis of physical size, digital computers are divided ito mam frame. mini and micro computers Number Systems General form of a number system OREO KRE SOROS ORT ORT Value of R depend upon the system. With the help of this, number in any system can be converted 10 decimal number To convert whole decimal number into binary decimal number is divided sucessively by 2 until 0 is reached. Dividand is written aside. It is read from top to bottom and written from right to left To convert decimal number into octal, division is made by 8 and to convert decimal number into hexadecimal, division is made by 16 To convert fractional decimal number into binary, successive multiplication by 2 is made. Carry is written on side. This is done until 0 is reached or stopped when required precision is reached. Carries are read from top to bottom and written from left to right. In case of octal, multiplication is made by 8 and in case of hexadecimal number, multiplication is made by 16 To convert octal to binary, binary equivalent of cach octal number is written side by side. To convert binary to octal groups of three bits are made on each side of binary point. Required nos. of zeros are added, Octal equivalent of each group is written To convert hexa to binary, binary equivalent of each digit is. written 10 To comvert binary to hens. groups of 4 bit are made on each side of binary digit, Required nos of rere are added Hexa equivalent of each group are written 11 To comvert octal to heus, first binary equivalent of octal number is written Groups of 4 hit are made ‘on each side of octal point and required nox. of eros are added. Hera equivalent of each binary group is written, 12 To convert hexa to octal, binary equivalent of each digit is writen. Groups of three bits are made on each side of hexa decimal point. Required nos. of reros are added. Octal equivalent of binary is written 13. To convert decimal number of more digits into binary it becomes easier to first convert into octal or hexa and then convert into binary 14. Binary addition: 0 1 0 +0 ori 15. Binary subtraction: 0 -0 > 16. Binary multiplication = Ixl=10x0=0,1x0=00x1=0 17. Binary division : 0+ 1=0,1+1=1 18. In cight-bit unsigned binary numbers, all digits indicate magnitude, and it is positive. Its range is from 0 to 255. 19. In eight-bit signed binary numbers, MSB_ shows sign and remaining seven bits show magnitude. If MSB is 0, the number is positive (+) and if MSB is 1, it shows negative (-) number. Range for Positive number now becomes 0 to 127. The range of negative numbers is -1 to -127 20. To find 1s compliment of a binary numbers, 0 is replaced by | and | is replaced by 0. 2's compliment is found by adding 1 to the 1's compliment. 21. To find 9's compliment of a decimal number, that ‘nuimber is subtracted from 9. By adding | to the 9's compliment 10's compliment is obtained. a 22. To find (R-1)'s compliment of a number each digit is subtracted from (R-1), To find R's compliment Vis added 10 (R-1)'s compliment Straight binary code is weighted binary code. ANY decimal number is shown by its equivalent binary code 24° In BCD code of 8421 code, decimal number 1s Written, Binary equivalent is written for each digit When MSB is 0, it is not omitted 1. What ts the range of B-bit unsigned and signed binary numbers ? Ans, : Range of 8-bit unsigned binary number is from 0 to 255 and that of signed binary number is from 0 to 127. 2. State the types of code. Ans, : ay (2) GB) Weighted Binary Code Non weighted Binary Code Alphanumeric Code (4) Error Detecting Code (5) Error Correcting Code State main types of weighted binary code. Ans. : (1) Straight binary code. (2) Natural BCD code or 8421 code. (3) 2421, 5421, 7421, 6311, 4221 and 3321 4, State application of codes. Ans. : Codes are used to show different numerals and alphanumeric characters, to detect and correct error in data transmission and reception. 5. State the types of non weighted binary code. Ans. : (1) Excess code (2) Gray code 6. How decimal digit to converted into Excess-3 Code ? Ans. : (1) 3 is added in each decimal digit (2) The number obtained is converted into BCD code. Basics of Digital Vian 75, Excew3 code is Om weighed binary » riven decimal Umber i W exter, Me wedded 10 cach digit anid then its bingy, i) is written, a ay, To convert excess-3 code Mo dey equivalent of cach group Of 4-bit ig tte, is subtracted from cach digit ty 7 Baron detecting code 18 used 10 krvrw terror in received binary data inj.” transmission 7, State different number systems wity 4, (redix). w Ans. ¢ a Q) Binary-2 Octal-& (3) Decimal-10 (4) Hexadecimal-16 Write steps for subtraction in 1's come, method when smaller number ha subtracted from bigger number. Ans. : (1) Write 1's complement of smaller rune (2) Add this to the larger number (3) Add end around carry to the sum 9. Write steps for subtraction in 1's comple method when bigger number has to be sutrxx from smaller number. Ans. : (1) Write I's complement of bigger munte (2) Add it to the smaller number (3) The result is 1's complement of te == and of opposite sign. There is no a (4) To get the answer take 1's complemess result. 10. Write steps for subtraction in 2's com method when smaller number bs *' subtracted from bigger number. Ans. : () Write 2's compl {sear (2) Add it to the (3) Avoid carry. - eee) (sn So for subtraction in 2°, write steps 'S complem I. when bigger number has to be sub from smaller number. bese Ans. * , (1) Write 2's complement of bigger number (2) Add is to the smaller number (3). There will be no carry. Result is in the form 2's complement of answer (4) Take 2's complement and assign negative sign 12. State types of alpha numeric code. Ans. = (1) ASCII code (2), EBCDIC code (3) Hollerith code 13. Write full form of BCD and ASCH. Am. : BOD ASCII Rinary Coded Decimal American Standards Code for Information Interchange 14. Weite fait form of EBCDIC. Ans. : EBCDIC Coded Decimal utended Binary Information Code | Describe hexadecimal number system. Explain conversion between decimal number system and hexadecimal number system, Explain 1's complement and 2's complement with suitable examples. * 3. Explain excess-3 code. 4. Explain how binary numbers are converted into decimal numbers. asics of Digital Electronics /2022 / 7 5. Explain conversion between octal and hexadecimal numbers, 6. What is the difference between weighted and non weighted codes ? 7. Compare octal number system with hexadecimal number system.

You might also like