Basics of Logic gates - Part 1

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

Chapter 4 Gates and Circuits.
Gates and Circuits Nell Dale & John Lewis (adaptation by Erin Chambers and Michael Goldwasser)
CT455: Computer Organization Logic gate
Logic Gates Some Most All Learning Objective
Programming Logic Gate Functions in PLCs
Chapter 4 Gates and Circuits.
Chapter 4 Gates and Circuits.
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
DIGITAL CIRCUITS Dr. L M Head Sophomore Clinic Fall 2004.
Lecture 3. Boolean Algebra, Logic Gates
In this module you will learn: What the various logic gates do. How to represent logic gates on a circuit diagram. The truth tables for the logic gates.
3. DIGITAL ELECTRONICS..
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Chapter 4 Gates and Circuits.
Logical Circuit Design Week 5: Combinational Logic Circuits Mentor Hamiti, MSc Office ,
Lecture 3. Error Detection and Correction, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Module 3.  Binary logic consists of :  logic variables  designated by alphabet letters, e.g. A, B, C… x, y, z, etc.  have ONLY 2 possible values:
Chapter 4 Gates and Circuits. Integrated Circuits aka CHIPS What’s in this thing???? 4–2.
Chapter 4 Gates and Circuits.
CPS120: Introduction to Computer Science
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
 In studying digital integrated circuits, one must start with the simplest group of circuit, the SSIs or Small Scale Integrated Circuits. Since these.
LOGIC GATES.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
COMPUTER ARCHITECTURE TRUTH TABLES AND LOGIC GATES.
ECE DIGITAL LOGIC LECTURE 5: BINARY LOGIC AND DIGITAL LOGIC GATES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/28/2016.
Digital electronics 4–1 Gates and Circuits SANJAYBHAI RAJGURU COLLEGE OF ENGG.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
L OGIC G ATES Computer Organization – week 3. W HAT ’ S ALU? 1. ALU stands for: Arithmetic Logic Unit 2. ALU is a digital circuit that performs Arithmetic.
LOGIC GATES. INTRODUCTION TO LOGIC GATES Boolean functions may be practically implemented by using electronic gates. The following points are important.
Week 1: Introduction and Logic gates IT3002 – Computer Architecture
Logic Functions While each logical element or condition must always have a logic value of either "0" or "1", we also need to have ways to combine different.
Logic Gates Unit 16.
Logic gates.
Boolean Algebra & Logic Gates
Unit 1 Logical operators.
CSIS-110 Introduction to Computer Science
Basics of Logic gates - Part 2
Digital Logic.
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Morgan Kaufmann Publishers
Logic Gates & Boolean Algebra
CSIS-110 Introduction to Computer Science
Chapter 2.3 Binary Logic.
Digital Signals Digital Signals have two basic states:
Dr. Clincy Professor of CS
Fundamentals & Ethics of Information Systems IS 201
Practice #Digital Logic Mr. Burleson
Chapter 4 Gates and Circuits.
CS140 Lecture 02a: The Machinery of Computation: Circuits and Gates
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Agenda – 2/12/18 Questions? Readings: CSI 4, P
CS Chapter 3 (3A and ) Part 3 of 8
Boolean Logic Boolean Logic is considered to be the basic of digital electronics. We know that a computer’s most basic operation is based on digital electronics.
Logic Gates.
CS Chapter 3 (3A and ) – Part 2 of 5
Dr. Clincy Professor of CS
Chapter 4 Gates and Circuits.
Introductory Concepts
Copyright © Cengage Learning. All rights reserved.
Logic Gates AIM: To know the different types of logic gate
Chapter 3 – Describing Logic Circuits
Binary Logic and Gates COE 202 Digital Logic Design Dr. Aiman El-Maleh
What are Logic Gates?.
Presentation transcript:

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

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

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

Brief of Digital circuits

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

The Meaning of Logic Gates

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.

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.

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.

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.

How logic gates are relevant to computers

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.

Representation of Gates Logic diagrams Truth tables Boolean expressions

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

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

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

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

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 + 1 = 1 (read “1 or 1 equals 1”). 1.1 = 1 ( read 1 AND 1 equals 1 )

Activity #1 - Group Work

Types of Gates

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

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.

three basic gate functions NOT AND OR

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: https://logic.ly/lessons/

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

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.

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

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: https://logic.ly/lessons/

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

How AND Gate Work

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.

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: https://logic.ly/lessons/

How OR Gate Work

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.

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

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 0 0 0 0 1 1 1 0 1 1 1 0   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)) 0 0 1 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 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 X = A . B . C 44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 X = A + B + C Activity #2 - Group Work

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 0 0 0 0 1 1 1 0 1 1 1 0   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)) 0 0 1 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 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 X = A . B . C 44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 X = A + B + C Lab # 1 - Group Work

additional gates functions XOR NAND NOR XNOR

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

XOR Gate Representation Figure 4.4 Various representations of an XOR gate To illustrate how it works visually .. Check this link: https://logic.ly/lessons/

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: https://logic.ly/lessons/

How NAND Gate Work

How NOR Gate Work

XNOR The XNOR gate is essentially the opposite of the XOR. To illustrate how it works visually .. Check this link: https://logic.ly/lessons/

Gates with More Inputs

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: https://logic.ly/demo/

How NAND Gate Work With Two Input

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 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 X = A + B + C Activity #3 - Group Work

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 0 0 0 0 1 1 1 0 1 1 1 0   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)) 0 0 1 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 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 X = A . B . C 44. Draw and label the symbol for a three-input OR gate, then show its behavior with a truth table. 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 X = A + B + C Lab # 3 - Group Work

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)

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.

Universal Gates 1- NAND 2- NOR

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.

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

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

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

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

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

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.

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

Basic Gate Using NANDs

Basic Gate Using Nors

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.

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 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 X = A + B + C Activity #4 - Group Work

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.

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.

Conclusion

Conclusion