# Semiconductors

Different than conductors and insulators there is roughly 1 electron per $10^8$ atoms that can move charge.

When the current is flowing through, when the electron moves from 1 place to another, it leaves a hole behind. There is small time before the next electron comes to fill the hole. (in semiconductor there is the breath time when the hole is empty. In normal conductors, the electrons fill the hole fast, so nothing can go to the other direction).

(the holes are moving from Anode to Cathode, and the electrons are moving from Cathode to Anode)

## Doping Semiconductors:

In pure semiconductors ^^, #holes = #electrons. When we **dope** the semiconductor we get more of one of them (the element needs to be similar enough).

Silicon is a bad conductor, we add some material to it to make it a better conductor.

We can use 2 different types of doping. either they have a bit more electrons or a bit less electrons - that is called P-type and N-type.

When we have just silicon:


![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-9.png)

Silicon has 4 electrons in the outer shell.

If we add a material that has 5 electrons in the outer shell, it will try to adapt to the silicon, so there will be 1 electron that is free.

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-10.png)

This creates an N-type semiconductor.

And when we add a material that has 3 electrons in the outer shell, it creates a hole in the outer shell.

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-11.png)

This creates a P-type semiconductor.

(If there is an extra electron or a hole, it will enhance the conductivity, because there is more stuff to move around)

## P-N Junction:

Now we put them together:

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-12.png)

Note for naming: The parts are not positively/negatively charged - there is the same number of electrons as protons.

Depletion region is the area where the electrons and holes meet - Because the electrons and holes near the middle will travel to the other side. 

In the depletion region there are no free electrons or holes, so it is not very conductive.

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-13.png)

If we put more holes to P side, and more electrons to N side, the depletion region will shrink and the current will flow freely. This is called forward bias.

When we put more **electrons** to P side, and more **holes** to N side, the depletion region will **grow and the current will not flow**. This is called **reverse** bias. - *Because the electrons will up the holes in P side so make depletion region also there.*

## We would like to have a device that allows current to flow in one direction and not in the other direction.

What we would like:

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-14.png)

*We have diode at home*

Diode at home:

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-15.png)

When we use reverse bias:

When we put reverse electric field the depletion region will grow. But if you apply a very high voltage, as with everything, it will break down and the current will flow in the opposite direction. This is called reverse breakdown.

This usually results in destroying the diode.

*The relationship between the current and voltage is not linear*

> Zener diode - is a diode that is designed to break down at a specific voltage.
>
> LED (Light Emitting Diode) - is a diode that emits light when the current flows through it.

# The Transistor:

(we used to use vacuum tubes - big power consumption)

We will talk about E-MOSFET (Enhancement Metal-Oxide-Semiconductor Field-Effect Transistor) Because it is easier to understand and easy to manufacture.

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-16.png)

($N^+$  are called **wells** and are from heavily doped N-type material.)

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-17.png)

If nothing acts at the gate, there is a depletion region around between P part and the N wells - nothing can flow.

Gate is big to cover large area of the channel - it attracts electrons to the channel - from rest of the P material (or the Source). There are a lot of electrons which effectively converts the P-type material into an N-type. That 'removes' the depletion around wells and allows 'current' to flow between source and drain.

If the N channel is big enough, it deletes the Depletion region around the wells.

The electrons to the channel are coming from the source - they gradually fill the channel.

*Notice that: source is from the point of view of electrons not current.*

## Logic gates:

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-18.png)

(this is rough scheme of) ![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-19.png)

When we connect no voltage to the gate, there is no current flowing through the resistor. => There is no voltage drop cross the resistor => voltage on both sides of R is the same. => At X there is the same voltage as at the Vcc

When we connect voltage to the gate, the resistance of the transistor is very low => The voltage at the top and bottom of the tranzistor would be almost the same => The voltage at X would be almost as of the ground (the voltage drop across the resistor is bigger) (we assume that almost no current flows through the the NOT to the next stage)

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-20.png)

AND gate are also similarly straight forward ^^.

NAND gate:

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-21.png)

Just an NOR gate.

# The amplifier:

![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-22.png)

- There are capacitors to block DC current provided by the power supply for amplification inside the circuit.

- $R_S$ is just for some stabilization.
- $R_1, R_2$ is a voltage divider
    - we need the voltage to keep the gate of the transistor open (a bit)

- The voltage at the + sign can differ from the $V_{DD} = 15V$ to $V_S$ (or 0 if the s resistor isn't there) depending on how open is the transistor. (if open, the voltage is near 0 - that is why the output is inverted (180° rotated))

- $R_D$ is there because, if it wasn't there the voltage on the output would be always VDD (before capacitor), because even 0 resistance on T would still propagate the VDD.

---

Voltage gain is $G = \frac{v_{out}}{v_{in}}$, 

the output signal is inverted ($180^\circ$ out of phase) relative to the input.