Adders and Arithmetic Circuits

Adders and arithmetic circuits perform arithmetic directly on binary words. You encounter them in processors, address generators, and digital measurement systems. Their basic building block handles one bit position; connecting several blocks lets you add or subtract whole words. To interpret the output correctly, keep the stored result separate from the carry, borrow, and signed-overflow information.

Adding one bit position

A half-adder adds two input bits, AA and BB. Its sum output is S=A⊕BS=A\oplus B, and its carry output is C=ABC=AB. Here, ⊕\oplus means exclusive OR, multiplication means AND, and ++ in a Boolean expression means OR. A half-adder has no input for a carry from a lower bit position.


A full-adder adds three bits: two operand bits and an incoming carry. For bit position ii, its outputs satisfy


Si=Ai⊕Bi⊕Ci,Ci+1=AiBi+AiCi+BiCi.\begin{aligned} S_i &= A_i\oplus B_i\oplus C_i,\\ C_{i+1} &= A_iB_i+A_iC_i+B_iC_i. \end{aligned}


The sum is 1 when an odd number of inputs are 1. The outgoing carry is 1 when at least two inputs are 1. As ordinary numerical values, these outputs obey Ai+Bi+Ci=Si+2Ci+1A_i+B_i+C_i=S_i+2C_{i+1}. The carry represents two units at the current bit position, or one unit at the next position.

Connecting a word-wide adder

An nn-bit ripple-carry adder connects each full-adder's carry output to the next stage's carry input. Bit 0 is the least significant bit. Its carry travels toward bit n−1n-1, the most significant bit.


Four full-adder stages connect from the least significant bit on the left to the most significant bit on the right.


For unsigned operands, the governing arithmetic identity is


A+B+C0=S+2nCn.A+B+C_0=S+2^nC_n.


Here, SS is the unsigned value of the nn stored sum bits. Ordinary addition uses C0=0C_0=0. If the exact result exceeds 2n−12^n-1, the stored word wraps around modulo 2n2^n, while CnC_n records the extra carry.


Carries take time to propagate. In a simplified delay model with carry delay tct_c per stage and sum delay tst_s from a stage input, the longest path to the highest sum bit is (n−1)tc+ts(n-1)t_c+t_s. The final carry path is ntcnt_c. These expressions assume all operand inputs and the initial carry are available together; additional input-conditioning delays require separate treatment.

Sharing hardware for subtraction

Two's-complement subtraction reuses addition:


A−B≡A+B‾+1(mod2n).A-B\equiv A+\overline{B}+1\pmod{2^n}.


The complement B‾\overline{B} reverses exactly the nn bits of BB. A mode bit MM controls an XOR gate on every BB input and also supplies the initial carry:


Xi=Bi⊕M,C0=M.X_i=B_i\oplus M,\qquad C_0=M.


Mode MM

Effective second operand

Initial carry

Operation

0

BB

0

A+BA+B

1

B‾\overline{B}

1

A−BA-B



For unsigned subtraction implemented this way, this lesson uses the carry means no borrow convention: Cn=1C_n=1 means no borrow, and the borrow flag is 1−Cn1-C_n. Some systems expose a borrow flag directly, so identify the convention before interpreting a status bit.

Interpreting signed results

An nn-bit two's-complement word represents values from −2n−1-2^{n-1} to 2n−1−12^{n-1}-1. Signed overflow occurs when the exact signed result lies outside that range. It is different from an unsigned carry.


For the adder, including subtraction through the complemented input, the overflow flag is


V=Cn−1⊕Cn.V=C_{n-1}\oplus C_n.


For addition, two operands with the same sign overflow if the stored result has the opposite sign. Operands with opposite signs do not overflow. The same output bits can therefore indicate unsigned carry without signed overflow, or signed overflow without unsigned carry.



What to remember

  • A full-adder combines two operand bits and an incoming carry.
  • Ripple-carry stages pass carries toward more significant bits.
  • Subtraction requires both complementing BB and setting C0=1C_0=1.
  • Unsigned carry, unsigned borrow, and signed overflow describe different conditions.

Example: A four-bit arithmetic unit

A small controller uses a four-bit ripple-carry arithmetic unit. Its operand words are A=01102A=0110_2 and B=00112B=0011_2. Mode MM sets the effective second operand to Xi=Bi⊕MX_i=B_i\oplus M and the initial carry to C0=MC_0=M. The unit stores four sum bits and reports final carry C4C_4 and signed-overflow flag V=C3⊕C4V=C_3\oplus C_4.


A four-bit adder-subtractor receives A equal to 0110 and B equal to 0011 with a selectable mode input.


a) For M=0M=0, find the stored result, final carry, and signed-overflow flag. Interpret the result as both unsigned and two's complement.


Mode 0 passes BB unchanged and sets C0=0C_0=0. Work from the least significant bit upward. Each ordinary bit total Ai+Xi+CiA_i+X_i+C_i equals Si+2Ci+1S_i+2C_{i+1}.

  • Bit 0: A0+X0+C0=0+1+0=1A_0+X_0+C_0=0+1+0=1, so S0=1S_0=1 and C1=0C_1=0.
  • Bit 1: A1+X1+C1=1+1+0=2A_1+X_1+C_1=1+1+0=2, so S1=0S_1=0 and C2=1C_2=1.
  • Bit 2: A2+X2+C2=1+0+1=2A_2+X_2+C_2=1+0+1=2, so S2=0S_2=0 and C3=1C_3=1.
  • Bit 3: A3+X3+C3=0+0+1=1A_3+X_3+C_3=0+0+1=1, so S3=1S_3=1 and C4=0C_4=0.

Reading the sum from bit 3 down to bit 0 gives S=10012S=1001_2, with C4=0C_4=0. The carry into the sign bit is C3=1C_3=1, so


V=C3⊕C4=1⊕0=1.V=C_3\oplus C_4=1\oplus0=1.


Unsigned interpretation gives 6+3=96+3=9, which fits the four-bit unsigned range. Two's-complement interpretation also starts with +6+6 and +3+3, but their exact sum +9+9 exceeds the signed maximum of +7+7. The stored word represents 9−16=−79-16=-7, so it is not the correct signed sum. The outputs are S=10012S=1001_2, C4=0C_4=0, and V=1V=1.


b) For M=1M=1, find the stored difference, final carry, unsigned borrow flag, and signed-overflow flag. Use borrow flag =1−C4=1-C_4.


Mode 1 complements every bit of BB and supplies the initial carry:


X=00112‾=11002,C0=1.X=\overline{0011_2}=1100_2,\qquad C_0=1.


Now trace the subtraction through the same full-adders.

  • Bit 0: A0+X0+C0=0+0+1=1A_0+X_0+C_0=0+0+1=1, so S0=1S_0=1 and C1=0C_1=0.
  • Bit 1: A1+X1+C1=1+0+0=1A_1+X_1+C_1=1+0+0=1, so S1=1S_1=1 and C2=0C_2=0.
  • Bit 2: A2+X2+C2=1+1+0=2A_2+X_2+C_2=1+1+0=2, so S2=0S_2=0 and C3=1C_3=1.
  • Bit 3: A3+X3+C3=0+1+1=2A_3+X_3+C_3=0+1+1=2, so S3=0S_3=0 and C4=1C_4=1.

Equivalently, the complete addition is


01102+11002+00012=100112.0110_2+1100_2+0001_2=10011_2.


The stored low four bits are 00112=30011_2=3, and the final carry is C4=1C_4=1. Therefore,


borrow flag=1−C4=0,V=C3⊕C4=1⊕1=0.\begin{aligned} \text{borrow flag}&=1-C_4=0,\\ V&=C_3\oplus C_4=1\oplus1=0. \end{aligned}


The numerical check is 6−3=36-3=3. No unsigned borrow is needed, and the signed result fits the range −8-8 to 77. The outputs are S=00112S=0011_2, C4=1C_4=1, borrow flag 0, and V=0V=0.


c) Each full-adder has a worst-case carry-output delay of 1.5 ns1.5\ \text{ns} and sum-output delay of 2.0 ns2.0\ \text{ns} from any of its inputs. All effective operand inputs and C0C_0 are stable at t=0t=0. Using an additive worst-case delay model, find when all sum bits and the final carry are guaranteed stable for any input transition. Exclude XOR input-conditioning delays and assume the worst-case carry path can be sensitized.


The final carry passes through ________ carry-output delays:


tC4=4(1.5 ns)=6.0 ns.t_{C_4}=4(1.5\ \text{ns})=6.0\ \text{ns}.


The highest sum bit first waits for ________ carry stages, then takes the final stage's sum delay:


tS3=3(1.5 ns)+2.0 ns=4.5 ns+2.0 ns=6.5 ns.\begin{aligned} t_{S_3}&=3(1.5\ \text{ns})+2.0\ \text{ns}\\ &=4.5\ \text{ns}+2.0\ \text{ns}\\ &=6.5\ \text{ns}. \end{aligned}


Lower sum bits have fewer preceding carry stages. Consequently, the guarantee for all requested outputs is the larger of these two delays:


tall stable=max⁡(6.0,6.5) ns=6.5 ns.t_{\text{all stable}}=\max(6.0,6.5)\ \text{ns}=6.5\ \text{ns}.


The highest sum bit determines the 6.5 ns bound under the stated model. This is a worst-case guarantee over input transitions, rather than a claim that every operation takes exactly that long.

A full-adder in a digital accumulator receives A=1A=1, B=0B=0, and incoming carry Cin=1C_{\text{in}}=1. What are its sum bit SS and outgoing carry CoutC_{\text{out}}?


A full-adder receives input bits A equal to 1, B equal to 0, and an incoming carry equal to 1.


Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

In an unsigned binary multiplier, a partial product is the row formed from one multiplier bit and all the multiplicand bits. Complete the two missing operations below.


Each bit in a row is produced by an gate receiving one multiplicand bit and the selected multiplier bit. The row associated with multiplier bit jj is shifted by jj positions before the rows are added. Here, bit index zero denotes the least significant bit, and enough output bits are retained to prevent truncation.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A four-bit arithmetic unit subtracts the unsigned word B=10012B=1001_2 from the unsigned word A=00112A=0011_2. It computes A+B‾+1A+\overline{B}+1, stores only the four low result bits, and defines its borrow flag as 1−C41-C_4, where C4C_4 is the final carry. Which stored result and borrow flag are correct?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice