A pure semiconductor such as silicon conducts poorly. Doping it with a tiny amount of impurity adds charge carriers: a group V atom gives a spare electron (n-type) and a group III atom leaves a hole (p-type). Both types stay electrically neutral overall.
Where p-type meets n-type, a depletion region with a potential barrier forms. Forward bias shrinks it and current flows; reverse bias widens it and almost no current flows. This one-way behaviour lets a diode turn AC into DC, which is rectification.
A transistor uses a small base current to control a much larger collector current. An op-amp is a very high gain amplifier whose working gain is set by two resistors. Logic gates give an output of 0 or 1 that depends on their inputs.