Computer Arithmetic

In a carry-lookahead adder, which gives the definitions of each bit's generate signal g and propagate signal p (a and b are that bit's inputs) and the carry into the next bit, c(i+1)?

  1. Ag = a + b, p = a·b, c(i+1) = p + g·c(i)
  2. Bg = a·b, p = a ⊕ b, c(i+1) = g + p·c(i)
  3. Cg = a ⊕ b, p = a·b, c(i+1) = g·p·c(i)
Show answer and explanation

Answer: B. g = a·b, p = a ⊕ b, c(i+1) = g + p·c(i)

If a and b are both 1, a carry is produced regardless of the incoming carry, so the generate signal is g = a·b. If exactly one of them is 1, the incoming carry passes upward, so the propagate signal is p = a ⊕ b (OR is also used). Hence c(i+1) = g(i) + p(i)·c(i); expanding this lets every carry be computed in parallel with two-level logic from the g and p signals and the lowest carry alone. Formulas that swap generate and propagate do not compute correctly.

  • A. The definitions of g and p are swapped, and the formula is wrong.
  • B. Correct. g = a·b, p = a ⊕ b, c(i+1) = g + p·c(i).
  • C. The definitions are swapped and the formula is an all-AND, which is wrong.
Practice this topic Back to topic

More Computer Arithmetic questions

  1. Why are carry-save adders used to sum the many partial products in a multiplier?
  2. Which describes a Wallace tree used in fast multipliers?
  3. What is the main effect of using radix-4 Booth's algorithm (Booth encoding) in a multiplier?
  4. When two unsigned 8-bit numbers are multiplied, how many bits are needed to represent the result without overflow?
  5. Which expression multiplies an integer x by 10 using shifts and additions instead of a multiply instruction?