Keypad HDL tri-state behavior In the keypad scanner, when all columns read HIGH (no key pressed), the ring counter is enabled and counting, and dav is LOW (no data available), what should be the state of the data outputs d[ ] that feed the system bus?

Difficulty: Easy

Correct Answer: Hi-Z

Explanation:


Introduction / Context:
Shared buses require that only one device drive the lines at a time. In keypad HDL designs, the encoded key data should be driven only when valid and requested. Otherwise, the outputs must not contend with other devices.



Given Data / Assumptions:

  • No key press detected (all columns HIGH).
  • Ring counter continues scanning (normal idle behavior).
  • dav (data available) is LOW, meaning no valid key code.


Concept / Approach:
When data is not valid, the keypad interface should tri-state its data outputs so that other peripherals can use the bus. Driving a pattern during idle risks contention or false reads by a host that samples multiple devices.



Step-by-Step Solution:

Use dav as an output-enable qualifier for the data buffer.If dav = 0, assert OĒ so that the output buffer is disabled.Disabled buffer → data lines in high-impedance (Hi-Z) state.Only when dav = 1 should the code be driven onto the bus.


Verification / Alternative check:
On a logic analyzer, observe that when no key is pressed, the data lines float (pulled by bus resistors if present) and only drive when dav asserts.



Why Other Options Are Wrong:

  • On/Off: Ambiguous and not an electrical state for a bus interface.
  • 1011: Arbitrary pattern; driving any pattern with no valid data is incorrect.


Common Pitfalls:
Forgetting to tri-state in idle can cause multi-driver conflicts; failing to debounce can briefly drive spurious codes before dav is qualified.



Final Answer:
Hi-Z

More Questions from Digital System Projects Using HDL

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion