Monitoring eight sources with minimal MCU lines — how many input lines are needed using an 8-to-3 priority encoder? Assume standard enable logic is handled separately; focus on the data lines into the microcontroller.

Difficulty: Easy

Correct Answer: 3

Explanation:


Introduction / Context:
Microcontrollers often have limited I/O. Encoders allow multiple sources to be represented as a smaller set of lines. An 8-to-3 priority encoder outputs a 3-bit code corresponding to the highest-priority active input, reducing the required MCU input pins.



Given Data / Assumptions:

  • There are eight distinct sources to monitor.
  • An 8-to-3 priority encoder is used.
  • Enable, valid, or interrupt lines (if any) are outside the “data bits” count for this question.


Concept / Approach:
An 8-to-3 encoder maps 8 inputs to a 3-bit binary index (since 2^3 = 8). With priority, if multiple inputs assert simultaneously, the highest-priority one determines the output code. The MCU reads the 3-bit value to know which source is active, conserving pins.



Step-by-Step Solution:

Determine bit width: log2(8) = 3 bits.Priority encoder provides these 3 bits on its outputs.MCU therefore needs 3 input lines to read the code.Additional housekeeping signals are optional and not counted here.


Verification / Alternative check:

Check typical parts (e.g., 74HC148): 8 inputs, 3 outputs representing the active input index.


Why Other Options Are Wrong:

8: No encoder would be needed if you spent eight lines.4: More than required; 3 bits already cover 8 states.2: Insufficient to represent 8 distinct states.


Common Pitfalls:

Forgetting that additional lines (enable, GS, EO) do not change the core 3-bit code width.


Final Answer:

3

Discussion & Comments

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