Complements -2




(r's) Complement :

10's complement:

The r's complement of an n-digit number N in base r is defined as r' - N for N * D and D for N = D. Comparing with the (r - I)'s complement, we note that the r's complement is obtained by adding I to the (r - I)'s complement since r' - N = [(r' - I) - N] + I. Thus the ID's complement of the decimal 2389 is 76ID + I = 7611 and is obtained by adding I to the 9' s complement value. The 2's complement of binary I01 I00 is 010011 + I = 0I0I00 and is obtained by adding I to the I's complement value.

Since ID' is a number represented by a I followed by n D's, then ID' - N, which is the ID's complement of N, can be formed also be leaving all least significant D's unchanged, subtracting the first nonzero least significant digit from ID, and then subtracting all higher significant digits from 9. The I0's complement of 246700 is 753300 and is obtained by leaving the two zeros unchanged, subtracting 7 from I0, and subtracting the other three digits from 9.

Topics You May Be Interested In
Number System Shift Micro-operations - Logical, Circular, Arithmetic Shifts
Fixed-point Representation Program Counter
Other Decimal Codes Instruction Set Completeness
Register Transfer Language -2 Timing And Control
Bus And Memory Transfers -2 Memory-reference Instructions - Sta, Lda And Bsa

2's complement: 

Similarly, the 2's complement can be formed by leaving all least significant 0's and the first I unchanged, and then replacing I's by 0's and 0's by I's in all other higher significant bits. The 2's complement of 1101 100 is 00I0I00 and is obtained by leaving the two low-order 0's and the first I unchanged, and then replacing I's by 0's and 0's by I's in the other four most significant bits.

In the definitions above it was assumed that the numbers do not have a radix point. If the original number N contains a radix point, it should be removed temporarily to form the r's or (r - I)'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. The complement of the complement is r' - (r' - N) = N giving back the original number.



Frequently Asked Questions

+
Ans: 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 r's complement and the (r - l)'s complement. view more..
+
Ans: Many applications of digital computers require the handling of data that consist not only of numbers, but also of the letters of the alphabet and certain special characters view more..
+
Ans: The binary number system is the most natural system for a computer, but people are accustomed to the decimal system. One way to solve this conflict is to convert all input decimal numbers into binary numbers, let the computer perform all arithmetic operations in binary and then convert the binary results back to decimal for the human user to understand. view more..
+
Ans: The r's complement of an n-digit number N in base r is defined as r' - N for N * D and D for N = D. Comparing with the (r - I)'s complement, we note that the r's complement is obtained by adding I to the (r - I)'s complement since r' - N = [(r' - I) - N] + I. view more..
+
Ans: 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 corresponding subtrahend digit. view more..
+
Ans: Since we are dealing with unsigned numbers, there is really no way to get an unsigned result for the second example. view more..
+
Ans: Positive integers, including zero, can be represented as unsigned numbers. However, to represent negative integers, we need a notation for negative values. In ordinary arithmetic, a negative number is indicated by a minus sign and a positive number by a plus sign. view more..
+
Ans: When an integer binary number is positive, the sign is represented by 0 and the magnitude by a positive binary number. When the number is negative, the sign is represented by 1 but the rest of the number may be represented in one of three possible ways: view more..
+
Ans: The addition of two numbers in the signed-magnitude system follows the rules of ordinary arithmetic. If the signs are the same, we add the two magnitudes and give the sum the common sign. If the signs are different, we subtract the smaller magnitude from the larger and give the result the sign of the larger magnitude. view more..
+
Ans: Subtraction of two signed binary numbers when negative numbers are in 2' s complement form is very simple and can be stated as follows: Take the 2's complement of the subtrahend (including the sign bit) and add it to the minuend (including the sign bit). A carry out of the sign bit position is discarded. view more..
+
Ans: When two numbers of n digits each are added and the sum occupies n + 1 digits, we say that an overflow occurred. When the addition is performed with paper and pencil, an overflow is not a problem since there is no limit to the width of the page to write down the sum. view more..
+
Ans: An overflow condition can be detected by observing the carry into the sign bit position and the carry out of the sign bit position. If these two carries are not equal, an overflow condition is produced. view more..
+
Ans: The representation of decimal numbers in registers is a function of the binary code used to represent a decimal digit. A 4-bit decimal code requires four flip-flops for each decimal digit. view more..
+
Ans: The floating-point representation of a number has two parts. The first part represents a signed, fixed-point number called the mantissa. The second part designates the position of the decimal (or binary) point and is called the exponent. The fixed-point mantissa may be a fraction or an integer. For exam ple, the decimal number +6132.789 is represented in floating-point with a fraction and an exponent as follows: view more..
+
Ans: A floating-point number is said to be normalized if the most significant digit of the mantissa is nonzero. For example, the decimal number 350 is normalized but 00035 is not. Regardless of where the position of the radix point is assumed to be in the mantissa, the number is normalized only if its leftmost digit is nonzero. view more..
+
Ans: In previous sections we introduced the most common types of binary-coded data found in digital computers. Other binary codes for decimal numbers and alphanumeric characters are sometimes used. Digital computers also employ other binary codes for special applications. A few additional binary codes encountered in digital computers are presented in this section. view more..
+
Ans: Binary codes for decimal digits require a minimum of four bits. Numerous different codes can be formulated by arranging four or more bits in 10 distinct possible combinations. A few possibilities are shown in Table 3-6. view more..
+
Ans: The ASCII code (Table 3-4) is the standard code commonly used for the transmission of binary information. Each character is represented by a 7-bit code and usually an eighth bit is inserted for parity (see Sec. 3-6). The code consists of 128 characters. Ninety-five characters represent graphic symbols that include upper- and lowercase letters, numerals zero to nine, punctuation marks, and special symbols view more..




Rating - 3/5
465 views

Advertisements