0% found this document useful (0 votes)
75 views29 pages

Digital 1 and 2 Half Chapter

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)
75 views29 pages

Digital 1 and 2 Half Chapter

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/ 29
CHAPTER INTRODUCTION , Chapter Outline —@ 1.1 INTRODUCTION To DIGITAL sysTEMS fe Introduction to Digital Systems In modern world of Electronics, the term ‘digital’ is 8 Analog and Digital Signals usually associated with a computer. This is due to |g Analog Systems the fact that the term ‘digital’ is derived from the | a Digital Systems way the computers perform operations, by counting = Detailed Comparison of Analog digits. Nowadays, digital concepts are usually applied and Digital Systems to various problems that could only be solved by | «Various Basic Digital Devices analog methods several years ago. Fast and reliable | a Organization of Digital ICs solutions using digital techniques proved the | a Binary Logic and Logic Levels tremendous power and usefulness of digital systems. | a Positive and Negative Logic In modern times, digital systems find applications in a wide variety of industrial and consumer products such as automated industrial machinery, pocket calculators, microprocessors, digital computers, digital watches, TV games, signal processing and so on. Infact, the areas of application of digital systems have been increasing every day. Also, the digital computer can be programmed to perform different tasks. The users are allowed to specify and change the program or the data according to the specific requirements. Because of this flexibility, general purpose digital computers can perform a variety of information processing tasks that range over a very wide spectrum of applications. For many years, the main application of digital electronics was only in the computer systems. But “ today, the digital electronics is used in many other applications such as: 1, Television Communication systems Radar, navigation and guidance systems Military systems Medical equipments anew y Digital Electronics and Logic Ossi, 6. Industrial process control 7. Consumer electronics In today’s world, the digital circuits and digital techniques are widely used in almost all arg, of life like computers, automation, robots, transportation, telecommunications and entertainmeng 1.2. ANALOG AND DIGITAL SIGNALS In da y life, we come across various types of signals and The signals* may be broadly classified into following two categories : ( Analog signals (ii) Digital signals (i) Analog Signals Analog signals are the signals which may have infinite number of different magnitudes or values. They vary continuously with time. Sine wave, triangular wave etc. are few examples of analog signals. (ii) Digital Signals A signal is known as a digital signal if it has only a finite number of predetermined distinet magnitudes. Depending upon the number of distinct magnitudes, the digital signals may be classified as under : S.No. | Number of distinct magnitudes | Type of digital signal % 2 Binary 2. 8 Octal 3. 16 Hexadecimal Actually, the digital signals are discrete time signals, i.e., they are not continuous with time as shown in figure 1.1. a yo Ss 9 (a) Analog signal (b) Digital signal Fig. 1.1. 1.2.1 Performance Comparison of Digital and Analog Signals S.No.| Parameter of Analog signals Digital signals comparison 1 Number of values | Infinite Finite (2, 8, 16 etc.) 2. | Nature of signals | Continuous-time Discrete-time 3._[_ Sources of signals |” Signals generators, transducers ete,| Computers, A to D converters etc ae Examples Sine wave, triangular wave Binary signal [5 become very popular because of the availablity of low-cost digital ach Other of digital cixc itry are computer compatibility, memory, ease of use, simplicity of design, acd sMabilit aavantages decaracy, = Digital Electronics and Logic Design 10 Table 1.1. Binary logic and logic levels jogic levels assigned S.No.| Statement Two possible outcomes Logic levels assigi ==» Low (Logic 0) —> OFF 1, | Alamp may be nee righ (Lomein A> ON. -- +—— Closed === 2, | Agate may be ne aaOben | “25! > Low (Logic 0) + aia hatha 3. | Your examination result may be L. i, * High (Logic 1) Important Point : The digital circuits are also known as the logic circuits because they work on the basis of some logic. 1.9. POSITIVE AND NEGATIVE LOGIC SS The digital circuits will have only two distinct output voltage levels. ‘These two voltage levels will be used to represent the logic 0 and logic 1 outputs of the logic circuit as shown in figure 1.8, gre! OLR Represents one logic state (1 or 0) a ——* iu t —— the other logic state (0 or 1 Law ievel ouipu™ RePtesents the other log (Oor1) Fig. 1.8. ‘The high and low voltage levels of the output voltage can be assigned to represent logic 0 or Jogic 1 levels by using following two different types of logic : () Positive logic +5V Gi) Negative logic ouput f ~==Logie 1 (i) Positive Logic yoeoe A LOW voltage level re; ov = Logic 0 Presents logic 0 state and a comparatively HIGH output voltage level represents | gic 1 state Ked.Enekve lope as shown in figure 1.9(a), ov—- (©) Negative logic Fig. 1.9. Negative Logie A LOW voltage level represents logi 0 state as shown in figure 1. 9(6). As an example, 0 volt: known as negative logic. Logic 0 (LOW) Togic 1 (HIGH) introduction nnn alii "1 GLOSSARY Active HIGH input : Digital input which « active LOW input : Digital input whieh ws, {MUD converter : Device for converting an an { microprocessor-compatible devies i Alphanumeric + Consisting of numbers, letters and other fe OP With decimal outputs alog to digital : Conversion of an analo; 1a etna pe ang nee Binary-coded decimal : croup. Bit : A single binary digit (0 or 1.) Useful i for binary digit. igital Electronics : Branch of electronics de: it HIGH or LOW and Se be represented by BERENS é igital to analog : Conversion of a digital si “i pigteas Toate Tea eo ee oe ae sialon, such as a voltage. Dual-in-line package : Popular packaging method for ICs. Analog: Information expressed in continuous range of values. ‘Augend: The number to which addend is added. Block Diagram: A drawing having labelled blocks for describing a system. Character: A symbol, letter or numeral. Chip: An integrated circuit. Digit: A single symbol in a number system. Digital: Related to digits or discrete quantities. Drive: In computers it refers to a mass storage device, e.g., hard dise drive, floppy disc drive. It is an electromagnetic or optical device which moves mass storage media under read/write heads. Floppy Dise : A magnetic storage device. Also known as diskette Frequency Division Multiplexing : A method of sending information over a communication medium by assigning different frequency bands to different channels. Generator: A device for producing electrical or magnetic signals. GND: Ground, IC (Integrated small size, Increment : To increase the count by 1. Large Scale Integration : An IC having 100 to 9999 gates. Logic: The decision making capability of digital gates in terms of yes and no. Medium Scale Integration (MSI): IC having 12 to 99 gates. Negative Logic : The logic system in which Low level is 1 and high level is 0. Noise : Unwanted voltages and signals. Numeric: Related to numbers, Positive Logie : Logic system in which High is 1 and Low is 0. igital quantity such as binary. AQ a at “Common code in which each decimal digit (0 ~ 9) is represented by a 4-bit n representing on-off switching in digital circuits. An acronym iscrete signal levels. Signals are commonly cuit): A circuit in which all the components are integrated on a silicon base of very SUMMARY Every day digital concepts are being applied to problems that could only be solved by analog methods several years ago. : 6. 3 m1 o10 =o. +110 on Binary number = 111010101 . 110 011. Ans ‘Therefore, 2.10.3. Binary to Hexadecimal Conversion We know that base for hexadecimal numbers is 16 and the bas base for heeudesimal number is the fourth power of the base for binary grouping 4 digits of binary numbers and then converting each group digit to sc. we can convert binary number to its hexadecimal equivalent. ‘e for binary numbers is 2. The numbers. Therefore, by its hexadecimal a ital Electror 22 ——S=_s-sS rt nics and Logie EXAMPLE 2.10. Convert (1101100010011011), to hexadecimal equivalent. . Solution: We have, a hee [i10y] [i000] [i00)] [014] a oe B Hexadecimal number = (D89B)y. Ans: 01 ) 2.10.4. Hexadecimal to Binary Conversion Conversion from hexadecimal to binary is a reversal of the process alae in the preying sub-section. Bach digit of the hexadecimal number is individually converted to its binary equiva to get hexadecimal to binary conversion of the number. EXAMPLE 2.11. Convert (3FD),, to binary. Solution: We have, [rae Gal 011 111 1101 ‘Therefore, Binary number = 0011 1111 1101. Ans. EXAMPLE 2.12. Convert (5A9.B4),; to binary. Solution: We have, 5 A 9 , B 4 0101 «1010 = 1001 : 1011 (0100 Therefore, Binary number = 0101 1010 1001 . 1011 0100. Ans. 2.10.5. Octal to Hexadecimal Conversion The easiest way to convert octal number to hexadecimal number is given below : j (i) We convert octal number to its binary equivalent. Gi) We convert binary number to its hexadecimal equivalent. EXAMPLE 2.13. Convert (615), to its hexadecimal equivalent. Solution: (i) Octal to binary 6 1 5 110 001 101 Therefore, Binary number = 110001101 1 Gi) Binary to hexadecimal ooo1 1000 1101 (eal 8 D Therefore, Hexadecimal number = 18Dy. Ans. 2.10.6. Hexadecimal to Octal Conversion ‘The easiest way to convert hexadecimal number to octal number is given below. (i) Convert hexadecimal number to its binary equivalent. (ii) Convert binary number to its octal equivalent. EXAMPLE 2.14. Convert (25B)y to its octal equivalent. Solution: ()) Hexadecimal to binary 2 5 B }0010 0101 L011) Therefore, Binary number = 0010 0101 1011 (ii) Binary to octal oo1 ool oll O11 -ay] 1 3] 3 ‘ Therefore, Octal number = (1133),. Ans, ee Number SSO nS 23 2.10.7. Converting any Radix to Decimal In general, numbers can be represented as under Nee A. +A, ety tA +A M+ A rt +Asrt+..C rm N = Number in decimal : FE A = Digit r = Radix or base of a number system n = The number of digits in the integer portion of number m = The number of digits in the fractional portion of number From the above general expression, we can convert number with any radix into its decimal equivalent. This has been illustrated using next few examples where EXAMPLE 2.15. Convert binary number 110 1. 1 to its decimal equivalent. solution: We have, N=1x241x2+0xa+1x 941% 91 8+44+0414+05 : = (13.5))9 Ans. or @ 7 1 0 1 1 «a 8 4 2 1 05 Gai) 8 F 470 + 1 + 06 =035,, Ans EXAMPLE 2.16. Convert (475.25), to its decimal equivalent. Solution: We have, N = 4x 82 +7x 81+5x 8+2xa1+5x82 = 256 +56 + 5 + 0.25 + 0.078125 or N = (817.32813),. Ans. EXAMPLE 2.17. Convert (9 B2.1A),, to its decimal equivalent. Solution: We have, N = 9 x 16? + B(11) x 16! + 2 x 16° + 1 x 161 + A(10) x 162 = 2304 + 176 + 2 + 0.0625 + 0.039 or N = (2482.1), Ans. EXAMPLE 2.18. Convert (3102.12), to its decimal equivalent. Solution: We have, N= 3x 49+1x 42 +0x 41+2x 49+1x4142x 42 or N = 192 + 16 +0 + 2 + 0.25 + 0.125 = (210.375),9. Ans. EXAMPLE 2.19. Convert (614.15), to its decimal equivalent. Solution: N=6x7P+1xT+4x M1 x T+ 5x 72 or N = 294 +7 + 4 + 0.142857 + 0.102 or N = (305,24486),, Ans. 2.10.8. Conversion of Decimal Numbers to any Radix Number We have to carry out the conversion of decimal number to any radix number in two steps. In Step 1, we have to convert integer part and in step 2, we have to convert fractional part. The conversion of integer part is accomplished by successive division method, and the conversion of fractional part is accomplished by successive multiplication method. Let us discuss these two methods*. binary to * All Tmem ind women in the Treld of digital electrontos aust bo able Wo convert numbers and decimal to binary numbers. Re Rio nnin ih nn —— Number Systems sae 33 ‘Therefore, B* 12721111111, 8 «wy Mantissa DLT 0) 1 8 bits 23 bite ‘ bit : Hence, floating-point number is (1.0111 ni 100. and (BF 80 na ee 0), and (BF 800000)», ie, hex 0.50 = O.Yy = 1.0 X 2~ 24 Normalized Hence, as number is +v 127 Hence, B= 126=(1111110), M=0. gE Hence, 1] 01111110 [00.0 Hence, floating point number is (00111111000....0)p ata (BF 0000006 ie., hex. (iv) (1) 0 (10);9 = (10 1 0). De-normalized 1.0 10 x 2° — Normalized S= 0 > As number is +ve M=010 E= E’-127 8= E’-127, ‘Therefore, E’= 127 +3 =(130)19 =(10000010), 8 rE Mantissa - M 0} 10000010 0100. 0 Hence, floating-point number is (010000100100... 0), and in hex 41 200000H. (v) (8.92 X 10”)9 = (8920), = (110001000). > De-normalized e, normalized number > 1.10001000x 2" 5 bit = 0 — because number is + ve M= 1000000 E= E’-127=(8)yo erefore, E’ = (135);9 = (100001112 Ss Er 0] 10000111 | 10 001000... 0 Hence, Hence, floating-point number in binary is (01 00.0011110001000....0), and in hex 43C40000H. 2.12 COMPLEMENTS — Asa matter of fact, complements are used in the digital computers in order to simplify the subtraction operation and for the logical manipulations. 34 Digital Electronics ang eg Ye 2.12.1 Classification of Complements ikiedth For each radix-r system, there are following two types of comp (i) The radix complement (i) The diminished radix complement snt and the diminished radix ‘The radix complement is referred to as the r’s compleme co; ferred to a: nary Dl ide binary system with a base r=9 4, Plem, is referred to 8 (r= 1) complement, Let us consider the Pt Ser and Vrconpee Sa two types of complements for the binary system are 2's complemen and mplement, gin nt a ent. For a decimal system, for an octal system, we have 8's complement and 7's complem We ia nts and 9’s complement. haveyt 10 and the types of complements are 10’s compleme 2.12.2 1's Complement The 1’s complement of a binary number is the number that cae eas hignPlement 4 bit. The process of obtaining 1's complement has been illustrated in igure 2.12 ‘ a complent value represents the negative of ihsoral ee ae ae pa aut binary I it ly using inverters. Figure 2. 8 Dumber (10010 100), and ite aeeoranidient is (0110 1011). The same principe nace bits obtain 1's Foca plésent is applicable to binary numbers of any basa ie aay y : lows how. obtain the 1’s complement of a binary number using inverters. The : Qo aa er bs by b, i applied to inverter input. We get the 1's complement of this number utput of Inverter, eee: Given number Given number : ° ° ° ° ° z ' ' ' ' ' 1 ' ' 1 ' 1's complement : eS S © complement (b) 1's complement can be obtained by using inverters 2.12. (a) 1's complement of a number Fig EXAMPLE 2.33. Obtain the 1’s complement of the following numbers : (1010), (11010101). % Solution: Given number 1's complement 1010 > 0101 11010101 > 0010 1010 Why is it called 1’s complement? This system is called as 1's complement because t} the result. The answer will be sai method is illustrated in the follo wing example: EXAMPLE 2.34, Find 1’s complement of (1001), Sabie: Lat is maak CH: ‘he number can be subtracted from 1111 1111 to ee me as if all the 1's were changed to 0's and all the 0's to 1's. This alternative cs Ra Se er recat cet re arate aa ea Number Systems s 2.12.3 Representation of Positive and Negative Numbers Using 1's Complement Positive number in 1's complement form are represented in the same way as the positive sign | jnagnitude numbers. This means that (+5), can be represented as 0101, But, the negatwve snipe ee the 1's complement of the corresponding positive numbers. For example, (- 5),9 is represented as under : . N= GC) . Given number 45)10 = re . In sign magnitude form uC dln Meanie Therefore, N= 1010 1's complement form Thus, (— 5);o is represented as 1010 in the 1's complement form. Range of 1's Complement Number System 1. From the discussion done till now, the maximum positive number in the 1’s complement m for a 4 bit number is 0111. Therefore, for n = 4, the maximum positive number is 7, i.e., [2"-! — 1] 2. The maximum negative number is represented as 1 1 1 1. Hence, For n = 4, the maximum negative number is — [2-1 — 1] Hence, range of 1’s complement number system is given by, Maximum positive number = (2-! — 1). Maximum negative number = — (2"-! — 1) Table 2.9 shows the full range of 4 bit numbers in the 1’s complement form. for! 4! Table 2.9. Decimal number 1’s complement +7 0111 +6 0110 +5 0101 +4 0100 Positive numbers in +3 0011 their normal form. +2 0010 +1 0001 +0 0000 -0 Toit =1 11.0) J 220.1 1100 Negative numbers in -4 1011 their 1’s complement —5 1010 form. ee 1001 -7 1000 One of the difficulties in using 1’s complement is its representation of zero. As seen from Table 2.9, both 0 0 0 0 and 1 1 1 1 represent zero. The [0 0 0 0] is called as positive zero and (1 11 1) is called as the negative zero. EEE Digital Electronics and Logic ona 2.12.4 2's Complement The 2’s complement of a binary number is obtained by number. Therefore, 2's complement = 1’s complement + 2. adding 1 to the 1's complement OF thy EXAMPLE 2.35. Obtain the 2's complement of (1011). Solution: (i) First, let us obtain 1’s complement of the 1's complement of 1011 is 0100. (ii) Then, we add 1 to 1's complement. given number. 1's complement: Dr alidaOri-: 0 we add 1: + 1 2's complement: meen. od Ang, Hence the 2’s complement of 1011 is 0101. nt of (10110010)s- EXAMPLE 2.36. Obtain the 2’s compleme Solution: Given number : 1 1’s complement: We add 1: a —— Ze complement: ‘pie ORO aa Ee 2.12.5 Representation of Positive and Negative Numbers using 2’s Complement complement form are represented the same way as in the sign-magnitude + 6),o is represented as 0110 in the 2's complement form, ts of the corresponding positive numbers. For example, on Smee O me ree 0S 12 TORONTO 2 Positive numbers in 2's and 1’s complement form. For example, Negative numbers are the 2’s complement (— 6), is represented in the 2’s complement form as under : N = €6),9-.. given 11 0p =e J invert all bits and add 1. 1010 .., 2’s complement of (— 6);o In fact, 2’s complement is another method of storing negative values. A typical microcomputer saoemeryay and negative numbers with the help of 2's complement. The representation of Prticomasi nob wing 2's complement is shown in Table 2.10. The range of a 4-bit sign- Earnie mat sini laeaa lecimal (7) to (+ 7). The (0); and positive numbers are represented py sarsl hina aie Te 2.10. But the negative numbers are represented in the 28 eed tan en e that the MSB (sign bit) is not changed while obtaining the 2s ‘ample, 2's complement of (- 6)1o is obtained as under : €6o= (1110) : Its 2's complement = 1 010 No change Similarly, the 2’: s ly, the 2's complement of other negative numbers may be obtained. shire number Systems lee 37 Table 2.10. Two's complement numbers Decimal _| Signed binary | 2's complement I +1 0111 O11 +6 0110 0110 + = EH) 0101 Positive numbers 5 ai 0100 with normal oo1l reresentation 23, 9010 0010 am 0001 0001 0 0000 0000 } Unique zero =e 1001 1111 -2 1010 1110 =3 1011 1101 = 1100 1100 Negative numbers —6: 1101 1011 in the 2's complement -6 Tart) 1010 notation -7 1111 1001 -8 1000 1000 Important observations from Table 2.10 ‘Two's complement numbers have some interesting characteristics. They may be listed as under: 1. There is one unique 0. 2. The two's complement of 0 is 0. 3. The MSB of a sign-magnitude number Gannot be used to express quantity. It can be used as a sign bit. 4. There are eight negative integers, seven positive integers and one zero, making a total of 16 unique states. Therefore, in an n bit 2's complement system, there will always be, (i) 2-1 — 1 positive integers | Gi) 22-1 negative integers }'Total 2" unique states | | Gi) and one 0 ih To convert a negative number to a positive number, we find its 2's complement 6. 2's complement of a 2’s complement of a number results in the original number itself. For example, if the given number is (4),0 = (0 1 0 0)p, then its 2’s complement is 1100) and the 2's complement of (1 1 0 0) is (0 100), ie. (Aro: EXAMPLE 2.37. Express the decimal numbers +25 and - 25 in the 8 bit sign magnitud and 2’s complement forms. Solution: 1. Representation of + 25 Here, + 25 is represented in the sign magnitude, 1's complement and 2's complement +25= [0J0 011001 t + Sign Magnitude a e, I's complement it forms as under: pigital Electronics and Logie 38 ————— COS” 2. Representation of - 25 in sign-magn! ude form : Sopan[aono 2 2/0 e's Sign Magnitude ‘ ements form : Ta magnitude form 3. Representation of - 25 in! +25 = [o[0 01 ool ‘1 Invert all bits ee agbm [apostate ost : in 2 ts form 4. Representation of - 25 in 2’s complemen’ a magnitude form 01 hs ee a ‘1 Invert all bits and add 1 : , 5 CO! 2.13 BINARY SUBTRACTION USING 1’s AND 2's C' i i ‘As a matter of fact, the direct binary subtraction’ pee oow se ‘Therefore, we can represent the subtraction ea ee caemplamne hnich is to be subtracte represent number B (which i ne ina use addition instead of subtraction to get 2.13.1 Subtraction Using 1’s Complement ‘The steps to be followed for subtraction (A)e under : (i) First we convert the number to be subtracted Be to its 1's complement. uy ii) Then, we add (A), and 1's complement of (B)s using the rules of binary addition. ddition obtained in step 2 to get the fi (ii) If final carry is 1, then we add it to the result of at e result of (A) — (B)2- Here, it may be noted that if the final carry is 1 then the subtraction positive and is in its true form. (iv) If the final carry produced in step 2 is 0, then the result obtained in step 2 is negative and in the I's complement form and requires to be inverted. ‘The following examples will make the concept of subtraction using 1's complement obvi ‘There are two possible cases depending on the magnitude and sign of the numbers involved. Case 1. Number A and B, both positive and A > B. Case 2, A and B both positive and A B. EXAMPLE 2.38. Perform (1011), ~ (0100). Solution: A = (1011), and B = (0100) (i) First, we obtain 1’s complement of B as 1011. (ii) Then, we add A and 1's complement of B. Thus, A 2 Oana lies V'scomplement ofB + 1 0 1 1 . Sign 1's Complement form 2's Complement form MPLEMENTS ted as the number size increase f addition as : A + (— B). We ca nt or 2's complement form ang ~ (B), using 1’s complement may be described g 1’s complement method. Final carry > T — we add the final carry Final answer > Number Systems mm 39 Here, it may be noted that since final carry was produced, the answer is positive and is in the true form Case 2. Aand B both positive with A < RB, EXAMPLE 2.39. Subtract (9,9 from (4),9 using I's complement method. solution: Given that, A= (4)i9 = 0100), B= yo = (1001), () First, we obtain 1's complement of ();9 complement of (99 oF (1001), is (0110). Gi) Then, we add (4),o and 1's complement of (9),o. A Dives Oe 1’s complement of B oO aT 90 Zero final carry > 0 1 SURG « Final answer Here, it may be noted that as the final carry is zero, the answer is negative and is in its 1's complements form. ‘Then, we invert the final answer, Since the final answer is in 1's complement form, we have to invert it to obtain the true answer. Thus, we have Invert 1010 =——+ (0101), = (5)o. ‘Therefore, the answer is (5)y9. Ans. 2.13.2 Binary Subtraction using 2’s Complement If the subtraction of two binary numbers A and B is to be performed using the 2’s complement, then the following steps must be followed : (i) First, we add (A), to the 2’s complement of (B)s. (ii) If the carry is generated, then the result is positive and is in its true form. (iii) If the carry is not produced, then the result is negative and is in its 2's complement form. Important Point. Carry is always to be discarded. Depending on the magnitude of numbers A and B, we shall deal with different possibilities as under : Case 1. Both A and B are positive with A >B. Case 2. Both A and B are positive with A < B. Case 1. Both numbers are positive with A > B. The subtraction (A — B) for A > B is illustrated in Example 2.39. EXAMPLE 2.40. Perform (9),9~ (5);9 using 2’s complement method. Solution: (i) First, we obtain 2's complement of (6);9. Decimal Binary 2’s complement ro (0101)y, 1011 (ii) Then, we add (9)j9 to 2’s complement of ()o- Mro 1 0 oO 2's complement of (5)i9 rere PP Carry 1 1 . ee ry We discard carry —> Rikadile: A020 = Mig Final carry i I indicates that Ans\ the answer is positive and is in its true form, (portant Port. The final carry bit acts as a sign bit for the answer. If it is 1, then the answer is positive, 4ad #1 is 4, then di «swe isnegative. ______—— Digital Electronics and Logie 40 Ooty Case 2 A and B both positive with A < B EXAMPLE 2.41, Perform (4);9 ~ (9)jo using the 2’s ¢ Solution: Let us convert both the number to binary complement method. (1001)> (jo = (0100), and (9),0" (i) First, we obtain 2's complement of (0 2's complement Decimal Binary ro (1001) (iit) (ii) Then, we add (4); to 2's complement of (9) 0, = @r0 0100 + 2's complement of (9);0. ae ee Carry 1 1 ogee Final carry > 0 ge saat is negative and is in the 2's complement fp O carry indicates that the result is negative and is in its 9 ‘complement form. (iii) Finally, we convert the answer into its true form. Answer LrdO sali rae In 2's complement form 4 we subtract 1 2 1 7 eee Answer is in true form Now, we invert all bits Oat Ont ‘Therefore, thus the answer is : (0101)y; i.e., (- 5)jo. Ans. 2.14 SIGNED AND UNSIGNED BINARY NUMBERS 2.14.1 Unsigned Binary Numbers 1. Basic Concepts In some applications, all the data is either positive or negative. Then we can just forget bout the (+) or (-) signs, and concentrate only on the magnitude (absolute value) of numbers. For exam the smallest 8 bit binary number is 0000 0000, i.e., all zeros, and the largest 8 bit binary number is 1111 1111, Therefore, the total range of unsigned 8 bit binary numbers is from (00), to (FF)y from (0),0 to (255)1o, Tsgoei ay Point. It is important to note that we have not included (+) or (-) signs with numbers, With 16 bit numbers, the total range is given by, Smalle: 0000 0000 ©0000 0000 (0000), Largest: Hi it 11111 (FFFF)q ‘This represents the magnitude of 0 to 65, 535 decimal. {1[o]Jifo|ifoyo « Unsigned 8-bit binary number All the bits are used for representin only the magnitude ns ef Fig. 2.13. Unsigned 8 bit binary number A successful man EXAMPLE 2.31. Determine the values of base x if: (i) (211), = (152)s (ii) (193), = (623) Solution: (i) We have, (211), = (152), 2xx2+1xx!+1xx9 =1x 82+5x8l+2x 8° 2x? +x+1 =64+404+2 or 2x2 +x+1 =106 or or 2x?+x-—105 =0 Solving equation (i), we obtain, xo Therefore, (211), = (152), ..Ans. (193), = (623) (ii) We have, 1xx2+9xx!+3xx? =6x8?+2x81+3 x 8? or x?+9x+3 =384+16+3 x2+9x+3 =403 or x2 + 9x-—400 =0 or

You might also like