Documentation

Complexity.Computability.Circuit.Boolean.Modular.Subtract

Modular subtraction with carry lookahead #

Subtract by complementing the second word and supplying an incoming carry of one. The output discards the final carry, so underflow wraps modulo 2 ^ w instead of truncated subtraction.

Main definitions #

Main results #

References #

Parallel-prefix finishing follows Ladner and Fischer.

Discard the carry-out after adding the first word, the second word's complement and one.

Instances For

    Modular subtraction, expressed without a truncated natural subtraction of the inputs.