📝 N key Rollover of 8279 (4 MCQs)
Independent Recognition of Multiple Keyboard Keys
N-key rollover is a scanned keyboard mode of the 8279 that allows multiple keys to be recognized during overlapping or simultaneous operation. Unlike two-key lockout, it treats each valid key depression independently. This mode is useful when a keyboard must support multiple-key combinations, and accepted key information is stored in the internal eight-character FIFO.
Individual Debouncing and Key-Position Validation
When a key is detected during scanning, the debounce logic waits through its validation interval and checks whether the key remains pressed. A valid closure is accepted independently of other keys. The controller records the key position and associated status information rather than rejecting every multiple-key combination.
FIFO Storage and Recognition Order
After successful debounce, each detected key code is entered into the FIFO. When multiple keys remain pressed, entries are recognized according to the keyboard scanning sequence. IRQ indicates when data is available, and the processor retrieves entries in the order they have been stored.
Example of Recognizing Three Simultaneous Key Presses
Assume keys K1, K2 and K3 remain closed in N-key rollover mode. After debounce validation, the 8279 records the three key codes as scanning identifies their positions. The CPU reads the FIFO entries individually, allowing the program to process all three valid key operations.
Special Error Handling During Multiple-Key Detection
The End Interrupt/Error Mode Set command can enable special error mode for N-key rollover. If multiple keys are detected during the same debounce interval, the sensor/error status indication can report the condition and prevent further FIFO entries until the error is cleared. Normal N-key rollover accepts multiple independently validated keys.
Misconceptions About N-Key Rollover
'N-key rollover accepts only two keys' is incorrect because multiple valid keys can be recognized. 'All key codes enter FIFO before debouncing' overlooks the validation stage. 'Key entries are always ordered by the user's exact press time' is incorrect because accepted entries follow the controller's scan-detection order.
Multiple-Key Recognition and FIFO Examination Questions
Compare N-key rollover with two-key lockout and understand independent debounce validation. Trace the storage of multiple key codes and explain the FIFO order. Practise identifying the special error-mode condition, the role of IRQ and the distinction between ordinary multiple-key recognition and simultaneous multiple-closure error handling.
N-Key Recognition and FIFO Terminology
- N-Key Rollover - Recognizes multiple valid key presses.
- Debounce - Validates each key closure.
- FIFO - Stores detected key codes.
- Key Code - Represents a keyboard position.
- Special Error Mode - Detects simultaneous multiple closures.
- Rollover - Supports overlapping key operations.
📝 All N key Rollover of 8279 MCQs
Q1. A designer connects the 8253 to a keyboard matrix. Pin 11 (GATE 0) is wired to a row line, and pin 10 (OUT 0) drives an LED. Which condition will cause the LED to change state when a key in that row is pressed?
📖 Explanation: When a key is pressed, the keyboard matrix typically produces a pulse on the clock line that feeds the counter. Pin 10 (OUT 0) reflects the counter’s output state, which toggles each time the counter advances. Therefore, the LED will change only when a clock pulse occurs on CLK 0, not merely by the GATE 0 level. Options A and C misunderstand the role of GATE 0, and D is incorrect because the counter does affect the LED.
Q2. To write a mode word for counter 2, the CPU must assert specific control signals. Which combination of CS, RD, WR, A1, and A0 will correctly load the mode word into counter 2 without affecting counters 0 or 1?
📖 Explanation: Table 9.2 shows that loading a mode word requires CS low, WR low, RD high, and the address lines selecting the desired counter. For counter 2 the address bits are A1=1 and A0=1. Option D matches this exact pattern, ensuring only counter 2 receives the mode word. Options A and B select the wrong counter (A1/A0 values), while C uses WR = 1, which would read rather than write, so it does not load the mode word.
Q3. Why are the CS, RD, and WR signals of the 8253 designed as active‑low inputs, and what benefit does this provide when interfacing with a typical microprocessor?
📖 Explanation: Active‑low inputs are common because most microprocessors provide open‑collector or open‑drain outputs that naturally pull the line low, while a high state is achieved by a pull‑up resistor. This arrangement reduces the chance of accidental activation due to noise, because a stray high voltage is less likely than a stray low. Option B misstates the default bus state, C is irrelevant to logic level choice, and D describes a bus‑sharing technique but does not explain the power or noise advantage.
Q4. Examine Table 9.2. If CS is low, RD is high, WR is low, and both A1 and A0 are high (an undefined state), what operation will the 8253 perform?
📖 Explanation: The table indicates that when CS is low and WR is low, the operation depends on the address lines. However, the combination A1=1 and A0=1 for a write operation is marked as undefined (X). In undefined cases the device defaults to a no‑operation (3‑state) to avoid unintended changes. Therefore the correct response is that the chip does nothing. Option A assumes a load, B assumes a mode‑word write, and D assumes a read, all of which require defined address combinations.