Difficulty: Medium
Correct Answer: Correct
Explanation:
Introduction / Context: Matrix keypads are commonly scanned by driving rows and reading columns (or vice versa). When no keys are pressed, pull-ups typically keep all column inputs HIGH. Pressing a key pulls the corresponding column LOW during the active row drive. Designers often need a simple combinational indicator that “some key is active now” to latch (freeze) the code and stop further scanning glitches.
Given Data / Assumptions:
Concept / Approach: For active-low key detection, the AND of all columns is 1 only when every column is HIGH (no keys). If any column goes LOW, the AND drops to 0. Negating this with a NAND produces 1 whenever any LOW appears—exactly the desired “key present” signal to freeze the encoder or halt the ring counter.
Step-by-Step Solution:
Let C = C3 * C2 * C1 * C0 (logic AND of columns).If no key is pressed, C = 1; if any key drives a column LOW, C = 0.Freeze = NAND(columns) = NOT(C) so Freeze = 0 only when no key; Freeze = 1 when any key is active.Use Freeze to latch the keycode and pause scanning until release/debounce completes.Verification / Alternative check: A wired-AND (via pull-ups) with a single inverter yields the same logic; in HDL, a reduction-AND followed by NOT is equivalent to a multi-input NAND.
Why Other Options Are Wrong: “Incorrect” ignores the standard active-low detection technique. “True only with OR gates” is logically wrong for active-low sense lines. “Valid only if columns are active HIGH” reverses the assumed polarity and would require different logic.
Common Pitfalls: Forgetting to debounce; not disabling scanning during freeze, causing ghosting; mismatched polarity between hardware and HDL.
Final Answer: Correct
Discussion & Comments