Encoder for the decimal digits 2, 3, 5, 7 and 8: it has 5 input lines $D_2, D_3, D_5, D_7, D_8$ (only one is 1 at a time, when that digit is pressed) and 4 output lines $W X Y Z$ that give its BCD (8-4-2-1) code.
Truth table:
| Digit | D2 | D3 | D5 | D7 | D8 | W | X | Y | Z |
|---|
| 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 5 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 |
| 7 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 |
| 8 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
From the table: $W = D_8$ (the $D_8$ line is taken directly as W), $X = D_5 + D_7$, $Y = D_2 + D_3 + D_7$, $Z = D_3 + D_5 + D_7$. So X is a 2-input OR gate and Y and Z are 3-input OR gates.
Working: when a digit key is pressed, only its input line becomes 1 and it feeds those OR gates whose equation contains it. For example, pressing 7 makes $D_7 = 1$, which feeds X, Y and Z, so $WXYZ = 0111$, the BCD of 7. Pressing 8 makes $D_8 = 1$, which gives $W = 1$ and all other outputs 0, i.e. 1000.