Error Detection and Correction for Processing in Memory (PiM)