combinational logic circuit design+projects
The way I see the problem is a small truck will obstruct only the lower phototransistor, a medium truck will obstruct the lower two phototransistors and a large truck will obstruct all three.
In the schematic, I assumed that an unobstructed phototransistor will produce a HI.
So, three conditions have to be met simultanously for a HI output:
Lower two phototransistors output a LO and the upper one outputs a HI. Since these conditons have to be all true, you just need an AND and invert the signals from the lower two photodetectors. Any other combination is invalid.