The subtraction is executed bit by bit, starting with the least significant bit.

Subtracting a bit from another bit can lead to a carry-over. This carry-over has to be considered when subtracting the next digits. There are two ways of "remembering" the carry-over:

  1. The carry-over is saved using additional states (solution 1).
  2. The carry-over is written on the field underneath the next digits to be processed (solution 2).

Remembering the carry-over using states


The states "carry" and "no carry" are used to remember the carry-over.