ALU Design: Condition Registers
- Carry: set when a bit is carried in the Arithmetic Unit (which can also indicate arithmetic overflow depending on the interpretation of the numbers being added).
- Zero: set when the ALU result is zero (all bits are off).
- Sign: set when the most significant bit is set (which would indicate a negative result for signed values). This condition has no direct meaning for unsigned numbers (other than indicating the number has a value of 128 or more).
In the most basic terms we can store a single bit in a relay as follows:
This basic design does need some 'support' to gate the input to the relay to ensure that it is only fed to the relay when needed and that the hold line is off when 'loading' the relay (this also ensures that the hold line can't back-feed the input line accidentally). Adding these control and gating relays gives us the following: