BCD adder circuit
AssigneeDigital Equipment Corporation
InventorsMatthew J. Adiletta, Virginia C. Lamere
Life of this patent
Estimating the term…
Abstract
The binary coded decimal (BCD) adder circuit for adding two BCD encoded operands and for producing a BCD encoded sum includes a bank of parallel full adder circuits as a first stage which generate an intermediate sum vector and an intermediate carry vector from the sum of the operands and a precorrection factor. A second stage of the BCD adder circuit includes carry lookahead adder circuitry receiving as inputs the intermediate sum vector and the intermediate carry vector and producing a propagate vector and a final carry vector. The third stage of the BCD adder circuit conditionally modifies the propagate vector to form the BCD encoded sum according to bits of the intermediate carry vector and the final carry vector as inputs.
Claims9
A BCD adder circuit for adding a first and a second BCD operand and for producing a BCD sum, comprising:
- binary adder means, having inputs connected to receive the first and second operands and a BCD precorrection factor, for producing an intermediate sum vector and an intermediate carry vector;
- carry lookahead means, having inputs connected to receive the intermediate sum vector and the intermediate carry vector, for producing a propagate vector and a final carry vector;
- and
- correction means, having inputs connected to receive the intermediate carry vector, the final carry vector, the propagate vector and a BCD correction factor, for producing said BCD sum by conditionally modifying said propagate vector and said final carry vector according to said BCD correction factor based on said intermediate and final carry vectors.
A BCD adder circuit for adding a first and a second BCD encoded operand, said first and second operands being grouped in a plurality of nibbles, each of said nibbles being a unique group for four successive bits, said BCD adder circuit for producing a BCD sum, comprising:
- a plurality of parallel full adder circuits, each of said full adder circuits being connected to receive as inputs one nibble of said first operand, one nibble of said second operand, and a BCD precorrection factor equal to 0110 in binary, said pluality of full adder circuits each providing as an output a unique set of successive bits of an intermediate sum vector equal to four bits, and a unique set of successive bits of an intermediate carry vector equal to four bits;
- a carry lookahead circuit including a plurality of series of discrete logic elements, each of said series of discrete logic elements connected to receive as inputs a unique set of successive bits of said intermediate carry vector and said intermediate sum vector, each of said series of discrete logic elements providing as an output a unique set of successive bits of a propagate vector and a unique set of bits of a final carry vector;
- and
- a correction circuit including
- a plurality of parallel OR gates, each of said OR gates being connected to receive as inputs one bit of said intermediate carry vector and one bit of said final carry vector, each of said OR gates also generating an output,
- a plurality of AND gates, each corresponding to a different one of said OR gates and each being connected to receive as inputs the output of said corresponding OR gate and one bit of a BCD correction factor equal to 1010 in binary, each said AND gate also generating an output, and
- a plurality of exclusive OR gates, each of said exclusive OR gates connected to receive as inputs said output of said corresponding AND gate, a unique bit of said propagate vector and a unique bit of said final carry vector, each of said plurality of exclusive OR gates outputting a unique bit of said BCD sum.
A method for adding a first and a second BCD encoded operand and for producing a BCD sum using a BCD adder circuit in a computer system, said method comprising the steps of:
- storing said first and second operands in a register;
- producing an intermediate sum vector and an intermediate carry vector from an adding circuit;
- producing a propagate vector and a final carry vector from a carry lookahead circuit, said carry lookahead circuit having inputs connected to receive said intermediate sum vector and said intermediate carry vector;
- modifying said propagate vector according to said BCD correction factor and said final carry vector to form said BCD sum if said intermediate and final carry vectors have a predetermined relationship;
- and
- modifying said propagate vector according to said final carry vector to form said BCD sum if said intermediate and final carry vectors do not have said predetermined relationship.
Dependencies are inferred from the claim text.