Components / Arithmetic
Adder Component in Logisim
Computes the N-bit binary sum of operands A and B plus a 1-bit Carry-In (cin), outputting Sum and a 1-bit Carry-Out (cout).
| Library | Arithmetic |
|---|---|
| Type name | Adder |
| Pins and defaults | a A (-40, -10), b B (-40, 10), cin (-20, -20), out0 Sum (0, 0), cout (-20, 20), width 1..32 |
How the Adder Works in Logisim
The Adder component performs unsigned and two's complement binary addition across 1 to 32 bits: it adds N-bit input A, N-bit input B, and the 1-bit Carry-In pin (cin) on its top edge, producing an N-bit Sum on the right edge and a 1-bit Carry-Out (cout) on the bottom edge.
If the top cin pin is left unconnected (floating Z), Logisim treats cin as 0 so a single Adder computes A + B out of the box. You can also chain multiple Adders in ripple-carry fashion by wiring the bottom cout of the lower-order stage into the top cin of the next stage.
Tip: Leaving cin unconnected automatically defaults Carry-In to 0; tie cin to 1 and invert B with a NOT gate if you want to compute A - B using an Adder.
Adder Pins & Pinout
| Pin | Direction | Width | Location & Role |
|---|---|---|---|
| a (A) | Input (Upper-left) | 1–32 bits | Offset (-40, -10). First N-bit addend. |
| b (B) | Input (Lower-left) | 1–32 bits | Offset (-40, 10). Second N-bit addend. |
| cin (cin) | Input (Top edge) | 1 bit | Offset (-20, -20). Carry-In bit (defaults to 0 if left unconnected/Z). |
| out0 (Sum) | Output (Right edge) | 1–32 bits | Offset (0, 0). Lower N bits of (A + B + cin). |
| cout (cout) | Output (Bottom edge) | 1 bit | Offset (-20, 20). Carry-Out bit (1 when A + B + cin overflows N bits). |
Adder Truth Table & Behavior
| A | B | cin | Sum | cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |