Hi,
I doubt there is a simple solution that can be done with a 4-16 decoder and couple of logical gates. I can get each pin with two four input logic gates and it will need total 32 gates or with a PLD. I can't figure out a simpler way but I think there could be one.
By the way, it is...