Introduction to Computer Science V 1 0 Topic


















- Slides: 18

Introduction to Computer Science V 1. 0 Topic 9: Digital Logic © NCC Education Limited

Digital Logic Topic 9 - 9. 2 Scope and Coverage This topic will cover: • • • Digital logic Truth tables Logic gates - AND - OR - NOT - NAND - NOR © NCC Education Limited

Digital Logic Topic 9 - 9. 3 Learning Objectives By the end of this topic, students will be able to: • • Explain what is meant by digital logic Understand the use of truth tables Understand the use of AND logic gates Understand the use of OR logic gates Understand the use of NOT logic gates Understand the use of NAND logic gates Understand the use of NOR logic gates © NCC Education Limited

Digital Logic Topic 9 - 9. 4 Terminology • Terminology will be explained in the lectures and tutorials on computer systems and computer hardware • You should make notes • Ask questions if you there is anything that you don’t understand © NCC Education Limited

Digital Logic Topic 9 - 9. 5 Digital Logic • • A logic circuit makes decisions – it receives two or more inputs and determines the output from the inputs This process is performed using digital logic, which is based on digital switches called gates A single binary digit, 1 or 0, can be used to represent true/on/high (1) or false/off/low (0) Let’s look at the example below: © NCC Education Limited

Digital Logic Topic 9 - 9. 6 Logic Gates • A logic gate is an electronic circuit in a device that enables a digital system to make a decision based the inputs • There are usually two inputs to the circuit and one output • Two digital signals are input • The gate compares the signals • The gate makes a decision • A new signal is output based on the decision • Input to and output from a gate must be one of two states: • 1 – also referred to as on or high • 0 - also referred to as off or low © NCC Education Limited

Digital Logic Topic 9 - 9. 7 Types of Logic Gates • Logic gates include: • AND • OR • NOT • NAND • NOR • Before we look at each type, let’s take a look at truth tables © NCC Education Limited

Digital Logic Topic 9 - 9. 8 Truth Tables • • • A truth table shows the logic rules of a logic gate It lists all combinations of input and the resulting output A and B represents two truth values: TRUE (1) or FALSE (0) The output C is TRUE only when both A is TRUE and B is TRUE The following truth table shows all the possible combinations of inputs A and B and the output C A B C • We will see that each type of logic gate False has a corresponding truth table False True True © NCC Education Limited

Digital Logic Topic 9 - 9. 9 AND Gate • An AND gate will give a high output only if all of the inputs are high • The standard symbol for an AND gate is shown below: • The corresponding truth table is: • A + B are input and the output is C • Output is always 0 except when two inputs are 1 A B C 0 0 1 1 1 © NCC Education Limited

Digital Logic Topic 9 - 9. 10 OR Gate • • An OR gate will give a high output if either of the inputs is high The standard symbol for an OR gate is shown below: • The corresponding truth table is: • A + B are input and the output is C • Output is always 1 except when two inputs are 0 A B C 0 0 1 1 1 0 1 1 © NCC Education Limited

Digital Logic Topic 9 - 9. 11 NOT Gate • • A NOT gate has only one input. It will give a high output if the input is low The standard symbol for a NOT gate is shown below: • The corresponding truth table is: A C 0 1 1 0 © NCC Education Limited

Digital Logic Topic 9 - 9. 12 NAND Gate • • • This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate The output of a NAND gate is high if the inputs are low The standard symbol for an NAND gate is shown below: A B C 0 0 1 1 1 0 © NCC Education Limited

Digital Logic Topic 9 - 9. 13 NOR Gate • • • Is a NOT-OR gate which is equal to an OR gate followed by a NOT gate The output of a NOR gate is high if the inputs are low The standard symbol for a NOR gate is shown below: A B C 0 0 1 0 1 0 0 1 1 0 © NCC Education Limited

Digital Logic Topic 9 - 9. 14 Summary of Logic Gates • The truth table below compares the logical functions of the two-input logic gates that we have discussed: A B AND OR NAND NOR 0 0 1 1 0 1 0 0 1 1 1 1 0 0 © NCC Education Limited

Digital Logic Topic 9 - 9. 15 Complex Logic Gates • • A combination of different logic gates can be used to produce a complex logic system in a device such as a burglar alarm There are three inputs and eight possible outputs: A B C D E Z 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 © NCC Education Limited

Digital Logic Topic 9 - 9. 16 Review of Lecture • In this lecture we have discussed: • What is meant by digital logic • The use of truth tables • The use of AND logic gates • The use of OR logic gates • The use of NOT logic gates • The use of NAND logic gates • The use of NOR logic gates © NCC Education Limited

Digital Logic Topic 9 - 9. 17 References What are the practical applications of logic gates? Published on the Quora website: https: //www. quora. com/What-are-the-practical-applications-oflogic-gates © NCC Education Limited

Digital Logic Topic 9 - 9. 18 Topic 9 – Digital Logic Any Questions? V 1. 0 www. nccedu. com © NCC Education Limited