0
\$\begingroup\$

Okay say I have to use a CLA adder to implement the addition of two 2-bit numbers, X = x1x0, Y = y1y0. And say I have to write down the logical expression for the final carry-out.

So C1 or the first carryout would be x0y0 + C0(X0+Y0). Now if we let x0y0 = g0 and x0 + y0 = p0,

we get: C1 = g0 + C0(p0).

Then C2 or the Final carry out = g1 + C1(p1) where C1 = g0 + C0(p0)

so C2 = g1 + p1g0 + p1C0p0.

Now my question is instead of letting the propagate term or p1 or p0 be xi + yi we let it be xi xor yi which is a valid implementation taught in many books.

My question is why? Why should one choose the Xor gate over the or gate. Are there any benefits it provides?

\$\endgroup\$
  • \$\begingroup\$ It's hard to tell exactly what your question and assumptions are. A schematic would clarify it, perfectly, I think. You might consider adding one. Is this a full-adder question with three inputs and two outputs? \$\endgroup\$ – jonk Apr 23 at 22:57
1
\$\begingroup\$

For computing the carry propagate term both the expressions

  • Pi = Ai or Bi
  • Pi = Ai xor Bi

works since the only difference in the truth tables of XOR and OR is when A=1 and B=1. However in the following expression:

C1 = g0 + C0(p0)

the P0 becomes irrelevant when Ai=1 and Bi=1 since the Carry Generate term (AiBi=1). For this reason, in case of a CLA adder the XOR and OR gates are logically equivalent.

The OR gate is better than XOR gate for large circuits since the implementation takes lesser number of CMOS transistors. In VLSI, usually gate count is a critical factor for Area and Power considerations.

\$\endgroup\$
  • \$\begingroup\$ So there is no benefit in using A xor B instead of A or B? \$\endgroup\$ – Krish Khatri Apr 24 at 18:25
  • \$\begingroup\$ That's correct. But however, this is a specific scenario (only in the case of CLA adder) where this interchange is possible because of the above reason. Textbooks typically show XOR because that's the logic you get when you derive it from the truth table. \$\endgroup\$ – Rajesh S Apr 25 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.