Electronic – 32b Adder to add two 16bit adders

digital-logic

How to add two 16bit numbers using a 32bit adder (Its a FA)?
32bit adder takes 1 cycle to add two numbers.
how to add "p+q" and "r+s" (16bit numbers) in 1 cycle?
Note: 32bit adder is black box, cannot modify anything inside. But you can add combo logic outside.

Best Answer

I am adding one more answer since I have been thinking a bit more about it. It is by far more optimal than my previous solution.

We have 32-bit operands A and B, on which we will perform 32-bit addition (as per the OP restrictions go). The lower 16 bits are Alow and Blow. The higher ones are Ahigh and Bhigh.

Before driving A and B operands to the 32-bit adder, set MSBs (i.e., 16th bits) of Alow and Blow to 0. This way we prevent overflowing to the 17th bit, which is the LSB of the high operands. After doing that, the high addition is performed correctly. The low part needs a very little correction described below.

The MSB of the low result is defined as XOR between MSBs of the low adder result, Alow, and Blow. That performs a single-bit addition with no carry-out signal driving. Other result bits are directly connected to the adder output.

See the example below applied on an 8-bit adder, where two independent 4-bit adds are performed. Your 32-bit addition is analogical.

schematic

simulate this circuit – Schematic created using CircuitLab

Related Topic