# Electronics and information technology

## L01

# About this notes:

Written by František Zápotocký in 2026 in winter semester of [Trinity College Dublin](https://www.tcd.ie/) attending electronics and information technology course with [Dr. Éamonn Ó Nualláin](https://www.tcd.ie/scss/people/academic-staff/onuallae/). These are notes derived from his lectures and his slides (which are not publicly available).

Even thought I tried to remove as much of them as possible, this notes certainly still contain a lot of mistakes and inconsistencies. If you find any, please email me at [`zapotocky.frantisek1@gmail.com`](mailto:zapotocky.frantisek1@gmail.com). Or better yet, create a PR to [ TODO Add this file to some github repo and add a link here ].

You can use any of the text of this document as you wish. I would appreciate citation, but won't do anything if you don't do that. I don't own rights to any of the pictures. If the alt text contains a link, please refer to it as the source of the picture, if it doesn't, I'm really sorry and if you are the owner of the picture, please contact me via the same email as above.

## So you understand my notes:

^^ are arrows refiring to something few lines up.

> text in this is usually some not that is not necessary to know,
>
> Or some explanation/proof why something is like that.

The most important equations should be $\boxed{\text{boxed}}$, but I don't guarantee that I didn't forget some.

# Section 1:
# Electrical properties of matter:

We can call him Éamonn \[A men\]

## Exam:
Most of the exam problems will be similar to the worksheets we will be doing at home.

It is 100% exam. Minimum of 40% to pass.


# Atomic theory:

Mass of electron is roughly 2000 times less than the mass of proton.

Since there is less electric force acting on the outer electrons, they are usually easier to remove from the atom than the inner ones.

He says, that $e^-$ doesn't fall into the core, because of centrifugal force.

Insulators have electrons that are tightly bound to the core, so they don't move easily.

Conductors have a lot of them.

Semiconductors have like 1 electron that can move charge per $10^8$ atoms.

Copper:

- it is a good conductor because the electrons on outside are very loosely tied to the core - they can move to different one. 

EMF - is the voltage at the source (battery) it is different to the voltage on resistors or whatever is in the circuit

When we are talking about power source than, Katode is the negatively charged and Anode is the positive charged one.

> Diode image is not related to this topic but helps me to remember (cathode looks like K and anode looks like A)
> 
> ![https://www.rs-online.com/designspark/what-is-diode-a-detailed-guide-on-diode](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-35.png)

Current is flowing from + to - (in the circuit)

---

Each atom of silver has 1 free electron -> there are like $10^22$ electrons per cube cm.

Why are metals shiny:

Because photon excites electrons on surface and because it is conductive, it will at the same point shine 1 photon out because it can conduct it (or whatever).

# Electrical Fundamentals:

## Coulomb's Law:

Force between 2 charges is bigger when the product of the charges is larger 
and smaller the further apart they are (square of the distance).

$$\vec{F} = \frac{1}{4\pi\epsilon}\frac{q_1q_2}{r^2}\hat{r}$$

We are trying to find how much are the atoms attracted to each other.

This equation was measured by Coulomb experimentally.

- $\epsilon$ is some number that tells us how is much this material conducts (electrical permittivity)

- $r$ is how far are the atoms apart.

- $q_i$ are the 2 charges of the 2 atoms

- $\hat{r}$ does not effect the size of force, it only effects the direction (because F is a vector, $\hat{r}$ is also a vector)

---

If there are more than 2 atoms, you calculate charge for each pair individually and do a vector sum.

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


> EX:
>
> We have 2 charges 10 cm apart we want to get Electric field Strength at the mid way.
> 
> We add 1C charge in the middle and calculate the force on it from both charges.
>
> Since they act in opposite directions, substract them.
>
> ![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-39.png)

---

## L02

# Electrical potential / voltage

*When electrons are in battery, they have high potential energy. While they flow through a circuit - e.g. converted to heat.*

### Electrical/potential difference (voltage) [V]:

between 2 points is "the work done to move a unit charge from one point to another".

$$\boxed{v(t) = \frac{dW(t)}{dq(t)}}$$

### Electric current [A]:

Is a rate of of change flow of charge (with respect to time).

$$\boxed{i(t) = \frac{dq(t)}{dt}}$$

<a id="power"></a>

## Electric power [J/s] = [W] {#power}:

Is the rate of change of energy.

$$\boxed{p(t) = \frac{dW(t)}{dt}}$$

W is for energy (is the same as work)

1 volt is the potential difference between two points if the work done to move a charge of 1 coulomb between those points is 1 joule.

**EMF** (ElectroMotive Force) is the force that moves charges in a circuit. It is measured in volts. 

## A.C. vs D.C.

$$v(t) = 5\cos(100\pi t)V$$

Alternating current changes polarity all the time - both have some advantages and disadvantages.

## Electric power

since:

$$v(t) = \frac{dW(t)}{dq(t)}\Big|_{/\cdot dq(t)} \text{ and } i(t) = \frac{dq(t)}{dt}\Big|_{/\cdot dq(t)}$$

then:

$$dW(t) = v(t) dq(t) = v(t) i(t) dt \quad (i(t) \cdot dt = dq(t))$$

=>

$$p(t) = \frac{dW(t)}{dt} = \frac{v(t) i(t) dt}{dt} = v(t) i(t)$$

The important thing:

$$\boxed{p(t) = v(t) i(t)}$$

The average A.C. power is given by:

$$P_{AC} = \frac{1}{T} \int_0^T p(t) dt$$

where T is the period of the A.C. signal.

New definition:
## RMS (Root Mean Square) is value of periodic signal of func $y(t)$

- that is what DC value would be equivalent (in terms of power) to the provided AC signal.

$y(t)$ is whatever periodic signal - usually voltage or current.

time variant power y(t):

$$Y_{rms} = \sqrt{\frac{1}{T} \int_0^T y^2(t) dt}$$

Hance:

$$I_{rms} = \sqrt{\frac{1}{T} \int_0^T i^2(t) dt}$$

$$V_{rms} = \sqrt{\frac{1}{T} \int_0^T v^2(t) dt}$$

And since we calculate power from average / DC values of I and V: $P = V_{rms} I_{rms}$

Then there are some complicated calculations and we get (for sinusoidal signals):

$$I_{rms} = \frac{I_{max}}{\sqrt{2}}$$
$$V_{rms} = \frac{V_{max}}{\sqrt{2}}$$

> you can technically (not rigorously) use: $p(t) = \frac{v^2(t)}{R} = \frac{V_{max}^2}{R}cos^2(\omega t)$ Average value of $cos^2(\omega t)$ is 1/2
> 
> > because:
> > $$\cos^2(\omega t) = \frac{1 + \cos(2\omega t)}{2}$$
> >
> > over 1 period $\int_0^T \cos(2\omega t) dt = 0$ (it has both positive and negative part of period) so we are left with 1/2
>
> and we take the square root.
>
> *That might have been more complicated lol*

# Resistors (Section 4):

*Section 3 is skipped/moved to later of this chapter. take look at: [Go to AC sources](#ac-sources)*

Resistors convert electrical energy into heat.

> Resistors are nice because they have linear relationship between voltage and current (not many materials have this property) ( usually you would first need to look up the resistance for that particular voltage / current and from that calculate the other one.)

## Ohm's law:
$$V = IR$$
$$R = \frac{V}{I} [ \Omega ]$$

Btw:

since $p(t) = v(t) i(t)$, then:
$$p(t) = i^2(t) R$$
$$p(t) = \frac{v^2(t)}{R}$$

> If we have a heater:
> 
> $$P_{heater} = \frac{V^2}{R_{heater}}$$
> 
> If you decrease the resistance of the heater, you will increase the power of the heater.F
> 
> There is some limit resistance of the heater before something burns.

### Serial connection of resistors:

$$R_{\text{total}} = R_1 + R_2 + R_3 + ... + R_n$$

$$v(t) = i(t) R_{\text{total}}$$

Total sum of voltage is equal:

$$v(t) = v_1(t) + v_2(t) + v_3(t) + ... + v_n(t)$$

so:

$$v(t) = i(t) R_{\text{total}}$$


### Parallel connection of resistors:

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

$$i(t) = i_1(t) + i_2(t) + i_3(t) + ... + i_n(t)$$

Since we assume that vires are ideal, then:

$$v(t) = v_1(t) = v_2(t) = v_3(t) = ... = v_n(t)$$

and:
$$v_1(t) = i_1(t) R_1$$
$$v_2(t) = i_2(t) R_2$$
$$...$$
$$v_n(t) = i_n(t) R_n$$

so:

$$i_1(t) = \frac{v(t)}{R_1}$$
$$i_2(t) = \frac{v(t)}{R_2}$$
$$...$$
$$i_n(t) = \frac{v(t)}{R_n}$$

so:

$$i(t) = \frac{v(t)}{R_1} + \frac{v(t)}{R_2} + \frac{v(t)}{R_3} + ... + \frac{v(t)}{R_n}$$
$$\frac{v(t)}{R_{\text{total}}} = \frac{v(t)}{R_1} + \frac{v(t)}{R_2} + \frac{v(t)}{R_3} + ... + \frac{v(t)}{R_n}$$

And we get rule for resistors in parallel:

$$\frac{1}{R_{\text{total}}} = \frac{1}{R_1} + \frac{1}{R_2} + \frac{1}{R_3} + ... + \frac{1}{R_n}$$

And:
$$v(t) = i(t) R_{\text{total}}$$


---

We say that the suply "sees" the total resistive load. (it is the same as it there was just one big resistor)

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

### Potential divider:

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

$$v(t) = i(t) R_{\text{total}}$$
$$v_2(t) = i(t) R_2$$

If the thing that is connected to the potential divider has infinite impedance, than the current that goes through it will be zero. We assume that to make our calculations easier.

In the infinite impedance case this is the voltage:

$$v_2(t) = \frac{R_2}{R_1 + R_2} v(t)$$

> because:
> $$i(t) = \frac{v(t)}{R_1 + R_2}$$
> $$v_2(t) = i(t) R_2 = \frac{v(t)}{R_1 + R_2} R_2 = \frac{R_2}{R_1 + R_2} v(t)$$

<a id="ac-sources"></a>

## AC sources (Section 3 / part of section 4): {#ac-sources}

*Ideal voltage/current source does not change the voltage/current depending the load. - they are impossible to create, but in our circuits we will be using them for simplicity. If we want, we can simulate real ones by adding an additional resistor (V - in series, I - in parallel).*

General formula for AC (Alternating Current) voltage:

$$v(t) = V_{max} \cos(\omega t + \phi)$$

(sometimes $\sin$ is used instead of $\cos$)

where:
- $V_{max}$ is the maximum voltage
- $\omega$ is the angular frequency $= 2 \pi f$ ($2 \pi$  is a full circle in radians)
- $t$ is time
- $\phi$ is the phase angle

We will not care about the phase in this course much.

**If we are solving a AC problem, we just solve the problem as in DC, we get the voltage on particular resistor, and then we multiply it by $\cos(\omega t + \phi)$.**

That is literally it.

Ya and when you have 230 V in your house, that is the RMS value - consumers mostly care about the effective value of the voltage, because that is what powers their devices. (So to get V_max, you multiply it by $\sqrt{2}$)

## Resistor coding:

Resistors are noted by colors. It is:

```
[Digit 1] [Digit 2] ([Digit 3]) [Multiplier] ([Tolerance])
```

![https://www.ebay.co.uk/itm/900029931533?chn=ps&_ul=GB&_trkparms=ispr%3D1&amdata=enc%3A1dTm4kdi4QmaL4WuM9Zootw17&norover=1&mkevt=1&mkrid=710-169260-534375-3&mkcid=2&keyword=&crlp=670833748941_&MT_ID=&geo_id=&rlsatarget=pla-325425753764&adpos=&device=c&mktype=pla&loc=9192439&poi=&abcId=&cmpgn=20488672762&sitelnk=&adgroupid=155578564071&network=g&matchtype=&gad_source=1&gad_campaignid=20488672762&gbraid=0AAAAAo9ZJxtZjrOy5IBPvCaBsVT-RZ7vR&gclid=Cj0KCQiAiJXYBhD_ARIsAAx2AHmCfiGBNk0DJ1ppELb4Yr9xP4zYqNa5EvW88EQac8eGHE5AyxQL8yEaAu2KEALw_wcB](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-36.png)

---

## L03

# Kirchhoff's laws (Section 5):

## Kirchhoff's current law (KCL):

The sum of currents entering a node is equal to the sum of currents leaving the node.

Algebraic sum of currents at a node is zero.

![https://electricalacademia.com/basic-electrical/kirchhoffs-current-law-kcl-kirchhoffs-law/](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-37.png)

## Kirchhoff's Law of voltage (KVL):

$$\sum_{k=1}^{n} v_k(t) = 0$$

![https://ecstudiosystems.com/discover/textbooks/basic-electronics/dc-circuits/kirchhoffs-voltage-law/](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-3.png)

*I chose this picture because it also shows the direction of the current in power and the load, but I noticed now that it is kinda flipped not according to standard way to do it. (but still correct)*

# Earthing and grounding (Section 6):

PE is connected to the earth rod - metal near your home in the earth.

(^^ Earthing is a safety measure)

Earth (green and yellow), Live (brown), and Neutral (blue)

![https://en.wikipedia.org/wiki/Ground_(electricity)](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-38.png)

---

Grounding is a reference point for the electrical circuit - for making these "diagrams". (we usually assume that the ground is at 0V)

Lightning rods are also earthed.

### Grounding:

Ground - zero reference

The symbol for ground is:

![https://en.wikipedia.org/wiki/Ground_(electricity)](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-4.png)

---

## L04

# Capacitor (Section 7):

(you have 2 conducting plates, and you put them close together with insulator in between)

between the plates, there is ceramic, air, plastic..., and sometimes they are rolled.

### Capacitance [F]:

$$\boxed{C = \frac{\varepsilon A}{d}}$$

where:
- $C$ is the capacitance in farads (F)
- $\varepsilon$ is the permittivity of the dielectric material between the plates
- $A$ is the area of one of the plates in square meters (m²)
- $d$ is the distance between the plates in meters (m)

### How does the capacitor work?

One plate is + charged and the other is - charged. 

Between them there is an electric field $\overrightarrow{E}$

The current flows in the circuit and as the capacitor charges, the current decreases. When the capacitor is fully charged, the current stops flowing.
(the current is not flowing, it is induced by the electric field between the plates)

When the we connect C to a DC source, the current flows at first, but as the capacitor charges, the current decreases. When the capacitor is fully charged, the current stops flowing.

- Capacitors allow AC to flow through them, but block DC.

Capacitance is defined as the ratio of the charge $Q$ on one positively charged plate to the potential difference $V$ between the plates:

$$\boxed{C = \frac{q(t)}{v(t)}}$$


> Calculating **charge** of capacitor (in Coulombs [C]) (*easily derivable*):
>
>   $$q(t) = C v(t)$$

so we compute the q from C and __instantaneous__ voltage $v(t)$.


also we can caluclate via:

$$\boxed{C = \frac{\varepsilon A}{d}} = \frac{\varepsilon_r \varepsilon_0 \pi r^2}{d}$$

Energy stored in a capacitor [J] is given by:

$$\boxed{E = \frac{1}{2} C V^2}$$

***Farad** is defined as the capacitance of a capacitor containing 1 coulomb (of charge) on the positive plate when the potential difference applied between the plates is 1 volt.*

---

### Current through a capacitor:

(we need to differentiate to get the current)

$$q(t) = C v(t) \Rightarrow$$
$$\frac{dq(t)}{dt} = C \frac{dv(t)}{dt} \Rightarrow$$
$$\boxed{i(t) = C \frac{dv(t)}{dt}}$$

(if the voltage is not changing over time, then the current is 0)

Note that there is no movement of electrons through the dielectric. But the electric field induces a current in the second plate. That is called **displacement current**. 

### Energy stored in a capacitor:

> $$p(t) = u(t)i(t)$$
> $$i(t) = C \frac{du(t)}{dt} \Rightarrow$$
> $$p(t) = u(t) \cdot C \frac{dv(t)}{dt} =$$
>
> We use the chain rule in the other direction $\frac{d(v^2(t))}{dt} = 2v(t) \frac{dv(t)}{dt}$ and we get:
>
> $$\frac{C}{2} \frac{d(v^2(t))}{dt}$$
>
> [$p(t) = \frac{dw(t)}{dt} \Rightarrow$](l02.md#power)
>
> $$\frac{dw(t)}{dt} = \frac{C}{2} \frac{d(v^2(t))}{dt} \Rightarrow$$

$$\boxed{w(t) = \frac{C}{2} v^2(t)}$$

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

In this circuit, the load sees only the AC voltage.

Capacitors in series are summed like resistors in parallel and vice versa.

### Capacitors in series:
![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-6.png)

the voltage on each capacitor is $v_1(t), v_2(t), ..., v_n(t)$

and the Voltage must sum to the total voltage:

$$\sum_{k=1}^{n} v_k(t) = v(t)$$

but the charge on each capacitor is the same:

> because the current is the same through all capacitors in series, and the charge $q(t)$ is related to the current by $i(t) = \frac{dq(t)}{dt}$.

> for voltages:
> $$v_k(t) = \frac{q(t)}{C_k}$$
> $$v(t) = \sum_{k=1}^{n} v_k(t) = \sum_{k=1}^{n} \frac{q(t)}{C_k} = q(t) \sum_{k=1}^{n} \frac{1}{C_k}$$
> $$C_{total} = \frac{q(t)}{v(t)} = \frac{q(t)}{q(t) \sum_{k=1}^{n} \frac{1}{C_k}} = \frac{1}{\sum_{k=1}^{n} \frac{1}{C_k}}$$

$$C_{total} = \frac{q(t)}{v(t)} =
\frac{1}{\frac{1}{C_1} + \frac{1}{C_2} + ... + \frac{1}{C_n}}$$

### Capacitors in parallel:

$$C_{total} = C_1 + C_2 + ... + C_n$$

The voltage across each capacitor is the same.

But the charge on each capacitor is different:

$$q(t) = C_1 v(t) + C_2 v(t) + ... + C_n v(t) = (C_1 + C_2 + ... + C_n)v(t)$$

> When we get the charge (Q[C]), the same is on the first capacitor (in the case of DC), we will need to figure out the other charges from the voltages etc.

Capacitive reactance (opposition to AC): $X_C = \frac{1}{2\pi f C}$ (at DC where $f=0$, $X_C \to \infty$, blocking DC).

# Coil (Section 8): 

Around a vire, there is a magnetic field, if the current is flowing through it.

$$L = \frac{\Psi(t)}{i(t)}$$

where:

$\Psi(t)$ is the magnetic flux linkage in webers (Wb)

$i(t)$ is the current in amperes (A)

There is an approximation:

$$L \approx \frac{\mu N^2 A}{l}$$

where:
- $L$ is the inductance in henrys (H)
- $\mu$ is the permeability of the core material
- $N$ is the number of turns in the coil
- $A$ is the cross-sectional area of the coil in square meters (m²)
- $l$ is the length of the coil in meters (m)

Electric charge need to move to create a magnetic field, and the magnetic field will induce a voltage of it is changing.

The units are H Henry - $1A$ of current through and 1Wb of magnetic flux.

### * Magnetic flux linkage:

$$\Psi(t) = B(t) A N$$

where:

- $B(t)$ is the magnetic flux density in teslas (T) acting perpendicular to the area of the coil - if not perpendicular, we use $\cos(\theta)$
- $A$ is the cross-sectional area of the coil in square meters (m²) (sometimes calculated from velocity fo movement of a wire)
- $N$ is the number of turns in the coil

### Voltage across an inductor:

$$v(t) = L \frac{di(t)}{dt}$$

Note that the voltage direction is in the opposite direction of the current flow. 

> "resistance" of the coil is called inductive reactance:
> 
> $$X_L = 2 \pi f L$$
> 
> > ($Z = \sqrt{R^2 + X_L^2}$)
> 
> $$I = \frac{V}{Z}$$

> the current through 10mH inductor is given by:
> $$i(t) = 2t^2e^{\frac{-t}{10}}; t>0$$

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

We can charge the coil by closing the switch A.

Here when the coil is charged and we turn on the switch A, there might be a spark on the switch.

This happens only when we open and close the switch A in short period od time (if the time is long, the coil can discharge on it's own)

btw, if we charge the coil with A, switch it of and turn on B, there will now (for quite a short time) be a current flowing through the coil, resistor and the switch B (- in the same direction as the original current). On B there can also be a spark.

### Energy stored in an inductor:

> $$p(t) = v(t)i(t) = L \frac{di(t)}{dt} i(t) =$$
> We use the chain rule for $i$:
> 
> $$p(t) = \frac{L}{2}\frac{di^2(t)}{dt}$$
> 
> To get power:
> 
> Power is the rate of change of energy:
> 
> $$p(t) = \frac{d w(t)}{dt}$$
> & you can see that L doesn't change over time - it is safe to put it inside the derivative.

$$\Rightarrow \boxed{w(t) = \frac{L}{2}i^2(t)}$$

### In series:

$L_{total} = L_1 + L_2 + ... + L_n$

### In parallel:

$\frac{1}{L_{total}} = \frac{1}{L_1} + \frac{1}{L_2} + ... + \frac{1}{L_n}$

> Example:
>
> ![alt text](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-8.png)
> 
> $$p(t) = ?$$
> After stabilizing the current, the $Z_L$ is 0, because the frequency is 0.
> 
> The resistance is $R = 3 + 2 = 5 \Omega$
> 
> The current is $i(t) = \frac{v(t)}{R} = \frac{15}{5} = 3A$
> 
> The energy stored: $w(t) = \frac{Li^2(t)}{2} = \frac{6\cdot10^{-3}  3^2}{2} = 0.027J = 27mJ$

---

## L05

# 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.

---

## L06

# Electric field:

### Electric field [V/m] or [N/C]:

When there is a electric potential difference between 2 points, there exists an electric field between them. 

$$\boxed{\vec{E} = \frac{\vec{F}}{Q}}$$

Where F is the force and Q is the charge.

Electric field strength (density) is the force per unit positive charge at that point.

### Electric flux density [C/m^2]:

At the point where the electric field exists, there exists: electric flux through an area is defined as:

$$\Psi_e = \hat{n} \cdot \vec{D} A$$

- Where D is the electric flux density $\varepsilon E$, 
- A is the area and
- n is the unit vector normal to the surface.

The vire has 0 charge - because there is the same amount of electrons going in and out of the wire - there is the same number of electrons as protons.

---

When you have 2 wires next to each other one creates magnetic field around it's self and the other wire is in the field, so it will experience a force that makes the wires move to / from each other. 

If they go in the same direction, they will attract each other, if they go in opposite directions, they will repel each other.

-> we are going to electric motor.

**Ampere** is defined as: is the current that flows through 2 wires of infinite length placed 1 meter apart in vacuum. Causes each to experience a force of $2 \times 10^{-7} N$.

- so from the ampere we define what is a **Coulomb**: $[C] = [A \cdot s]$ - the amount of charge that passes through a wire in 1 second when the current is 1 ampere.

## Right hand rule:

We point our thumb in the direction of the current, and our fingers curl in the direction of the magnetic field.

![https://en.wikipedia.org/wiki/Right-hand_rule](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-40.png)

### Magnetic pole [Wb]:

If a pole **of 1 Wb (weber)** is moved around a current of 1A the work done is 1 J (joule).

Magnetic strength is in $[N/Wb]$.

$\boxed{\vec{F} = p \cdot H}$

- where F is the force [N]
- p is the magnetic pole [Wb]
- H is the magnetic field strength [N/Wb]

## Magnetic field strength [A/m]:

Magnetic field strength at a point is defined per unit positive magnetic pole (North) at that point.

$\vec{H}$ is a vector quantity and its unit is Ampere per meter $[A/m]$ or $[N/Wb]$


$$\vec{H} = \frac{\vec{F}}{p}$$

- Where F is the force [N]
- and p is the magnetic pole [Wb]


## Magnetic flux density [T]:

is a vector quantity and its unit is Tesla $[T] = [Wb/m^2]$.

$$\vec{B} = \mu \vec{H}$$

- $\mu = \mu_r \mu_0$ is magnetic permeability [H/m] (note that $\mu_r$ is dimensionless [/])
- $\vec{H}$ is magnetic field strength [A/m]

we get:

$$\Psi_m = \hat{n} \cdot \vec{B} A$$

- Where B is the magnetic flux density
- A is the area and 
- n is the unit vector normal to the surface.

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

Electric field lines start at positive charges and end at negative charges, and exert force on any charge in the direction of the field.

Magnetic field lines always form closed loops around currents (no magnetic monopoles exist), and exert force only on moving charges perpendicular to the field.

---

there are more equations to remember:

$$\boxed{\vec{D} = \varepsilon \vec{E}}$$

- D is the electric flux density [C/m^2]
- E is the electric field strength [V/m]
- $\varepsilon = \varepsilon_r \varepsilon_0$ is the permittivity of the medium []

$$\boxed{\vec{B} = \mu \vec{H}}$$

- B is the magnetic flux density [T]
- H is the magnetic field strength [A/m]
- $\mu = \mu_r \mu_0$ is the permeability of the medium [F/m]

Where $\varepsilon$ is the permittivity of the medium and $\mu$ is the permeability of the medium.

## Ampere’s Law for an Infinite Straight Wire:

$$\vec{B} = \frac{\mu I}{2 \pi R} \hat{i} \times \hat{r}$$

the $\frac{\mu I}{2 \pi R}$ is the magnitude and the $\hat{i} \times \hat{r}$ is the direction denoted by the cross product - the vectors perpendicular to both.

- $\mu$ is the permeability of the medium [H/m]
- I is the current through the wire [A]
- R is the distance from the wire [m]
- $\hat{i}$ points to the direction of the current
- $\hat{r}$ points to the direction of the object we are measuring the magnetic field at.

---

## L07

## Faraday's Law:

When a changing magnetic flux threads (‘cuts’) a conductor, an
emf is induced according to the equation:

$$\boxed{{E} = - \frac{d\psi_m}{dt}}$$

- $E$ is the induced electromagnetic force [V]
- and $\psi_m$ is the magnetic flux [Wb].

## Lenz's Law:
*(it is a bit less important)*

when there is n loops, than the induced emf is:

$${E} = - n \frac{d\psi_m}{dt}$$

The minus sign means the induced EMF (and the current it creates) always has a polarity that opposes the change in magnetic flux that caused it.

## Use of Faraday's Law:

So with Faraday's Law, we can create like stereo and microphones - physical thing moves and induces a voltage we can measure.

Or we are getting AC from rotating a vire in a magnetic field.

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

we'r talking about turbines.

## The Lorentz Force Law:

if we have charge $q$ with velocity $v$ in a magnetic field of magnetic flux density $B$, then the force it experiences is:

$$\vec{F} = q \vec{v} \times \vec{B}$$

if you have a chare moving in a magnetic field and electric field, then the force it experiences is:

$$\vec{F}_\text{total} = \vec{F}_{E} + \vec{F}_{B} = q (\vec{E} + \vec{v} \times \vec{B})$$

# Signals (section XIV):

we can have periodic signals, aperiodic signals, but we will talk only about aperiodic signals. because with periodic signals, you can't transfer much information (or we will talk about periodic signals, but they are not as useful)

Period is time duration of one cycle, and frequency is the number of cycles per second.


# Fourier Transform:

We get signal in the time domain, and get the frequency representation of it.

It is nice for representing the bands different radio stations occupy.

> ### Wireless communication:
> you have this (e.g. sound) signal, you modulate it to some frequency and the receiver listens only to that one frequency band and demodulates it to get the original signal.

We have also "negative" frequencies, but usually we don't care about them.

## Modulation:

We can have a signal in a base band, but then noter signal won't be able to use the same frequency.

we use a carrier frequency to modulate the signal - each signal gets a different one - we can fit more of them in the same medium. We also need some space between the signals, so they don't interfere.

That is called frequency multiplexing. We can also use like time division multiplexing - different users send signals at different times - they do round robin.

Amplitude modulation has a lot of noise, because all the noise is added / mixed with the signal so the result is changed. Whereas frequency modulation would need a strong noise so it would have bigger amplitude than the signal we want to listen to.

- companies need to pay for the frequency they use

---

## L08

# Signal Modulation (Section XVI):



We use some carrier frequency to modulate the signal - more signals can be sent in the same medium.

### Amplitude modulation (AM):

Is easy to imagine, but is kinda bad in any other way (noise, not even that easy to modulate - oh it has slightly smaller bandwidth).

### Frequency modulation (FM):

$\ddot\smile$ it is harder to interface with.

$\ddot\frown$ it needs more bandwidth.

The modulation is produced by voltage controlled oscillator (VCO) (than it is probably amplified and sent to the antenna or whatever).

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

- we can see that the bandwidth is 2 times higher than before, because we need to use also the negative frequencies.

For frequency modulation, the bandwidth is also increased by the modulation index ($\beta$) (typically $\beta$ is between 0.5 and 5).

$B_{FM} = 2(\beta + 1) B_{\text{base}}$


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

- we also need to demodulate the signal. - We didn't said much.

### Phase modulation (PM):

in many ways it is similar to frequency modulation.

## Antennas:

The most basic antenna:

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

($\lambda$ is the wavelength - distance form 1 peak to the next one of the signal)

but:
- $f = 100KHz$ - $\frac{\lambda}{2} = \frac{3 \cdot 10^8}{2 \cdot 10^5} = 1500m$ - not practical
- $f = 100MHz$ - $\frac{\lambda}{2} = \frac{3 \cdot 10^8}{2 \cdot 10^8} = 1.5m$
- $f = 1GHz$ - $\frac{\lambda}{2} = \frac{3 \cdot 10^8}{2 \cdot 10^9} = 0.15m$


*maybe the numbers are not correct, but this is the point*

## Discrete Fourier Transform (DFT) (Section XVII):



- first we have to convert from analog to digital - we need to sample it.

  - we usually pass the signal to a low pass filter, so we don't have infinite sampling frequency.

It looks like:

$$X(j\omega) = \int_{-\infty}^{\infty} x(t) e^{-j\omega t} dt$$

The DFT is the FT adapted for discrete (digital) signals (using a finite sum instead of an integral).

$$X[k] = \sum_{n=0}^{N-1} x[n] e^{-j\frac{2\pi}{N}kn}$$

It wont be in the exam.

-> we need to sample in greater than the Nyquist rate, otherwise we will get aliasing - the signal will interfere with itself:

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

## Digital vs Analog processing:

- If we want to process analog signal, we need to create a new device. whereas for digital ones, we just write a new peace of software and upload it to the device - that is faster.

---

## L09

It is ok to sample with higher frequency than the Nyquist one, but if we sample less, we get distortion and aliasing.

We have quantization error, but it is reduced by increasing the number of bits in the ADC.

Both analog and digital signals are influenced by noise, but digital signals can be repaired - (if we where repaying analog signals, we dont know what was the intended signal)

Digital signal get distorted only if the noise is really big. We can also do error detection (but probably when streaming we dont do that)

### Quantization:

You have a some bit depth which tells you how precise is the ADC - if we use 8 bits encoding, we get to distinguish between 256 levels.

Quantization error is when 2 different values are mapped to the same level.

## Human voice transmission:

We usually chope it to just 4KHz, because it is understandable even in that case.

(we dont care about negative frequencies:)

```
    ampl
    __|__
   |  |  |
------|------ f
      0  ^
         |
        4KHz
```

So we should sample at 8KHz. that is $125 \mu s$ between samples.

If we use 8 bits per sample, we het 8 bits * 8KHz = 64Kbps. (we can use compression to reduce it to 16Kbps)

---

# Modulation of digital signals (Section XIX):



We can fit more bits through 1 vire using:

## multi level modulation - get higher data rates

In one sample we have more than 2 possible levels - need better measurement, but can fit more bits.

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

this signal has $B_b = 12$ bps, so the baud rate (S) is 6 baud. (depending on the number of levels - in this case 4 levels => $\log_24 = 2$)

$$\boxed{S = \frac{B_b}{\log_2(M)}}$$

*(don't confuse quantization with modulation - it is about converting analog to digital, not about digital signals through a wire - idk why would you want that, but don't)*

Bandwidth is the range of frequencies that a signal can occupy.

BTW:
**Nyquist bit rate** = 2 * Bandwidth * log2(M) where M is the number of levels. is the maximum bit rate we can achieve.

> Nyquist's formula assumes a noiseless channel; in a noisy channel, the maximum theoretical bit rate is given by the Shannon-Hartley theorem: $C = B \log_2(1 + \text{SNR})$
> 
> > SNR is the signal-to-noise ratio, which is a measure of how much noise is present in the channel relative to the signal strength.

We use again the f/phase/ amplitude modulation, but since it is digital, we can repare it again which makes it more robust in some cases.

### ASK (Amplitude Shift Keying) - equivalent to amplitude modulation

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

Multi level ASK is called M-ASK.

For modulating carrier frequency, (when we move it from 0) get $B_{mod} = 2 \cdot B_b$

also the base-band bandwidth is $B_b = S / 2$

so in ideal case, we can get $B_{mod} = 2 \cdot S / 2 = S$

in real case:

If in exam we are not given $d$, we can assume it is 0: $\boxed{B_{mod} = (1 + d) \cdot S}$ where $d \in [0, 1]$

   Example:

   B = 100kHz (from 200 - 300kHz)
   
   & using 8-ASK

   => Carrier frequency = 250kHz

   8-ASK => 3 bits per symbol

   we use formula $B_{mod} = (1 + d) \cdot S$ to get the baud rate:

   $B_{mod} = 100kHz = (1 + d) \cdot S$ => $S = 100kHz / (1 + d) = 100Kbaud$

   $$S = R / \text{bits per symbol} \Rightarrow R = S \cdot \text{bits per symbol} = 100Kbaud \cdot 3 bits/symbol = 300Kbps$$

### FSK (Frequency Shift Keying) - equivalent to frequency modulation

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

Bro says, that the formula is derived by experiments, so we should not care about the "proof" that is usually in books.

$\boxed{B_{mod} = S \cdot (L + d)}$ where the $L$ is the number of levels.

   Example:

   B = 100kHz (from 200 - 300kHz)

   2-FSK and $d = 1$

   => Carrier frequency = 250kHz
   
   There are 2 levels, so L = 2

   $B_{mod} = S \cdot (L + d) = S \cdot (2 + 1) = 3 \cdot S \Rightarrow S = 100KHz / 3 = 33.33Kbaud$

   $S = R / \log_2(L) \Rightarrow R = S \cdot \log_2(L) = 33.33Kbaud \cdot \log_2(2) = 33.33Kbps$

### PSK (Phase Shift Keying) - equivalent to phase modulation

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

$B_{mod} = S \cdot (1 + d)$

   <!-- Example:

   B = 100kHz (from 200 - 300kHz)

   4-PSK and $d = 1$

   => Carrier frequency = 250kHz

   $B_{mod} = S \cdot (1 + d) = S \cdot (1 + 1) = 2 \cdot S \Rightarrow S = 100KHz / 2 = 50Kbaud$

   $S = R / \log_2(L) \Rightarrow R = S \cdot \log_2(L) = 50Kbaud \cdot \log_2(4) = 100Kbps$ -->

### QAM (Quadrature Amplitude Modulation) - combines amplitude and phase modulation

![https://www.draytek.co.uk/information/blog/what-is-qam-and-how-does-it-work](https://zapotocf.vercel.app/school/tcd/electronics-a-info-tech/image-32.png)

^^ is constellation diagram it shows both the angle of the phase shift and the amplitude of the signal.

$B_{mod} = S \cdot (1 + d)$

**Example:** What is the bandwidth occupancy of a 1 Mbps signal modulated with QAM?

- An (M)-QAM signal carries $\log_2 M$ bits per symbol.
- The bit rate is $R = S \log_2 M$, and
  $B_{\text{mod}} = (1+d)S = \frac{(1+d)R}{\log_2 M}.$
- For \(d=1\):
  $B_{\text{mod}} = \frac{2R}{\log_2 M}.$
- With 16-QAM:
  $B_{\text{mod}} = \frac{2 \times 1\text{ Mbps}}{4} = 500\text{ kHz}.$
- With 256-QAM:
  $B_{\text{mod}} = \frac{2 \times 1\text{ Mbps}}{8} = 250\text{ kHz}.$
- With 1024-QAM:
  $B_{\text{mod}} = \frac{2 \times 1\text{ Mbps}}{10} = 200\text{ kHz}.$


All the formulas:

| modulation | $B_{mod}$ | $S$ | $R$ |
|------------|------------|-----|-----|
| AM         | $2 \cdot B_b$ | N/A | N/A |
| FM         | $2(\beta + 1) B_{\text{base}}$ | N/A | N/A |
| ASK        | $(1 + d) \cdot S$ | $B_{mod} / (1 + d)$ | $S \cdot \log_2(L)$ |
| FSK        | $S \cdot (L + d)$ | $B_{mod} / (L + d)$ | $S \cdot \log_2(L)$ |
| PSK        | $(1 + d) \cdot S$ | $B_{mod} / (1 + d)$ | $S \cdot \log_2(L)$ |
| QAM        | $(1 + d) \cdot S$ | $B_{mod} / (1 + d)$ | $S \cdot \log_2(M)$ |


# Multiplexing:

Multiplexer is a switch which gets multiple input cables and sends them through one output cable.

The output cable  needs to have enough capacity to carry all the input signals (for example band width or be able to more bits per second in 1 band to do time switching).

## TDM (Time Division Multiplexing) - we send the signals one after another in time.

In time it changes who's data are being sent. 

```
alice   \
bob  ---- MUX -> |alice[0]|bob[0]|charlie[0]|alice[1]|bob[1]|charlie[1]| ... |
charlie /
```

## FDM (Frequency Division Multiplexing)

That is the thing we did with modulation - when different frequencies carry different signals. To fit into the same medium.
