Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basics of Logic gates - Part 1

Similar presentations


Presentation on theme: "Basics of Logic gates - Part 1"— Presentation transcript:

1 Basics of Logic gates - Part 1
Lecturer: Norah Alsufyan Basics of Logic gates - Part 1

2 Chapter Outline Brief of Digital circuits The Meaning of Logic Gates
How Logic Gates Are Relevant to Computers Representation of Gates Logic diagrams Truth tables Boolean expressions Cpu is collection of logic gates

3 Chapter Outline Types of Gates Gates with More Inputs
Three Basic Gate Functions NOT AND OR Additional Gate Functions NAND NOR XOR XNOR Gates with More Inputs Formula to Determine the numbers of possible inputs Universal Gates Conclusion Cpu is collection of logic gates

4 Brief of Digital circuits

5

6 Digital circuits Digital circuits requires only two voltage level 0v and 5v. Zero volts (0v) represent logic “0” Five volts (5v) represent logic “1” ON (1): connected to power. OFF (0): not connected to powe

7 The Meaning of Logic Gates

8 The Meaning of Logic Gates
A gate is a device that performs a basic operation on electrical signals. Gates are combined into circuits to perform more complicated tasks. Logic gates are the circuits that are designed to performed these basic logic functions. Actually the term logic is applied to digital circuits used to implement logic functions. Logic Gate is an electronic circuit which receive one or more than one input and deliver single output. Different electronic components like transistor, resistor similarly capacitor, diode etc. are used for designing the logic gate. Digital Logic Gates  A Digital Logic Gate is an electronic device that makes logical decisions based on the different combinations of digital signals present on its inputs.  Digital logic gates may have more than one input but generally only have one digital output.  Individual logic gates can be connected together to form combinational or sequential circuits, or larger logic gate functions.

9 The Meaning of Logic Gates
1. The basic building blocks that make up all digital systems are simple little circuits called logic gates. A logic gate is a decision- making building block which has one output and two or more inputs as shown in Figure 1. 2. The input and output signals of a gate can have either of two values, binary 1 or 0. The value of the output of a gate is decided by the values of its inputs. The truth table for a logic gate shows the value of the output for all pos- sible values of the inputs. AND and OR gates (and the other gates described below) are known as logic gates because their outputs are the logical (i.e. predictable) result of a particular combination of input states. In other words, logic gates are the circuits that take one or more inputs signals and send out a single output signal.

10 The Meaning of Logic Gates
In this logic gate, there are only two state which are one is ON State(1) and another is OFF State(0). ON State can be say High input and High output and OFF State can be say Low input and Low output. ON State means current is passing through the logic circuit and OFF State means current is not passing through the logic circuit.

11 The Meaning of Logic Gates
Several kinds of digital logic circuits are the basic elements that form the building blocks for such complex digital system as the computer. The lines connected to each symbols are the inputs and outputs. The inputs are on the left of each symbol and the output is on the right. To conclude , A circuit that performs a specific logic operation (AND, OR, Not, NOR,NAND, XOR,NXOR) is called a logic gate.

12 How logic gates are relevant to computers

13 Because all computers are ultimately made out of logic gates.
Why are these logic gates relevant to computers and computers technology ? Because all computers are ultimately made out of logic gates. Hundreds of millions of various logic gates , when working together which makes computers function as they do.

14 Representation of Gates
Logic diagrams Truth tables Boolean expressions

15 Representation of Gates
There are three different, but equally powerful, notational methods for describing the behavior of gates and circuits Logic diagrams Truth tables Boolean expressions

16 1- Logic diagram Logic diagram: a graphical representation of a circuit Each type of gate is represented by a specific graphical symbol

17 2- Truth table Truth table: defines the function of a gate by listing all possible input combinations that the gate could encounter, and the corresponding output

18 3- Boolean algebra Boolean algebra: expressions in this algebraic notation are an elegant and powerful way to demonstrate the activity of electrical circuits AND is denoted by a dot (.) OR is denoted by a plus (+). NOT is denoted by a single quote mark (') after the variable or an overbar ( ¯ ). XOR is denoted by

19 Note The statement: 1.1 = 1 ( read 1 AND 1 equals 1 )
1 + 1 = 2 (read “one plus one equals two”) is not the same as = 1 (read “1 or 1 equals 1”). 1.1 = 1 ( read 1 AND 1 equals 1 )

20 Activity #1 - Group Work

21 Types of Gates

22 Types of Gates Let’s examine the processing of the following seven types of gates NOT AND OR XOR NAND NOR XNOR Three Basic Gate Functions Additional Gate Functions

23 Types of Gates Three Basic Gate Functions Additional Gate Functions
Using these three gates we can design any logic circuit. Additional Gate Functions We will define four additional gates which aid circuit design.

24 three basic gate functions
NOT AND OR

25 NOT Gate Representation
A NOT gate accepts one input value and produces one output value Figure 4.1 Various representations of a NOT gate To illustrate how it works visually .. Check this link:

26 What NOT Gate Means By definition, if the input value for a NOT gate is 0, the output value is 1, and if the input value is 1, the output is 0 A NOT gate is sometimes referred to as an inverter because it inverts the input value

27 Example of NOT Gate e.g. I turn on the heating if it is NOT hot
if A = hot and Y = Heating on then: where the bar represents logical NOT.

28 Practical Application of “Not” Logic Gate
When the temperature falls below 20c the Not gate will set on the central heating system (cool huh).

29 AND Gate Representation
An AND gate accepts two input signals If the two input values for an AND gate are both 1, the output is 1; otherwise, the output is 0 Figure 4.2 Various representations of an AND gate To illustrate how it works visually .. Check this link:

30 Example of AND gate e.g. I get up early if I have lectures AND it is a weekday he said if A = lecture B = weekday and Y = get up early then he said you can write: where the dot represents logical AND. Thus , If 1 represents TRUE and 0 represents FALSE then the function can be defined in a truth table. Logic Gates

31 How AND Gate Work

32 Practical Application of “AND” Logic Gate
So while going out of the house you set the "Alarm Switch" and if the burglar enters he will set the "Person switch", and tada the alarm will ring.

33 OR Gate Representation
If the two input values are both 0, the output value is 0; otherwise, the output is 1 Figure 4.3 Various representations of a OR gate To illustrate how it works visually .. Check this link:

34 How OR Gate Work

35 Example of OR Gate e.g. I turn on my headlights if it is dark OR it is raining if A = dark B = raining and Y = headlights on then: where the + sign represents logical OR.

36 Practical Application of “OR” Logic Gate
You would of course want your doorbell to ring when someone presses either the front door switch or the back door switch..(nice).

37 Activity #2 - Group Work 5- 6- 7- 8- 9.
8-  9. A and B are the input signals and X is the output signal. Boolean expression: A  B (A XOR B) Logic Diagram: Truth Table A B X If both inputs are the same value, XOR returns a 0; otherwise XOR returns a 1. 10. Boolean expression: (A  B)’ (NOT (A AND B)) If the inputs are different or both 0, NAND returns a 1; if both are 1, it returns a 0. 11. Boolean expression: (A + B)’ (NOT (A AND B)) If the inputs are both 0, NOR returns a 1; otherwise NOR returns a 0. 42. Compare and contrast the AND gate and the NOR gate. An AND gate produces a 1 as output only if both inputs are 1, whereas a NAND gate produces a 1 as output in all cases /except/ when both inputs are 1. That is, the AND and NAND gates produce opposite results. The values produced by one of these gates can be replicated by inverting the results produced by the other. 12.  A B C X X = A . B . C 44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. X = A + B + C Activity #2 - Group Work

38 5- 6- 7- 8-  9. A and B are the input signals and X is the output signal. Boolean expression: A  B (A XOR B) Logic Diagram: Truth Table A B X If both inputs are the same value, XOR returns a 0; otherwise XOR returns a 1. 10. Boolean expression: (A  B)’ (NOT (A AND B)) If the inputs are different or both 0, NAND returns a 1; if both are 1, it returns a 0. 11. Boolean expression: (A + B)’ (NOT (A AND B)) If the inputs are both 0, NOR returns a 1; otherwise NOR returns a 0. 42. Compare and contrast the AND gate and the NOR gate. An AND gate produces a 1 as output only if both inputs are 1, whereas a NAND gate produces a 1 as output in all cases /except/ when both inputs are 1. That is, the AND and NAND gates produce opposite results. The values produced by one of these gates can be replicated by inverting the results produced by the other. 12.  A B C X X = A . B . C 44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. X = A + B + C Lab # 1 - Group Work

39 additional gates functions
XOR NAND NOR XNOR

40 What XOR Gate Means XOR, or exclusive OR, gate
An XOR gate produces 0 if its two inputs are the same, and a 1 otherwise Note the difference between the XOR gate and the OR gate; they differ only in one input situation When both input signals are 1, the OR gate produces a 1 and the XOR produces a 0

41 XOR Gate Representation
Figure 4.4 Various representations of an XOR gate To illustrate how it works visually .. Check this link:

42 NAND and NOR Gates The NAND and NOR gates are essentially the opposite of the AND and OR gates, respectively Figure 4.5 Various representations of a NAND gate Figure 4.6 Various representations of a NOR gate To illustrate how it works visually .. Check this link:

43 How NAND Gate Work

44 How NOR Gate Work

45 XNOR The XNOR gate is essentially the opposite of the XOR.
To illustrate how it works visually .. Check this link:

46 Gates with More Inputs

47 Gates with More Inputs Gates can be designed to accept three or more input values A three-input AND gate, for example, produces an output of 1 only if all input values are 1 Figure 4.7 Various representations of a three-input AND gate To illustrate how it works visually .. Check this link:

48 How NAND Gate Work With Two Input

49 42. Compare and contrast the AND gate and the NOR gate. An AND gate produces a 1 as output only if both inputs are 1, whereas a NAND gate produces a 1 as output in all cases /except/ when both inputs are 1. That is, the AND and NAND gates produce opposite results. The values produced by one of these gates can be replicated by inverting the results produced by the other. 12.  44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. A B C X X = A + B + C Activity #3 - Group Work

50 5- 6- 7- 8-  9. A and B are the input signals and X is the output signal. Boolean expression: A  B (A XOR B) Logic Diagram: Truth Table A B X If both inputs are the same value, XOR returns a 0; otherwise XOR returns a 1. 10. Boolean expression: (A  B)’ (NOT (A AND B)) If the inputs are different or both 0, NAND returns a 1; if both are 1, it returns a 0. 11. Boolean expression: (A + B)’ (NOT (A AND B)) If the inputs are both 0, NOR returns a 1; otherwise NOR returns a 0. 42. Compare and contrast the AND gate and the NOR gate. An AND gate produces a 1 as output only if both inputs are 1, whereas a NAND gate produces a 1 as output in all cases /except/ when both inputs are 1. That is, the AND and NAND gates produce opposite results. The values produced by one of these gates can be replicated by inverting the results produced by the other. 12.  A B C X X = A . B . C 44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. X = A + B + C Lab # 3 - Group Work

51 Explain Why there are different in the numbers of truth table rows =)
The truth table of NOT have two rows (0,1) The truth table of AND , OR , NOR, XOR, XNOR with two input have four rows (00,10,01,11) The truth table of AND , OR , NOR, XOR, XNOR with three input have eight rows (000,001,010,011,100,101,110,111)

52 Formula to Determine the numbers of possible inputs
To determine the total number of possible combination of binary inputs to a gate is determined by the following formula: N=2n Where N is the number of possible input combinations and n is the number of input variables. Example, Two inputs variables; N=22 = 4 Combinations. Three inputs variables; N=23 = 8 Combinations. Four inputs variables; N=24 = 16 Combinations.

53 Universal Gates 1- NAND 2- NOR

54 What Universal Gates Means
NAND and NOR gates are referred to as universal gates as the three basic gates can be constructed using either one of the two. This therefore implies that all logic circuits can be constructed using either of the gates. The notes show this process for NAND only but it can be shown for NOR also.

55 NOT Using NANDs Only The Truth Table is for a NAND gate
If we tie the inputs of a NAND together then we limit the possible input combinations to two, 1 1 and 0 0. These are shown on the table now if the input is 0 the output is 1 and vice versa a NOT gate A B Y 1 A Y

56 AND Using NANDs Only As a NAND is simply an AND followed by a NOT gate (inverter) we can simply use a NAND followed by NOT. A B Y Note – more than one NAND gate to produce the desired AND gate. Logic Gates

57 OR Using NANDs Only – Step 1
1 This is our desired OR gate

58 OR Using NANDs Only – Step 2
1 If we now add NOT A and NOT B into our table

59 OR Using NANDs Only – Step 3
1 If these are now ANDed together

60 OR Using NANDs Only – Step 4
1 Finally if we invert our result we see that the 3rd and 7th column are identical. This means that if we invert the inputs then NAND then we will end up with the OR function.

61 OR Using NANDs– in Logic Diagram Representation
B Y Prove that in your notebook =) Logic Gates

62 Basic Gate Using NANDs

63 Basic Gate Using Nors

64 Note Conversions from AND, OR, NOT to NAND only rarely produce a less complex circuit but normally the complexity is similar. The advantage lies in the fact that NAND chips are readily available and are inexpensive due to the number sold and that any gates left over can be used in other circuits as all circuits use the same gate types.

65 42. Compare and contrast the AND gate and the NOR gate. An AND gate produces a 1 as output only if both inputs are 1, whereas a NAND gate produces a 1 as output in all cases /except/ when both inputs are 1. That is, the AND and NAND gates produce opposite results. The values produced by one of these gates can be replicated by inverting the results produced by the other. 12.  44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. A B C X X = A + B + C Activity #4 - Group Work

66 Conclusion Logic Gate is an electronic circuit which receive one or more than one input and deliver single output. There are seven logic gates. NOT , OR , AND are the basic logic gates. NOR , NAND, XOR , NXOR are the additional logic gates. A NOT gate inverts its single input value. An AND gate produces 1 if both input values are 1. An OR gate produces 1 if one or the other or both input values are 1.

67 Conclusion An XOR gate produces 1 if one or the other (but not both) input values are 1. A NAND gate produces the opposite results of an AND gate. A NOR gate produces the opposite results of an OR gate. A XNOR gate produces the opposite results of an XOR gate. NAND and NOR gates are referred to as universal gates as the three basic gates can be constructed using either one of the two.

68 Conclusion

69 Conclusion


Download ppt "Basics of Logic gates - Part 1"

Similar presentations


Ads by Google