final schematic and waveform added