TAOCP 7.1.2 Exercise 57

In Figure (45), the seven-segment encoding assigns a distinct display pattern to each 4-bit input $(x_1x_2x_3x_4)_2$, corresponding to the hexadecimal digits $0$ through $15$.

Section 7.1.2: Boolean Evaluation

Exercise 57. [19] [19] What seven-segment "digits" are displayed when $(x_1x_2x_3x_4)_2 > 9$ in (45)?

Verified: yes
Solve time: 1m20s


Solution

In Figure (45), the seven-segment encoding assigns a distinct display pattern to each 4-bit input $(x_1x_2x_3x_4)_2$, corresponding to the hexadecimal digits $0$ through $15$. For inputs exceeding $9$, the encoding switches from decimal digits to alphabetic hexadecimal symbols.

For the values

$$ (x_1x_2x_3x_4)_2 \in {1010, 1011, 1100, 1101, 1110, 1111}, $$

that is, for integers $10$ through $15$, the displayed symbols are the standard seven-segment representations of hexadecimal digits.

The mapping given by (45) yields the following outputs:

$$ 10 \mapsto A,\quad 11 \mapsto b,\quad 12 \mapsto C,\quad 13 \mapsto d,\quad 14 \mapsto E,\quad 15 \mapsto F. $$

Thus the seven-segment digits displayed when $(x_1x_2x_3x_4)_2 > 9$ are

$$ \boxed{A,; b,; C,; d,; E,; F}. $$