# What are the examples of logic gates

## Technical computer ScienceLogic gate

Thorsten Thormählen
November 24, 2020
Part 3, Chapter 3

### Control buttons

→ next slide (also enter or space bar).
← previous slide
d switches drawing on transparencies on / off
p switches between print and presentation view
CTRL + enlarges the slides
CTRL - reduces the size of the slides
CTRL 0 resets the size change

You can also switch the slides by clicking on the right or left edge of the slide.

Welcome! (This field is for additional information for the speaker.)

### notation

TypefontExamples
Variables (scalars)italic\$ a, b, x, y \$
Functionsupright\$ \ mathrm {f}, \ mathrm {g} (x), \ mathrm {max} (x) \$
Vectorsbold, elements line by line\$ \ mathbf {a}, \ mathbf {b} = \ begin {pmatrix} x \ y \ end {pmatrix} = (x, y) ^ \ top, \$ \$ \ mathbf {B} = (x, y, z) ^ \ top \$
Matricestypewriter\$ \ mathtt {A}, \ mathtt {B} = \ begin {bmatrix} a & b \ c & d \ end {bmatrix} \$
amountscalligraphic\$ \ mathcal {A}, B = \ {a, b \}, b \ in \ mathcal {B} \$
Number ranges, coordinate spacesdouble crossed\$ \ mathbb {N}, \ mathbb {Z}, \ mathbb {R} ^ 2, \ mathbb {R} ^ 3 \$

### content

• Gate symbols
• Realization of a Boolean function using logic gates
• Practical example: building a logic circuit with ICs

### Gate symbols

• The DIN symbols are used throughout this lecture
• The more recent recommendation of the International Electrotechnical Commission in IEC 60617-12 essentially corresponds to the rectangular DIN symbols
• However, the US standard is very common in practice (especially in English-language literature)

### Representation of switching networks with gates

• In order to build up switching networks from several gates, inputs and outputs of gates can be connected with solid lines running at right angles
• A right-angled branch assumes that there is a connection between the lines
• This can also be clarified with a filled in point
• In order to mark connected intersections, the completed point is absolutely necessary, otherwise the lines are interpreted as not connected.
• The fact that two crossing lines are not connected can also be made clear by a semicircle

### More compact representation

• Both inputs and outputs can be inverted by adding the (unfilled) negation circle.
• Example: \$ y = \ lnot (\ lnot a \ land b) \$
• AND and OR gates can also have more than two inputs
• An OR gate with \$ n \$ inputs implements the expression \$ y = x_1 \ lor x_2 \ lor \ dots \ lor x_n \$
• An AND gate with \$ n \$ inputs implements the expression \$ y = x_1 \ land x_2 \ land \ dots \ land x_n \$
• Example: \$ y = (a \ lor b \ lor c) \ land \ lnot d \ land \ lnot e \$

### Practical example: building a logic circuit with ICs

CD4572UB

• In the following we want to build a real circuit that contains some logic gates
• We use the CMOS IC CD4572UB from Texas Instruments, which provides 4 inverters, 1 NAND and 1 NOR gate

### Practical example: building a logic circuit with ICs

• We will use LEDs ("Light-Emitting Diodes") to visualize the states of the inputs and outputs
• For wired LEDs, the cathode (-) is the shorter leg and the longer leg is the anode (+)
• An LED must always be operated with a series resistor that sets the current through the LED

### Ohm's law

• To calculate the magnitude of the resistance, we need Ohm's law
• Ohm's law makes a statement about voltage and current strength at a resistor:
• Voltage \$ U \$: force on charge carrier, unit volt \$ [\ mathrm {V}] \$
• Amperage \$ I \$: charge carriers flowing through per unit of time, unit amperes \$ [\ mathrm {A}] \$
• Ohm's law says that the current \$ I \$ flowing through a resistor \$ R \$ is proportional to the voltage \$ U \$ that is dropped across the resistor

\$ U = R \ cdot I \ Leftrightarrow I = \ frac {U} {R} \ Leftrightarrow R = \ frac {U} {I} \$

• Resistance \$ R \$: proportionality factor between voltage and current strength, unit ohm \$ [\ Omega] \$
• How big is the current \$ I \$ in this circuit?
• Answer: \$ I = \ frac {U} {R} = \ frac {4.5 \, \ mathrm {V}} {200 \, \ Omega} = 0.0225 \, \ mathrm {A} = 22.5 \, \ mathrm {mA} \$

### Ohm's law

• Voltage divider
• The same current \$ I_0 \$ flows everywhere in the circuit above
• According to Ohm's law:

\$ I_0 = \ frac {U_1} {R_1} \$ and \$ I_0 = \ frac {U_2} {R_2} \$ and \$ I_0 = \ frac {U_0} {R_1 + R_2} \$

• The conversion results in the ratio of the voltages \$ U_1 \$ and \$ U_2 \$:

\$ \ frac {U_1} {R_1} = \ frac {U_2} {R_2} \ Leftrightarrow \ frac {U_1} {U_2} = \ frac {R_1} {R_2} \$

• Flow divider
• In the lower circuit, the same voltage \$ U_0 \$ drops across both resistors
• This results in the ratio of the currents \$ I_1 \$ and \$ I_2 \$:

\$ U_0 = R_1 \ cdot I_1 = R_2 \ cdot I_2 \ Leftrightarrow \ frac {I_1} {I_2} = \ frac {R_2} {R_1} \$

### Calculating the series resistance of an LED

• The data sheet of the LED we use shows that it should be operated with a current of \$ I_0 = 20 \, \ mathrm {mA} \$. According to the data sheet, in this case \$ U_2 = 2.25 \, \ mathrm {V} \$ drops above the LED.
• With a voltage supply with \$ U_0 = 4.5 \, \ mathrm {V} \$, this results in \$ R_1 \$ for the series resistor

\$ \ begin {align} I_0 & = \ frac {U_1} {R_1} = \ frac {U_0 - U_2} {R_1} \ \ Leftrightarrow R_1 & = \ frac {U_0 - U_2} {I_0} \ & = \ frac {4.5 \, \ mathrm {V} - 2.25 \, \ mathrm {V}} {20 \, \ mathrm {mA}} = 112.5 \, \ Omega \ end {align} \$

### Practical example: building a logic circuit with ICs

• The circuit should be implemented with a breadboard
• In the columns for the power supply ("+" or "-"), the slots are vertically connected to one another
• Otherwise the slots are horizontally connected to each other, respectively ("a" to "e") and ("f" to "j")
• A 4.5 volt flat battery is used as the power supply

### Practical example: NOT gate

• When the button is open, the yellow LED lights up and the red one is off
• When the button is closed, the red LED lights up and the yellow one is off
• Example application alarm system: button determines whether the door is open or closed; red LED indicates alarm is switched on; yellow LED alerts the security service

### Practical example: NAND gate

• The red LEDs indicate the status of the two buttons
• The yellow LED only does not light up when both buttons are closed
• Example application: alarm system for two windows

### Practical example: building a logic circuit with ICs

• This video shows (in rapid succession) the structure of the NOT gate and NAND gate circuit from the previous foils on a breadboard

### Practical example: building a logic circuit with ICs

• In the circuits shown, the inputs of the logic IC were each provided with a so-called pull-down resistor of \$ 10 \, \ mathrm {k \ Omega} \$
• If the switches are open, the input would otherwise have an undefined potential and the behavior at the output would be random
• When the switch is open, the pull-down resistor pulls the input towards ground
• When the switch is closed, the supply voltage is applied to the input and a small leakage current flows through the pull-down resistor \$ I _ {\ tiny \ text {loss}} = \ frac {4,5 \ mathrm {V}} {10 \, \ mathrm {k \ Omega}} = 0.45 \, \ mathrm {mA} \$

### Realization with n-channel field effect transistors

• Inverters, NAND and NOR gates, as they are used in the IC CD4572UB, can be implemented e.g. by means of n-channel field effect transistors, which we got to know in chapter 1.2 "History"

NAND

 \$ x \$ \$ y \$ \$ z \$ 0 0 1 0 1 1 1 0 1 1 1 0

NOR

 \$ x \$ \$ y \$ \$ z \$ 0 0 1 0 1 0 1 0 0 1 1 0

### Realization with CMOS technology

• Due to the resistance, however, a relatively large power loss occurs, which is why today's CMOS technology uses p- and n-channel field effect transistors (the CD4572UB is also a CMOS IC)
• The n-channel FET switches through at logic 1, while the p-channel FET switches through at logic 0

### Any questions?

Suggestions or suggestions for improvement can also be sent to me by e-mail: Contact

Further lecture slides

Imprint Data Protection,