Yes you can implement the digital gates logic in a PIC. However, the propagation delay on the PIC code will be very high compared to doing the same implementation in a CPLD. The CPLD will give results in nSecs and the PIC may take a few uSecs. So, you need to define fast enough to know it if will suit your requirements.