ITPEC FE Morning October 2018 Question 10
Which of the following is a special purpose register that stores the result of a comparison or the sign of the result of an arithmetic operation?
Explanation
Flags register — the register of status bits that the ALU sets after each operation, including comparisons.
The flags register (also called the status or condition code register) holds one-bit flags describing the last result:
- •Zero flag — the result, or the difference in a comparison, is 0
- •Sign flag — the result is negative
- •Carry flag — an unsigned carry or borrow out of the top bit
- •Overflow flag — the signed result does not fit
A conditional branch tests these flags, which is how "if a < b" is carried out after a compare instruction.
Answer (b)
Why not others:
- •(a) Accumulator — holds the operand and the result of arithmetic itself, not status information about the result
- •(c) Instruction register — holds the instruction currently being decoded and executed
- •(d) Program counter — holds the address of the next instruction to fetch
Key rule: The accumulator holds a result, the flags register describes it (zero, sign, carry, overflow), and branches read the flags.
Computer Component · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.