Here i have written the vhdl code for different intensity modulation schemes which are used in optical communication. It includes modulator and demodulator code for OOK, PPM, DDPM and DPIM schemes.