Abstract:
A carry-save adder for a bit-parallel addition of binary numbers in two&#39;s complement form incorporates a series of first adders for forming intermediate sum and carry words which are combined in an adder means to form a sum word. A decoder is provided for recognizing saturation of the carry-save adder and for generating overflow signals in dependence on the two most significant bits of the intermediate sum and carry words. When the overflow signals are generated, the recursive circuit branches are disconnected and saturation intermediate sum and carry words are substituted for the intermediate sum and carry words which yield sum words which do not exceed the permissible adder content.

Description:
BACKGROUND 
     The invention relates to an arrangement comprising a carry-save adder for bit-parallel addition of binary numbers in two&#39;s complement. 
     A carry-save adder of this type is known from the book Computer Arithmethic by K. Hwang, John Wiley &amp; Sons, New York, 1979, pp. 98-103, particularly, FIG. 4.2. Every first adder has three inputs which are connected to equivalent bits of three binary numbers which are to be added to one another. The sum outputs of the first adders are connected to first inputs of the adder means and the carry outputs of the first adders (with the exception of the most significant first adder) are connected to second inputs of the adder means. A sum word appears at the outputs of the latter as the result of the addition. In contrast to an adder arrangement having ripple carry (carry-propagate principle), the carries of all the first adders are simultaneously formed by addition of three binary numbers, and are available as a carry word for addition in the adder means, being available at the same time as the intermediate sum word produced by the first adders. An adder constructed in this fashion works on what is referred to as the carry-save principle. 
     When binary numbers are externally supplied to the third inputs of the first adders, and a first intermediate result achieved by a preceding addition is supplied to the first two inputs, such first intermediate results being composed of an intermediate sum word supplied to the first inputs and of a carry word supplied to the second inputs, then a second intermediate result formed by addition of the first intermediate result and this number is produced at the outputs of the first adders. 
     A continuing formation of constantly new intermediate results which are obtained, given a continuous supply of further binary numbers via the third inputs, is referred to as an accumulation of these numbers. An overflow of the sum word can then occur, in that the allowable adder content which is dependent on the prescribed plurality of first adders is upwardly (or downwardly) exceeded for positive (or negative) contents. With a carry-save adder employed in recursive circuits, such an overflow frequently means that the adder contact begins to periodically change between two limit values, whereby the constantly changing sum word at the output of the adder means corresponds to an analog oscillation. Such behavior of an adder in a recursive circuit is described in Proc. of the IEEE, Vol. 63, No. 4, April 1975, pp. 633-648, cf., in particular, FIGS. 5 and 6 and the appertaining text of page 636. 
     BRIEF DESCRIPTION OF THE INVENTION 
     The object of the present invention is to provide an arrangement wherein an overflow of the accumulated sum word is reliably avoided. 
     The advantage obtainable with the invention is that intermediate sum words or carry words that can lead to an overflow of the sum word are directly employed for the recognition of a overflow situation and for the elimination thereof. Uncontrolled fluctuation of the sum word are thereby suppressed. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The invention shall be set forth in greater detail below with reference to preferred exemplary embodiments shown in the drawings, in which: 
     FIG. 1 is a functional block diagram of an arrangement fashioned in accord with the invention comprising a carry-save adder for bit-parallel addition of three binary numbers; 
     FIG. 2 is a schematic diagram of an exemplary circuit of a first sub-circuit according to FIG. 1; 
     FIG. 3 is a schematic diagram of an exemplary circuit of a second sub-circuit according to FIG. 1; 
     FIG. 4 is a schematic diagram of an exemplary circuit of a third sub-circuit according to FIG. 1; 
     FIG. 5 is a functional block diagram of an arrangement of the invention comprising a carry-save adder for bit-parallel addition of four binary numbers; 
     FIG. 6 is a functional block diagram of an example of an application of an arrangement according to FIG. 1; and 
     FIG. 7 is a functional block diagram of an example of an application of an arrangement according to FIG. 5. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 shows three adders AD n-1 , AD n-2  and AD n-3  each having three inputs, for example 1 through 3, for equivalent bits of three binary numbers represented in two&#39;s complement which are to be added to one another, producing a sum output, for example 4, and a carry output, for example 5. For the addition of n-place binary numbers, FIG. 1 is expanded by further adders AD n-4   . . . AD 0  which corresponds to those shown in terms of structure and function. The sum outputs of the adders AD i  are wired to output lines, for example 6 through 8, which are connected to first inputs 11, 12, 13 . . . of an adder means AS. The carry outputs of the adders AD i , with the exception of AD n-1 , are wired to output lines 14, 15 . . . which are respectively connected to second inputs 21, 22 . . . of AS. The adder means AS has outputs 31, 32 . . . 3n. AS is composed, for example, of n adders AS n-1  . . . AS 0  each having three inputs and an output. The first two inputs of AS n-1  correspond to the inputs 11 and 21 of AS and the output of AS n-1  correspond to the output 31 of AS. AS n-2  has two inputs 12, 22 and an output 32, etc. The third input (not shown) of AS n-1  is connected to carry output of AS n-2  and the third input (not shown) of AS n-2  is connected to the carry output of AS n-3 , etc. 
     A recursive circuit branch 16 connects the output line 6 from the sum output of AD n-1  to the first input of this adder. A second recursive circuit branch 17 connects the output line 14 from the carry output 5 of AD n-2  to the second input of AD n-1 . In a corresponding fashion, recursive circuit branches 18, 19 are connected to the first two inputs 1, 2 of AD n-2  and respectively further recursive circuit branches are connected to the first two inputs of the remaining adders AD i . Respective logic circuits 23 through 25 are inserted into the output lines 6 through 8 and further logic circuits 26 and 27 are inserted into the output lines 14 and 15. Further, respective intermediate memories which are preferably shift registers, 33 through 37 are inserted into the output lines 6 through 8, 14 and 15. The recursive circuit branches, for example 16, 17, receive signals from the appertaining output lines, for example 6, 14, through the logic circuits 23 through 27 and the intermediate memories 33 through 37. 
     A decoder 28 comprises four inputs 29, 30, 38 and 39, of which 29 and 30 are connected to the first two inputs of AD n-1 , and 38 and 39 are connected to the first two inputs of AD n-2 . Outputs 40 and 40&#39; of 28 are wired to inputs of all logic circuits, for example 23 through 27. The output 41 of 28 is connected to the inputs of some logic circuits, for example 25, which follow downstream of the sum outputs of the adders AD i , whereas the output 42 is connected to the inputs of the remaining logic circuits, for example 23 and 24, which follow downstream of the sum outputs of AD i . 
     An (n-1)-place binary number D represented in two&#39;s complement made up of the bits d n-2 , d n-3  . . . d 0  is applied to the third inputs of AD i , whereby the most significant bit d n-2  is supplied to the third inputs of AD n-1  and AD n-2  because of the connected 43. The number D is thus expanded into an n-place number by doubling its operational sign bit. Neglecting the logic circuits 23 through 27, after the execution of a bit-parallel addition in the adders AD i , the bits d n-2 , d n-03  . . . also appear at the sum outputs thereof, and are written into the intermediate memories 33 through 35. With a clock pulse, these bits are then connected through and supplied to the first inputs, for example 1, of AD i  via the recursive circuit branches 16, 18 . . . , and a new binary number D1 is simultaneously applied to the third inputs of AD i . After the execution of an addition, a first intermediate result corresponding to the sum of D+D1 is obtained in the form of an intermediate sum word at the sum outputs and a carry word at the carry outputs of AD i . The bits of the intermediate sum word are written into the intermediate memories 33, 34 . . . and the bits of the carry word are written into the intermediate memories 36, 37 . . . . At the appearance of a further clock pulse, the bits of the intermediate sum word are connected through to the first inputs of AD i  and the bits of the carry word are connected through to the second inputs thereof, whereby a further binary number D2 is applied to the third inputs of AD i . After the execution of a following addition, a second intermediate result is available at the outputs of AD i , this corresponding to the sum of D+D1+D2 and being written into the intermediate memories 33 through 37. At every further clock pulse, a new number Di is then applied to the third inputs, and after an addition step, a new intermediate result is obtained, which is composed of the sum of the previously accumulated intermediate result and the respective number Di. 
     The intermediate results, which are respectively present in the form of an intermediate sum word S having the bits s n-1 , s n-2  . . . at the inputs 11, 12, 12 . . . and a carry word C having the bits c n-1 , c n-2  . . . at the inputs 21, 22 . . . of AS, are combined in AS to form sum words S&#39; having the bits s n-1  &#39;, s n-2  &#39; . . . s 0  &#39; which appear at the outputs 31, 32 . . . 3n. An arrangement constructed in accord with FIG. 1 and operated in this way is also referred to as an accumulator; its output signal S&#39; is referred to as the respectively accumulated accumulator word which identifies the respecive accumulator content. 
     When, given an accumulator of FIG. 1 comprising n=5, an intermediate sum word S=01110 represented in two&#39;s complement is applied to the first inputs of AD i , a carry word C=0111 is applied to the second inputs and a binary number D=00011 is applied to the third inputs, a new intermediate sum word S1=00011 and a new carry word C1=1110 are produced by the execution of a bit-parallel addition. Since S, C and D respectively correspond to 14, 14 and 3 in decimal notation, an accumulator word which corresponds to the (correct) result of 31 would be anticipated when they are added. However, the new intermediate sum word S1 appearing at the outputs of AD i  corresponds to a decimal number +3 and the new carry word C1 corresponds to a decimal number of -4, so that an accumulator word that corresponds to a (wrong) result of -1 derives therefrom. This is to be attributed to an overflow situation which has arisen in that an accumulator content of 31 can no longer be represented given an accumulator word width of n=5. 
     The decoder 28 serves for the identification of such overflow situations which lead to incorrect intermediate results. In accord with a preferred development of the invention, a first overflow condition, to which the decoder 28 responds with a first overflow signal, arises in that the bits s n-1  and c n-1  presented to these inputs 29 and 30 are both 0 and at least one of the bits s n-2  and c n-2  presented to the inputs 38 and 39 has the value 1. This condition is referred to as positive overflow condition and the inverted overflow signal produced at the output 41 is referred to as +OVFL. A second, negative overflow condition, to which the decoder 28 reacts with a negative inverted overflow signal -OVFL emitted at its output 42, is present when the bits s n-1  and c n-1  presented to the inputs 29 and 30 are both 1 and when at least one of the bits s n-2  and c n-2  presented to inputs 38 and 39 has the value 0. Upon appearance of one of the signals +OVFL or -OVFL, signals ORALL having the value 1 and ORALL having the value 0 are produced via the outputs 40 and 40&#39;. 
     Upon the saturation of the accumulator, with the appearance of one of these two overflow conditions, the logic circuits, for example 26, 27 . . . , at the carry outputs of AD i  are controlled by the signals ORALL and ORALL to disconnect the carry bits c n-1 , c n-2  presented to their outputs, these carry bits being otherwise connected through their outputs. Instead of these bits, saturation carry bits 0 are emitted via the outputs of all these logic circuits. 
     Further, upon the appearance of the positive overflow condition, the logic circuits 23, 24 at the sum outputs of the two most significant adders AD n-1  and AD n-2  are influenced such by the signals -OVFL, ORALL and ORALL so as to disconnect the intermediate sum bits s n-1  and s n-2  present at their inputs--these intermediate sum bits being otherwise connected through to their outputs--and respectively replace them with saturation intermediate sum bits having the value 0. +OVFL, ORALL and ORALL also control the logic circuits, for example 25, connected to the sum outputs of the adders AD n-3  . . . AD 0 , to disconnect the intermediate sum bits, these intermediate sum bits being otherwise connected through to their outputs--and replace them with saturation inermediate sum bits having the value 1. 
     Upon appearance of the negative overflow condition, the logic circuits 23, 24 at the sum outputs of the two most significant adders AD n-1  and AD n-2  are controlled by the signals ORALL, ORALL and -OVFL that they disconnect the intermediate sum bits s n-1  and s n-2  presented to their input sides from their outputs and replace them by saturation intermediate sum bits having the value 1. +OVFL, ORALL and ORALL further control the logic circuits, for example 25, connected to the sum outputs of the adders AD n-3  . . . AD 0  to disconnect the intermediate sum bits present at their inputs from their outputs and respectively replace them with saturation intermediate sum bits having the value 0. 
     The saturation measures set forth above can be generalized to the effect that the output lines, for example 6 through 8 and 14, 15, at the outputs of the adders AD i  are disconnected from the intermediate sum words S and carry words C produced by the adders AD i , upon the appearance of overflow conditions, and instead produce prescribed saturation intermediate sum words and saturation carry words. For the case of a positive (or negative) saturation condition, the saturation intermediate sum word and saturation carry words are selected such that they yield a sum word S&#39; whose appertaining accumulator content comes as close as possible to a limit value for which the positive (or negative overflow conditions is already valid, without reaching or exceeding this limit value, regardless of how the accumulator word is composed. This condition is met in the numerical example cited for a 5-bit accumulator with a saturation carry word of 0000 and a saturation intermediate sum word of 00111 on the occurence of a positive overflow condition, and with a saturation intermediate sum word of 11000 on the occurence of a negative overflow condition. 
     FIG. 2 shows an exemplary embodiment of the decoder 28 of FIG. 1. The inputs 29 and 30 are connected to the inputs of an AND gate 44, as well as to the inputs of a NOR gate 45. The inputs 38 and 39 are connected to the inputs of an NAND gate 46, as well as to the inputs of an OR gate 47. The outputs of 44 and 46 are connected to the inputs of an AND gate 48 and the outputs of 45 and 47 are connected to the inputs of an AND gate 49. The outputs of 48 and 49 in turn are connected to an OR gate 50, whose output forms the output 40 of the decoder 28, and the output 40&#39; via an inverter 51. The output of gate 49 is wired to an inverter 52 whose output produces the output 41 of the decoder. The output of 48 is also wired to an inverter 53 whose output produces the output 42 of the decoder. When the lines 29, 30, 38 and 39 are supplied with the respective bits s n-1 , c n-1 , s n-2  and c n-2 , the positive overflow signal +OVFL is produced at the output of and AND gate 49 and the negative overflow signal -OVFL is produced at the output of 48. The signal ORALL is then available at the output 40 of the OR gate 50 and the signal ORALL is available at the output 40&#39;. The inverted overflow signal +OVFL and -OVFL appear at the outputs 41 and 42. 
     FIG. 3 shows an exemplary embodiment of the logic circuit 26 which follows downstream from the carry output 5 of AD n-2 . In accord with FIg. 3, two switched transistors 54 and 55 have their switched paths lying parallel to one another, with the first designated as a p-channel field effect transistor and the second designed as an n-channel field effect transistor. The source terminals of these transistors are connected to the input of the logic circuit 26 which is in communication with the carry output 5 of FIG. 1 and the drain terminal of these transistors are connected to an output 56 of 26 which is wired to the input of the intermediate memory 36. The output 56 is connected via a further n-channel switching transistor 57 to a circuit point 58 which lies at reference potential. The gates of 54 and 57 receive the signal ORALL and the gate of 55 receives the signal ORALL which is inverted with respect thereto. The remaining logic circuits, for example 27, which are connected downstream of the carry outputs of the adders AD n-3  . . . AD 0  are likewise fashioned in accord with FIG. 3. 
     FIG. 4 shows an exemplary embodiment of the logic circuit 24. Two switching transitors 58a and 59 have their switched paths lying parallel to one another with their source terminals connected to a circuit point in communication with the sum output of AD n-2 . The drain terminals of 58a and 59 are connected to a circuit poin 60 which represents the output of 24. Via the series circuit of two p-channel switching transistors 61 and 62, the circuit point 60 is connected to a terminal 63 which is wired with the supply voltage, and through two n-channel switching transistors 64 and 65, to a terminal 66 lying at reference potential. The gates of the p-channel transistor 58a and the transistor 64 are driven with the signal ORALL via the output 40 and the gates of the n-channel transistor 59 and of the transistor 62 are driven with the inverted signal ORALL output via the output 40&#39;. The gates of transistors 61 and 65 are connected to the output 42 of 28 receive with -OVFL. The logic circuit 23 is also expediently constructed in accord with FIG. 4. 
     The logic circuit 25 is advantageously constructed in accord with FIG. 4, whereby the signal +OVFL is merely employed for the drive of the transistors 61 and 65 instead of the signal -OVFL. The logic circuits which are connected downstream of the sum outputs of the further adders AD n-4  . . . AD 0  are likewise fashioned in accord with the logic circuit 25. 
     With this circuit-oriented design of the logic circuits at the outputs of AD i  and with the decoder of FIG. 2, the accumulator of FIG. 1 is loaded with a saturation carry word of 0000 and a saturation intermediate sum word of 00111 on the appearance of the afore-mentioned, positive overflow condition and with a saturation carry word of 0000 and with a saturation intermediate sum word of 11000 on the appearance of the negative overflow condition. 
     FIG. 5 shows the development of an arrangement of FIG. 1 which serves for the bit-parallel addition of four binary numbers in two&#39;s complement. The group of adders AD i  already shown in FIG. 1 is followed by an additional group of adders ZA i , with every adder ZA i  having three inputs. Neglecting the logic circuits 23 through 27 and of the intermediate memories 22&#39; through 37&#39;, the output lines of AD i  are connected to the inputs of the adders ZA i . In detail, the output lines 6 through 8 are respectively connected to the first inputs Z11, Z12 and Z13 of ZA n-1 , ZA n-2  and ZA n-3  and the output lines 14 and 15 are connected to the second inputs Z21 and Z22 of ZA n-1  and ZA n-2 . Generally, the sum output of the adder AD i  is connected to the first input of the adder ZA i  which follows it, whereas the carry output of AD i  is wired to the second input of the adder ZA i+1  of the next-higher significance. At their outputs, the additional adders ZA i  are wired in the same way and to the same circuit parts as the adders AD i  in FIG. 1. These circuit parts are therefore provided with the same refernce characters as in FIG. 1 but with the addition of a reference prime. The intermediate sum word appearing at the points 11&#39;, 12&#39; . . . , which is applied to the first inputs of AD i  via the intermediate memories 33&#39;, 34&#39; . . . , represents a first binary number and the carry word appearing at the points 21&#39;, 22&#39; . . . which is applied to the second inputs of AD i  via the intermediate memories 36&#39;, 37&#39; . . . respresents a second binary number. The number D adjacent to the third inputs of AD i  forms a third binary number and number E applied to the third inputs of the additional adders ZA i  forms a fourth binary number. These four binary numbers are added to one another in bit-parallel relationship with the adder of FIG. 5. The intermediate sum words and carry words from which the desired sum word S&#34; are formed in the adder means AS&#39;, and appear at the circuit points 11&#39;, 12&#39; . . . and 21&#39;, 22&#39; . . . . Dependent on the bits at the first two inputs of AD n-1  and AD n-2 , the decoder 28 determines whether a positive or a negative overflow condition is present. When this is the case, the saturation measures already set forth with reference to FIG. 1 are initiated, via the outputs 40, 40&#39;, 41 and 42 of the decoder 28 and by means of the logic circuits 23&#39; through 27&#39;, etc. 
     By connecting further groups of adders following the adders ZA i , the arrangement of FIG. 5 can be expanded in a corresponding fashion for an additional five or more binary numbers in two&#39;s complement. The circuit parts 23&#39; through 27&#39; and 33&#39; through 37&#39; are then provided at the outputs of the further adders arranged in the lowest adder group and immediately preceding the adder means AS&#39;. The recursive circuit branches likewise proceed from the outputs of the intermediate memories 33&#39; through 37&#39; to the inputs of the adders AD i . Circuit arrangements formed from a plurality of adder lines for the addition of five or more binary number are described, for example, in the book Computer Arithmetic by K Hwang, John Wiley &amp; Sons, New York, 1979, pp. 100-103, cf., in particular, FIG. 4.3. 
     FIG. 6 shows a recursive filter of the first order which contains an accumulator like that of FIG. 1. A sequence of n-place binary numbers Di represent in two&#39;s complement is applied in bit-parallel to the input 67 during successive clock periods, and corresponds to a sequence of sampled amplitude values of an analog input signal. The sequence is first related bit-parallel by one clock period duration in a delay stage 68 composed of n-intermediate memories, and is then respectively supplied to the third inputs of the accumulator AD i  of FIG. 1. The intermediate sum words and carry words respectively derived therefrom are delayed by a further clock period duration in a delay stage 69 composed of the intermediate memories 33 through 37, etc., and are then supplied to the first and second inputs of the accumulator AD i  via a recursive loop. Both words may be shifted m bits to the right or left in their allocation to the individual adders AD i , this corresponding to a multiplication by 2 -m  or 2 m  in an evaluator 70a. The word supplied via the line 70 are added to the binary number D pending at the third inputs of AD i  at the next following clock pulse. The intermediate sum words and carry words appearing at the output of the delay stage 69 are supplied to the adder means AS via its inputs 11, 12 . . . 21, 22 . . . are combined to form the filtered, digital output signal Di&#39;. 
     FIG. 7 shows a recursive filter of the second order which differs from FIG. 6 in that the intermediate sum words and carry words emitted by the delay unit 69 are supplied to an accumulator (like that of FIG. 5) which is referenced AD i , ZA i . The intermediate sum words and carry words emitted by this are delayed by a clock period duration in a delay stage 71 (which corresponds to the intermediate memories 33&#39; through 37&#39;) and, via a recursive loop 72, are supplied both to the first two inputs of the accumulator AD i  as well as to the first two inputs of the AD i , ZA i . Both words can be shifted by m1 bits toward the right or left in the allocation to the individual adders AD i  of the accumulator of FIG. 5, this corresponding to a multiplication by 2 -m1  or 2 m1  in an evaluator 72a. The words which have been evaluated in this fashion can then be shifted by a further m2 bits toward the right or left in their allocation to the individual adders AD i  of the accumulator of FIG. 1, this corresponding to a further multiplication by 2 -m1  or 2 m2  in an evaluator 72b. The third input of AD i  receives Di and the third input and fourth input of AD i , ZA i  receives the intermediate sum words and carry words of the first accumulator output via 69. The intermediate sum words and carry words appearing at the output of the delay stage 71 are supplied to the adder stage AS&#39; via this input 11&#39;, 12&#39; . . . 21&#39;, 22&#39; and are combined to form the filtered, digital output signal Di&#39;. 
     In a recursive filter of the n th  order, one accumulator like that of FIG. 2 in n-1 accumulators like that FIG. 5 can be employed in an analogous fashion. 
     The intermediate memories 33 through 37 (or, 33&#39; through 37&#39;), etc., can be advantageously fashioned as shift registers which are each composed of master-slave flipflops. The adder means AS or AS&#39; can be fashioned in accord with the adder means shown in FIG. 9 of our U.S. patent application Ser. No. 883,942, filed July 10, 1986, and set forth in detail therein. 
     Finally, the adder AD n-1  can comprise a correction element at its output which undertakes an overflow correction that is needed when relatively large intermediate sum words and carry words of opposite operational signs combine to form a relatively small sum word. By means of such a correction element, the carry word of the adder AD n-2  having the second-highest signficance is replaced by the carry bit of the most significant adder AD n-1  and, when the carry bits of the two most significant adders AD n-1  and AD n-2  are unequal, the sum bit of AD n-1  is replaced by the carry bit of AD n-1 . Such overflow correction measures are set forth in detail in the U.S. patent application Ser. No. 883,942. One can proceed on the assumption that the intermediate sum words and carry words established on the output lines, for example 6 through 8, 14 and 15, are already corrected in this fashion upon employment of such a correction element incorporated into the circuit block for AD n-1 . The intermediate sum words and carry words of the adders ZA i  and of further adder groups are expediently corrected in analogous fashion with respect to such an overflow, whereby corresponding correction elements are also incorporated into the block ZA n-1  and into the blocks for the respectively most significant adders of further adder groups. 
     In a departure from the exemplary embodiments of FIGS. 1 and 5, in addition to the two most significant adders, for example AD n-1  and AD n-2 , of every group, further adders of contiguous significance, for example AD n-3  and AD n-4 , can also be connected to receive one and the same bit of a supplied binary number D or, respectively, E, via their respective third inputs. Such an arrangement corresponds to an operation sign multiplication of the binary numbers represented in two&#39;s complement.