Generate the Waveform for the Letter ‘O’

The waveform of the letter ‘O’ can be obtained by generating three signals acting as masks and applying a logic function on them.

Figure 1. Waveform for the Letter ‘O’

The truth table of the operation is shown in the table below:

M3 M4 M5 O
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1