Chargement…
Chargement…
The two’s complement of b lets both operations share one adder.
Behavior
subtract=0 computes a+b; subtract=1 computes a-b.overflow flags a signed result that cannot fit in four bits.| Signal | Direction | Width | Description |
|---|---|---|---|
a, b | Input | 4 bits | Two’s-complement operands |
subtract | Input | 1 bit | Subtract selection |
result | Output | 4 bits | Result |
carry_out, overflow | Output | 1 bit | Arithmetic flags |