Prepare for the A Level Computer Science OCR Exam with comprehensive quizzes that cover essential topics, flashcards, and detailed explanations to help you excel. Ace your exam with confidence!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


When does the "BRZ" instruction in LMC branch to a given address?

  1. When the accumulator is positive

  2. When the accumulator is zero

  3. When the accumulator is negative

  4. When the accumulator is non-zero

The correct answer is: When the accumulator is zero

The "BRZ" instruction in the Little Man Computer (LMC) is specifically designed to branch to a given address when the accumulator holds a value of zero. This instruction is useful for control flow in programs, especially for implementing loops or condition checks. In the context of LMC, the accumulator is a register that stores temporary results of calculations. If a program requires checking whether a computation has resulted in zero (for example, after a subtraction operation), the "BRZ" instruction allows the program to jump to a different part of the code if that condition is met. Therefore, it facilitates decision-making based on the state of the accumulator. The other options do not accurately describe the functionality of the "BRZ" instruction: - The first option mentions branching when the accumulator is positive, which is not the case for "BRZ." - The third option discussing a negative value relates to a different branching instruction, "BRN," which is used for negative conditions. - The fourth option mentions non-zero, which again does not apply to "BRZ" since it specifically checks for zero. This specificity makes the "BRZ" instruction crucial for implementing proper logic based on the accumulator's zero state.