ITPEC FE Morning October 2018 Question 24

Topic: Hardware

In a lighting circuit for an anode-common type LED with seven (7) segments, when 92 in hexadecimal is written out to the output port, which of the following is displayed? Here, P7 is the most significant bit (MSB), P0 is the least significant bit (LSB), and the LED lights up when the port output is 0.

OutputportP 0aP 1bP 2cP 3dP 4eP 5fP 6gP 7DtVcc
afbgecdDtLegend,Off,On

Explanation

The digit 5 with the decimal point off — write 92 hexadecimal in binary and light every segment whose port bit is 0.

92 hexadecimal is 1001 0010, from P7 down to P0. With a common anode, a segment lights when its port outputs 0, because current then flows from Vcc through the LED into the port.

PortP7P6P5P4P3P2P1P0
SegmentDtgfedcba
Bit10010010
Stateoffononoffononoffon

Segments a, c, d, f and g are lit and b, e and the dot are dark: the digit 5.

Answer (c)

Why not others:

  • •(a) 3. — needs b and the dot lit, but P1 and P7 output 1, so both are off; it would need the code 30 hexadecimal
  • •(b) 4 — needs b lit and a and d dark, the opposite of what P1, P0 and P3 give; its code is 99 hexadecimal
  • •(d) 6. — needs e and the dot lit, but P4 and P7 output 1; its code is 02 hexadecimal

Key rule: Common anode means active low: a 0 bit lights the segment, so map each bit to its segment and invert before reading the digit.

Hardware · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.