Créer une présentation
Télécharger la présentation

Télécharger la présentation
## Electronics “ Phys. 324 ”

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Digital Electronics ( 04 H ):**• Introduction to number systems, 1HLogic gates OR, AND, NOT, X-OR, NAND, NOR gates 1H-Truth tables – Positive and negative logic – Logic families and their characteristics 1H–Universal building blocks NAND and NOR gates 1H. Electronics “ Phys. 324 ” by Prof. Dr. Ali S. Hennache Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**INTRODUCTION**• BINARY NUMBERS The binary (or base 2) number system is a positional number system that represents numeric values using two symbols - zero (0) and one (1). For this reason, it is said to have a radix of 2. Binary values are stored using transistorized switchesin microprocessors and memory chips, and can be manipulated using digital logic circuitry. For this reason, the binary number system is used by computer hardware to carry out all machine-level operations, and to store data in working memory. The bulk storage of non-volatile data on magnetic disk and optical media is also possible largely due to the simple two-state nature of binary values. Binary numbers are expressed as a series of one or more binary digits (bits), occasionally with the suffix 2 to indicate that they are in fact binary (base 2) numbers. Here is the decimal number 170 expressed as a binary number: 101010102 Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**INTRODUCTION**Like the decimal system with which we are familiar, the position of each digit within a binary number determines its value. Whereas each position in a decimal number represents some power of 10, however, each position in a binary number represents a power of 2. The table below shows the numbers 0 to 15 (to base 10) as 4-bit binary numbers (15 is the largest number that can be expressed using four binary digits). The decimal number 15 expressed as a binary number (1111)is therefore: 1x23+1x22+1x21+1x20(8+4+2+1=15) Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**INTRODUCTION**Fractions can also be represented using binary digits, as can real (fractional) numbers. Like real numbers to base 10, the fractional part of a binary number follows a period. In the decimal number system we call this a decimal point, but in the binary number system we call it a binary point. In the decimal system, the numeral in the first position following the decimal point is multiplied by 10-1 (0.1), the digit in the second position following the decimal point is multiplied by 10-2 (0.01), and so on. The fractional part of a binary number works on the same principle, except that the digit in the first position following the binary point is multiplied by 2-1 (0.5 to base 10), the digit in the second position following the binary point is multiplied by 2-2 (0.25 to base 10), and so on. Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**INTRODUCTION**LOGIC GATES • Hardware consists of a few simple building blocks called logic gates: AND, OR, NOT, NAND, NOR, XOR, … • Logic gates are built using transistors NOT gate can be implemented by a single transistor AND gate requires 3 transistors • Transistors are the fundamental devices in computing hardware for example - Pentium consists of 3 million transistors - Compaq Alpha consists of 9 million transistors - Nowadays chips can be builded with more than 100 million transistors Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**AND GATE**Logic generally has only 2 states, ON or OFF, represented by 1 or 0. Logic gates react to inputs in certain ways. The AND gate will only switch on its output Q, if Input A is ON and Input B is ON. This can be shown in a Truth Table, 0=OFF and 1=ON. Truth Table X Z Y Z = X & Y Symbol for AND gate Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**AND GATE - EXAMPLE**Logic can be used to control devices according to certain conditions, such as “switch on a fan if it’s hot AND the sun is out”. Look at the diagrams below. If both inputs are OFF the output is OFF Even if one input is ON the output is OFF Only if A =1 and B =1 will the output switch on Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**AND GATE- EXAMPLE**OR Gate AND Gate In the figure, X and Y are two switches which have been connected in parallel, and this is connected in series with the load LED and source battery. When both switches are open, current does not flow to LED, but when any switch is closed then current flows. In the figure below, X and Y are two switches which have been connected in series (or just cascaded) with the load LED and source battery. When both switches are closed, current flows to LED. Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**TEST**XOR A OR Q A B Q B NOR NAND A A Q Q B B work out the truth tables for these gates. The solution will be given in the next lecture AND A Q B RULE: Q = 1 if A AND B =1 Q = 1 if A OR B =1, but NOT both RULE: Q = 1 if A OR B =1 NOT A Q RULE: Q = 0 if A AND B =1 RULE: Q = 0 if A OR B =1 RULE: Q = 0 if A =1 Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**POSITIVE AND NEGATIVE LOGIC**• Low voltage level: < 0.4V • High voltage level: > 2.4V • Positive logic: ∗ Low voltage represents 0 ∗ High voltage represents 1 • Negative logic: ∗ High voltage represents 0 ∗ Low voltage represents 1 Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**DIODE GATES**Some logic gates can be produced with just diodes and resistors (called diode resistor logic or DRL). Diode-Resistor AND Gate Diode-Resistor OR Gate Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**LOGIC CHIPS USING TRANSISTORS**• Basic building block: Transistor • Three connection points ∗ Base ∗ Emitter ∗ Collector • Transistor can operate ∗ Linear mode ( used in amplifiers) ∗ Switching mode (used to implement digital circuits Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**2 input nand**Logic gates normally come packaged in integrated circuits, but to study the internal works of them you need to be able to build them using discrete components. This is a great exercise for those interested in digital electronic circuits for beginners, specially if you like to learn exactly how things work internally. Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**Transistor and gate**The simplest logic gate can be built using only one transistor: the NOT gate. To build it you need to configure the transistor to be in open collector mode, so that when voltage is applied at the base, the transistor switches on and connects to ground, effectively inverting the input applied at the base. AND gate - Here you need to connect two transistors in a way that the output is high only when both inputs are high. Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**And gate three transistors**Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**Transistororgate**OR gate - This is simpler, you connect them in a way that when either input is high the output will be high. Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**2 input nand**Logic gates normally come packaged in integrated circuits, but to study the internal works of them you need to be able to build them using discrete components. This is a great exercise for those interested in digital electronic circuits for beginners, specially if you like to learn exactly how things work internally. Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**Transistor nand gate**It is a simple matter to make a NAND gate out of transistors and a resistor: The resistors on the inputs limit the base-emitter current to just enough to turn the transistors on. It is important to understand that the inputs are not connected to the output, they only determine whether the output is connected to +5V or 0 V. You can see that this circuit performs the NAND operation. If both transistors are on (both inputs +5V or 1) the output will be connected to ground (be at 0V or 0). If either transistor is off, the output is connected through the resistor to +5V. Here is the circuit behavior presented as a truth table: In 1 = 1, In 2 = 1, Out = 0 In 1 = 1 In 2 = 0, Out = 1 Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**Transistor not gate**NOT gate - This is the simplest one to build, as mentioned in the introduction, you only need one transistor for this one. In = high, switch is closed so current flows to ground Out is low. control high allows current to flow -switch is closed (on) control low stops current flow switch is open (off) Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.**Transistor nor gate**In 1 = 1, Out = 0 In 2 = 1, Out = 0 In 1 = 0 In 2 = 0, Out = 1 Prof. Dr. Ali S. Hennache- Department of Physics - College of Sciences - Al-Imam Muhammad Ibn Saud Islamic University - Riyadh Sept. 2012.