Digital Logic and Computer Design PDF

Summary

This textbook details digital logic and computer design concepts, including digital computers, binary systems, Boolean algebra, logic gates, and related topics.

Full Transcript

# Digital Logic and Computer Design ## Contents ### Preface ### 1 Binary Systems - **1-1 Digital Computers and Digital Systems** - **1-2 Binary Numbers** - **l-3 Number Base Conversions** - **1-4 Octal and Hexadecimal Numbers** - **1-5 Complements** - **1-6 Signed Binary Numbers** - **1-7 Binary...

# Digital Logic and Computer Design ## Contents ### Preface ### 1 Binary Systems - **1-1 Digital Computers and Digital Systems** - **1-2 Binary Numbers** - **l-3 Number Base Conversions** - **1-4 Octal and Hexadecimal Numbers** - **1-5 Complements** - **1-6 Signed Binary Numbers** - **1-7 Binary Codes** - **l-8 Binary Storage and Registers** - **1-9 Binary Logic** - **References** - **Problems** ### 2 Boolean Algebra and Logic Gates - **2-1 Basic Definitions** - **2-2 Axiomatic Definition of Boolean Algebra** - **2-3 Basic Theorems and Properties of Boolean Algebra** - **2-4 Boolean Functions** - **2-5 Canonical and Standard Forms** - **2-6 Other Logic Operations** - **2-7 Digital Logic Gates** - **2-8 Integrated Circuits** - **References** - **Problems** ### 3 Simplification of Boolean Functions - **3-1 The Map Method** - **3-2 Two- and Three-Variable Maps** - **3-3 Four-Variable Map** - **3-4 Five-Variable Map** - **3-5 Product of Sums Simplification** - **3-6 NAND and NOR Implementation** - **3-7 Other Two-Level Implementations** - **3-8 Don't-Care Conditions** - **3-9 The Tabulation Method** - **3-10 Determination of Prime Implicants** - **3-11 Selection of Prime Implicants** - **3-12 Concluding Remarks** - **References** - **Problems** ### 4 Combinational Logic - **4-1 Introduction** - **4-2 Design Procedure** - **4-3 Adders** - **4-4 Subtractors** - **4-5 Code Conversion** - **4-6 Analysis Procedure** - **4-7 Multilevel NAND Circuits** - **4-8 Multilevel NOR Circuits** - **4-9 Exclusive-OR Functions** - **References** - **Problems** ### 5 MSI and PLD Components - **5-1 Introduction** - **5-2 Binary Adder and Subtractor** - **5-3 Decimal Adder** - **5-4 Magnitude Comparator** - **5-5 Decoders and Encoders** - **5-6 Multiplexers** - **5-7 Read-Only Memory (ROM)** - **5-8 Programmable Logic Array (PLA)** - **5-9 Programmable Array Logic (PAL)** - **References** - **Problems** ### 6 Synchronous Sequential Logic - **6-1 Introduction** - **6-2 Flip-Flops** - **6-3 Triggering of Flip-Flops** - **6-4 Analysis of Clocked Sequential Circuits** - **6-5 State Reduction and Assignment** - **6-6 Flip-Flop Excitation Tables** - **6-7 Design Procedure** - **6-8 Design of Counters** - **References** - **Problems** ### 7 Registers, Counters, and the Memory Unit - **7-1 Introduction** - **7-2 Registers** - **7-3 Shift Registers** - **7-4 Ripple Counters** - **7-5 Synchronous Counters** - **7-6 Timing Sequences** - **7-7 Random-Access Memory (RAM)** - **7-8 Memory Decoding** - **7-9 Error-Correcting Codes** - **References** - **Problems** ### 8 Algorithmic State Machines (ASM) - **8-1 Introduction** - **8-2 ASM Chart** - **8-3 Timing Considerations** - **8-4 Control Implementation** - **8-5 Design with Multiplexers** - **8-6 PLA Control** - **References** - **Problems** ### 9 Asynchronous Sequential Logic - **9-1 Introduction** - **9-2 Analysis Procedure** - **9-3 Circuits with Latches** - **9-4 Design Procedure** - **9-5 Reduction of State and Flow Tables** - **9-6 Race-Free State Assignment** - **9-7 Hazards** - **9-8 Design Example** - **References** - **Problems** ### 10 Digital Integrated Circuits - **10-1 Introduction** - **10-2 Special Characteristics** - **10-3 Bipolar-Transistor Characteristics** - **10-4 RTL and DTL Circuits** - **10-5 Transistor-Transistor Logic (TTL)** - **10-6 Emmitter-Coupled Logic (ECL)** - **10-7 Metal-Oxide Semiconductor (MOS)** - **10-8 Complementary MOS (CMOS)** - **10-9 CMOS Transmission Gate Circuits** - **References** - **Problems** ### 11 Laboratory Experiments - **11-0 Introduction to Experiments** - **11-1 Binary and Decimal Numbers** - **11-2 Digital Logic Gates** - **11-3 Simplification of Boolean Functions** - **11-4 Combinational Circuits** - **11-5 Code Converters** - **11-6 Design with Multiplexers** - **11-7 Adders and Subtractors** - **11-8 Flip-Flops** - **11-9 Sequential Circuits** - **11-10 Counters** - **11-11 Shift Registers** - **11-12 Serial Addition** - **11-13 Memory Unit** - **11-14 Lamp Handball** - **11-15 Clock-Pulse Generator** - **11-16 Parallel Adder** - **11-17 Binary Multiplier** - **11-18 Asynchronous Sequential Circuits** - **References** - **Problems** ### 12 Standard Graphic Symbols - **12-1 Rectangular-Shape Symbols** - **12-2 Qualifying Symbols ** - **12-3 Dependency Notation** - **12-4 Symbols for Combinational Elements** - **12-5 Symbols for Flip-Flops** - **12-6 Symbols for Registers** - **12-7 Symbols for Counters** - **12-8 Symbol for RAM** - **References** - **Problems** ### Appendix: Answers to Selected Problems ### Index ## 1 Binary Systems ### 1-1 Digital Computers and Digital Systems Digital Computers have made possible many scientific, industrial, and commercial advancements that would have been unattainable otherwise. Our space program would have been impossible without real-time continuous computer monitoring, and many businesses function efficiently only with the aid of automatic data processing. Computers are used in scientific calculations, commercial and business data processing, air traffic control, space guidance, the educational field, and many other areas. The most striking property of a digital computer is its generality. It can follow a sequence of instructions, called a program, that operates on given data. The user can specify and change programs and/or data according to the specific need. As a result of this flexibility, general-purpose digital computers can perform a wide variety of information-processing tasks. The general-purpose digital computer is the best-known example of a digital system. Other examples include telephone switching exchanges, digital voltmeters, digital counters, electronic calculators, and digital displays. Characteristic of a digital system is its manipulation of discrete elements of information. Such discrete elements may be electric impulses, the decimal digits, the letters of an alphabet, arithmetic operations, punctuation marks, or any other set of meaningful symbols. The juxtaposition of discrete elements of information represents a quantity of information. For example, the letters d, o, and g form the word dog. The digits 237 form a number. Thus, a sequence of discrete elements forms a language, that is, a discipline that conveys information. Early digital computers were used mostly for numerical computations. In this case, the discrete elements used are the digits. From this application, the term digital computer has emerged. A more appropriate name for a digital computer would be a "discrete information-processing system." ### 1-2 Binary Numbers A decimal number such as 7392 represents a quantity equal to 7 thousands plus 3 hundreds, plus 9 tens, plus 2 units. The thousands, hundreds, etc. are powers of 10 implied by the position of the coefficients. To be more exact, 7392 should be written as: $7 \times 10^3 + 3 \times 10^2 + 9 \times 10^1 + 2 \times 10^0$ However, the convention is to write only the coefficients and from their position deduce the necessary powers of 10. In general, a number with a decimal point is represented by a series of coefficients as follows: $a_5a_4a_3a_2a_1a_0.a_{-1}a_{-2}a_{-3}$ The $a_j$ coefficients are one of the ten digits (0, 1, 2,...9), and the subscript value j gives the place value and, hence, the power of 10 by which the coefficient must be multiplied. $10^5a_5 + 10^4a_4 + 10^3a_3 + 10^2a_2 + 10^1a_1 + 10^0a_0 + 10^{-1}a_{-1} + 10^{-2}a_{-2} + 10^{-3}a_{-3}$ The decimal number system is said to be of base, or radix, 10 because it uses ten digits and the coefficients are multiplied by powers of 10. The binary system is a different number system. The coefficients of the binary numbers system have two possible values: 0 and 1. Each coefficient $a_j$ is multiplied by 2. For example, the decimal equivalent of the binary number 11010.11 is 26.75, as shown from the multiplication of the coefficients by powers of 2: $1 \times 2^4 + 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 0 \times 2^0 + 1 \times 2^{-1} + 1 \times 2^{-2}= 26.75$ In general, a number expressed in base-$r$ system has coefficients multiplied by powers of $r$: $a_n \times r^ n + a_{n- 1} \times r^{n-1} + ... + a_2 \times r^2 + a_1 \times r^1 + a_0$ $+ a_{-1} \times r^{-1} + a_{-2} \times r^{-2} + ... + a_{-m} \times r^{-m}$ The coefficients $a_j$ range in value from 0 to $r-1$. To distinguish between numbers of different bases, we enclose the coefficients in parentheses and write a subscript equal to the base used (except sometimes for decimal numbers, where the content makes it obvious that it is decimal). An example of a base-5 number is: $(4021.2)_5 = 4 \times 5^3 + 0 \times 5^2 + 2 \times 5^1 + 1 \times 5^0 + 2 \times 5^{-1} = (511.4)_{10}$ Note that coefficient values for base 5 can be only 0, 1, 2, 3, and 4. It is customary to borrow the needed digits for the coefficients from the decimal system when the base of the number is less than 10. The letters of the alphabet are used to supplement the ten decimal digits when the base of the number is greater than 10. For example, in the hexadecimal (base 16) number system, the first ten digits are borrowed from the decimal system. The letters A, B, C, D, E, and F are used for digits 10, 11, 12 ,13 ,14, and 15, respectively. An example of a hexadecimal number is: $(B65F)_{16} = 11 \times 16^3 + 6 \times 16^2 + 5 \times 16^1 + 15 = (46687)_{10}$ The first 16 numbers in the decimal, binary, octal, and hexadecimal systems are listed in Table 1-1. | Decimal (base 10) | Binary (base 2) | Octal (base 8) | Hexadecimal (base 16) | |---|---|---|---| | 00 | 0000 | 00 | 0 | | 01 | 0001 | 01 | 1 | | 02 | 0010 | 02 | 2 | | 03 | 0011 | 03 | 3 | | 04 | 0100 | 04 | 4 | | 05 | 0101 | 05 | 5 | | 06 | 0110 | 06 | 6 | | 07 | 0111 | 07 | 7 | | 08 | 1000 | 10| 8 | | 09 | 1001 | 11 | 9 | | 10 | 1010 | 12 | A | | 11 | 1011 | 13 | B | | 12 | 1100 | 14 | C | | 13 | 1101 | 15 | D | | 14 | 1110 | 16 | E | | 15 | 1111 | 17 | F | Arithmetic operations with numbers in base r follow the same rules as for decimal numbers. When other than the familiar base 10 is used, one must be careful to use only the r allowable digits. Examples of addition, subtraction, and multiplication of two binary numbers are as follows: | Augend | Minuend | Multiplicand | Multiplier | Sum | Difference | Product | |---|---|---|---|---|---|---| | 101101 | 101101 | 1011 | 101 | 1010100 | 000110 | 110111 | The sum of two binary numbers is calculated by the same rules as in decimal, except that the digits of the sum in any significant position can be only 0 or 1. Any carry obtained in a given significant position is used by the pair of digits one significant position higher. The subtraction is slightly more complicated. The rules are still the same as in decimal, except that the borrow in a given significant position adds 2 to a minuend digit. (A borrow in the decimal system adds 10 to a minuend digit.) Multiplication is very simple. The multiplier digits are always 1 or 0. Therefore, the partial products are equal either to the multiplicand or to 0. ### 1-3 Number Base Conversions A binary number can be converted to decimal by forming the sum of the powers of 2 of those coefficients whose value is 1. For example, $(1010.011)_2 = 2^4 + 2^2 + 2^0 + 2^{-2} + 2^{-3} = (10.375)_{10}$ The binary number has four 1's and the decimal equivalent is found from the sum of four powers of 2. Similarly, a number expressed in baser can be converted to its decimal equivalent by multiplying each coefficient with the corresponding power of r and adding. The following is an example of octal-to-decimal conversion: $(630.4)_8 = 6 \times 8^2 + 3 \times 8^1 + 4 \times 8^{-1} = (408.5)_{10}$ The conversion from decimal to binary or to any other baser system is more convenient, if the number is separated into an integer part and a fraction part and the conversion of each part done separately. The conversion of an integer from decimal to binary is best explained by example. Convert decimal 41 to binary. First, 41 is divided by 2 to give an integer quotient of 20 and a remainder of 1. The quotient is again divided by 2 to give a new quotient and remainder. This process is continued until the integer quotient becomes 0. The coefficients of the desired binary number are obtained from the remainders as follows: | Integer quotient | Remainder | Coefficient | |---|---|---| | 41 | 2 | ao = 1 | | 20 | 0 | a1 = 0 | | 10 | 0 | a2 = 0 | | 5 | 1 | a3 = 1 | | 2 | 0 | a4 = 0 | | 1 | 1 | a5 = 1 | Answer : $(41)_{10} = (a_5 a_4 a_3 a_2 a_1 a_0)_2 = (101001)_2$ The arithmetic process can be manipulated more conveniently as follows: | Integer | Remainder | |---|---| | 41 | 1 | | 20 | 0 | | 10 | 0 | | 5 | 1 | | 2 | 0 | | 1 | 1 | | 0 | 1 | Answer : (101001)2 The conversion from decimal integers to any base r system is similar to the example, except that division is done by r instead of 2. Convert decimal 153 to octal. The required baser is 8. First, 153 is divided by 8 to give an integer quotient of 19 and a remainder of 1. Then 19 is divided by 8 to give an integer quotient of 2 and a remainder of 3. Finally, 2 is divided by 8 to give a quotient of 0 and a remainder of 2. This process can be conveniently manipulated as follows: $153 | 8 = 19 | 1$ $19 | 8 = 2 | 3$ $2 | 8 = 0 | 2$ Answer: (231)8 The conversion of a decimal fraction to binary is accomplished by a method similar to that used for integers. However, multiplication is used instead of division, and integers are accumulated instead of remainders. Again, the method is best explained by example. Convert $(0.6875)_{10}$ to binary. First, 0.6875 is multiplied by 2 to give an integer and a fraction. The new fraction is multiplied by 2 to give a new integer and a new fraction. This process is continued until the fraction becomes 0 or until the number of digits have sufficient accuracy. The coefficients of the binary number are obtained from the integers as follows: | Integer | Fraction | Coefficient | |---|---|---| | 0.6875 × 2 = 1 | + 0.3750 | a-1 = 1 | | 0.3750 × 2 = 0 | + 0.7500 | a-2 = 0 | | 0.7500 × 2 = 1 | + 0.5000 | a-3 = 1 | | 0.5000 × 2 = 1 | + 0.0000 | a-4 = 1 | Answer: $(0.6875)_{10} = (0.a_{-1}a_{-2}a_{-3}a_{-4})_2 = (0.1011)_2$ To convert a decimal fraction to a number expressed in base $r$, a similar procedure is used. Multiplication is by $r$ instead of 2, and the coefficients found from the integers may range in value from 0 to $r-1$ instead of 0 and 1. Convert $(0.513)_{10}$ to octal. $0.513 \times 8 = 4.104$ $0.104 \times 8 = 0.832$ $0.832 \times 8 = 6.656$ $0.656 \times 8 = 5.248$ $0.248 \times 8 = 1.984$ $0.984 \times 8 = 7.872$ The answer, to seven significant figures, is obtained from the integer part of the products: $(0.513)_{10}= (0.406517...)_8$ The conversion of decimal numbers with both integer and fraction parts is done by converting the integer and fraction separately and then combining the two answers. Using the results of Examples 1-1 and 1-3, we obtain: $(41.6875)_{10}= (101001.1011)_2$ From Examples 1-2 and 1-4, we have: $(153.513)_{10}= (231.406517)_8$ ### 1-4 Octal and Hexadecimal Numbers The conversion from and to binary, octal, and hexadecimal plays an important part in digital computers. Since $2^3=8$ and $2^4=16$, each octal digit corresponds to three binary digits and each hexadecimal digit corresponds to four binary digits. The conversion from binary to octal is easily accomplished by partitioning the binary number into groups of three digits each, starting from the binary point and proceeding to the left and to the right. The corresponding octal digit is then assigned to each group. The following example illustrates the procedure: $(10 \ 110 \ 001 \ 101 \ 011 \ 111 \ 100 \ 000 \ 110)_2 = (26153.7460)_8$ Conversion from binary to hexadecimal is similar, except that the binary number is divided into groups of four digits: $(10 \ 1100 \ 0110 \ 1011 \ 1111 \ 0010)_2 = (2C6B.F2)_{16}$ The corresponding hexadecimal (or octal) digit for each group of binary digits is easily remembered after studying the values listed in Table 1- 1. Conversion from octal or hexadecimal to binary is done by a procedure reverse to the above. Each octal digit is converted to its three-digit binary equivalent. Similarly, each hexadecimal digit is converted to its four-digit binary equivalent. This is illustrated in the following examples: $(673.124)_8 = (110 \ 111 \ 011 \ 101 \ 011 \ 001 \ 100)_2 $ $(306.D)_{16} = (0011 \ 0000 \ 0110 \ 1101)_2 $ Binary numbers are difficult to work with because they require three or four times as many digits as their decimal equivalent. For example, the binary number 111111111111 is equivalent to decimal 4095. However, digital computers use binary numbers and it is sometimes necessary for the human operator or user to communicate directly with the machine by means of binary numbers. One scheme that retains the binary system in the computer but reduces the number of digits the human must consider utilizes the relationship between the binary number system and the octal or hexadecimal system. By this method, the human thinks in terms of octal or hexadecimal numbers and performs the required conversion by inspection when direct communication with the machine is necessary. Thus the binary number 111111111111 has 12 digits and is expressed in octal as 7777 (four digits ) or in hexadecimal as FFF (three digits). During communication between people (about binary numbers in the computer), the octal or hexadecimal representation is more desirable because it can be expressed more compactly with a third or a quarter of the number of digits required for the equivalent binary number. When the human communicates with the machine (through console switches or indicator lights or by means of programs written in machine language), the conversion from octal or hexadecimal to binary and vice versa is done by inspection by the human user. ### 1-5 Complements Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation. There are two types of complements for each base-r system: the radix complement and the diminished radix complement. The first is referred to as the r's complement and the second as the (r-1)'s complement. When the value of the base r is substituted in the name, the two types are referred to as the 2's complement and I's complement for binary numbers, and the 10's complement and 9's complement for decimal numbers. #### Diminished Radix Complement Given a number N in base r having n digits, the (r-1)'s complement of N is defined as $(r^n-1)-N$. For decimal numbers, r = 10 and (r-1) = 9, so the 9's complement of N is $(10^n-1)-N$. Now, 10" represents a number that consists of a single 1 followed by n 0's. 10" - 1 is a number represented by n 9's. For example, if n=4, we have 10^4 = 10,000 and 10^4 - 1 = 9999. It follows that the 9's complement of a decimal number is obtained by subtracting each digit from 9. Some numerical examples follow. The 9's complement of 546700 is 999999 - 546700 = 453299. The 9's complement of 012398 is 999999 - 012398 = 987601. For binary numbers, r=2 and (r-1)=1, so the 1's complement of Nis $(2^n -1) -N$. Again, $2^n$ is represented by a binary number that consists of a 1 followed by n 0's. $2^ n - 1$is a binary number represented by n 1's. For example, if n=4, we have 2^4= (10000)_2 and 2^4 - 1 = (1111)_2. Thus the 1's complement of a binary number is obtained by subtracting each digit from 1. However, when subtracting binary digits from 1, we can have either 1-0=1 or 1-1=0, which causes the bit to change from 0 to 1 or from 1 to 0. Therefore, the 1's complement of a binary number is formed by changing 1's to 0's and 0's to 1's. The following are some numerical examples. The 1's complement of 1011000 is 0100111. The 1's complement of 0101101 is 1010010. The (r-1)'s complement of octal or hexadecimal numbers is obtained by subtracting each digit from 7 or F (decimal 15), respectively. #### Radix Complement The r's complement of an n-digit number N in base r is defined as $r^n-N$ for $N\neq 0$. We note that the r's complement is obtained by adding 1 to the (r-1)'s complement since $r^n - N = [(r-1) - N] + 1$. Thus, the 10's complement of decimal 2389 is 7610 + 1 = 7611 and is obtained by adding 1 to the 9's-complement value. The 2's complement of binary 101100 is 010011 + 1 = 010100 and is obtained by adding 1 to the I's-complement value. Since $10^n$ is a number represented by a 1 followed by n O's, $10^n - N$, which is the 10's complement of N, can be formed also by leaving all least significant O's unchanged, subtracting the first nonzero least significant digit from 10, and subtracting all higher significant digits from 9. The 10's complement of 012398 is 987602. The 10's complement of 246700 is 753300. The 10's complement of the first number is obtained by subtracting 8 from 10 in the least significant position and subtracting all other digits from 9. The 10's complement of the second number is obtained by leaving the two least significant O's unchanged, subtracting 7 from 10, and subtracting the other three digits from 9. Similarly, the 2's complement can be formed by leaving all least significant 0's and the first 1 unchanged, and replacing 1's with 0's and 0's with 1's in all other higher significant digits. The 2's complement of 1101100 is 0010100. The 2's complement of 0110111 is 1001001. The 2's complement of the first number is obtained by leaving the two least significant 0's and the first 1 unchanged, and then replacing 1's with 0's and 0's with 1's in the other four most-significant digits. The 2's complement of the second number is obtained by leaving the least significant 1 unchanged and complementing all other digits. In the previous definitions, it was assumed that the numbers do not have a radix point. If the original number N contains a radix point, the point should be removed temporarily in order to form the r's or (r-1)'s complement. The radix point is then restored to the complemented number in the same relative position. It is also worth mentioning that the complement of the complement restores the number to its original value. The r's complement of N is $r^n - N$. The complement of the complement is $(r^n-N)'=N$, giving back the original number. ### Subtraction with Complements The direct method of subtraction taught in elementary schools uses the borrow concept. In this method, we borrow a 1 from a higher significant position when the minuend digit is smaller than the subtrahend digit. This seems to be easiest when people perform subtraction with paper and pencil. When subtraction is implemented with digital hardware, this method is found to be less efficient than the method that uses complements. The subtraction of two n-digit unsigned numbers M-N in base r can be done as follows: 1. Add the minuend M to the r's complement of the subtrahend N. This performs $M + (r^n - N) = M - N + r^n$. 2. If $M\geq N$, the sum will produce an end carry, $r^n$, which is discarded; what is left is the result M-N. 3. If $M<N$, the sum does not produce an end carry and is equal to $(N - M)'$, which is the r's complement of (N-M). To obtain the answer in a familiar form, take the r's complement of the sum and place a negative sign in front. The following examples illustrate the procedure. Using 10's complement, subtract 72532 - 3250. $M = 72532$ $10^5\text{complement of }N = 96750$ $Sum = 169282$ $Discard \text{end carry }10^5 = -100000$ $\text{Answer} = 69282$ Note that M has 5 digits and N has only 4 digits. Both numbers must have the same number of digits; so we can write N as 03250. Taking the 10's complement of N produces a 9 in the most significant position. The occurrence of the end carry signifies that $M \geq N$ and the result is positive. Using 10's complement, subtract 3250 - 72532. $M = 03250$ $10^5 \text{complement of N}= 27468$ $Sum = 30718$ There is no end carry. $\text{Answer} = -(10^5 \text{complement of }30718) = -69282$ Note that since 3250 < 72532, the result is negative. Since we are dealing with unsigned numbers, there is really no way to get an unsigned result for this case. When subtracting with complements, the negative answer is recognized from the absence of the end carry and the complemented result. When working with paper and pencil, we can change the answer to a signed negative number in order to put it in a familiar form. Subtraction with complements is done with binary numbers in a similar manner using the same procedure outlined before. Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction (a) X-Y and (b) Y-X using 2's complements. (a) $X=1010100$ $2's \text{complement of Y} = 0111101$ $Sum = 10010001$ $Discard \text{end carry }2^7 = - 10000000$ $\text{Answer} : X - Y = 0010001$ (b) $Y=1000011$ $2's \text{complement of X} = 0101100 $ $Sum = 1101111$ There is no end carry. $\text{Answer} : Y - X = (2's \text{complement of }1101111) = -0010001$ Subtraction of unsigned numbers can be done also by means of the (r-1)'s complement. Remember that the (r-1)'s complement is one less than the r's complement. Because of this, the result of adding the minuend to the complement of the subtrahend produces a sum that is 1 less than the correct difference when an end carry occurs. Removing the end carry and adding 1 to the sum is referred to as an end-around carry. Repeat Example 1-7 using I's complement. (a) X-Y = 1010100 - 1000011 $X=1010100$ $1's \text{

Use Quizgecko on...
Browser
Browser