a digital signal processing system does not always deal with positive values. For instance, considering a case that an A/D (analog to digital) converter converts an analog input data into a digital signal to obtain a new value by subtracting so-converted digital signals, when a subtraction of A-B is implemented, if the value A is bigger than the value B the output will be positive, where the output data is, of course, valid.
However, if the value A is smaller than the value B the output data will be negative, an invalid value.
Therefore, it is understood that the digital code data must be able to deal with not only the positive value (number) but also the negative value. In practice, to meet this end the conventional digital signal processing system adopts various code systems.To this end, a signed-magnitude code can be used, which has an extra bit for indicating whether the value of the code is positive or negative. This code system is divided into a part for indicating the absolute value of the code and another part for indicating the sign value thereof.
The so-called 2's complement code system can also be used. The basic principle of this 2's complement code is to use the concept of the complement numbers.
Being consistently calculable both for addition and subtraction, this code system is widely used in general digital signal processing systems.
In a general digital signal processing system, the same result can be obtained regardless of the code system. When, however, a very high frequency (maybe, tens of MHz) is used for the operating clock, the various characteristics, particularly the speed characteristic of the digital signal processing system is strongly dependent upon the code system.
According to the substantial digital signal processing system, the construction can be regarded as a combination of an adder, a subtractor, a multiplier and a divider, all of which is for processing correspondingly the input data code (for example, the straight code, the signed-magnitude code or the 2's complement code).
It is well known that the 2's complement code sytem is advantageous in that the negative numbers can be easily expressed and operated so that the consistency for both the addition and subtraction can be used fruitfully in operating the numbers.
subtraction of two binary numbers, all the bits of an addend are added to the corresponding bits of the 2's complement number of the binary number to be added. It should be noticed in advance that a 2's complement number can be obtained by adding 1 to the 1's complement of a number. This relation can be expressed as follows;
A-B=A+(-B)=A+B+1
In the meantime, in the case where 2'S complement codes are multiplied, the 2'S complement codes are divided into a sign and an absolute value (magnitude of the code) and the absolute value is multiplied first and then the sign is corrected separately.
Answered by
Sharad Singh
, an ibibo Master,
at
1:48 PM on May 30, 2008