Single-wavelength pulsed optical logic based on dichroism in CdS