CS1Q Computer Systems Lecture 5 Simon Gay. Lecture 5CS1Q Computer Systems - Simon Gay2 Where we are Global computing: the Internet Networks and distributed.

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

Switching circuits Composed of switching elements called “gates” that implement logical blocks or switching expressions Positive logic convention (active.
Logic Gates.
Logic Gates.
CT455: Computer Organization Logic gate
Digital Electronics Lecture 2 Logic Gates. Lecture 2 outline Announcement:
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Chapter 2 Logic Circuits.
Basic Logical Operations (fascinating)
Hardware Implementations Gates and Circuits. Three Main Gates  AND  OR  NOT.
James Tam AND OR NOT NAND NOR XOR Basic logic operations (fascinating)
Logic Gate Level Combinational Circuits, Part 1. Circuits Circuit: collection of devices physically connected by wires to form a network Net can be: –
Boolean Algebra and Truth Table The mathematics associated with binary number system (or logic) is call Boolean: –“0” and “1”, or “False” and “True” –Calculation.
Lecture 3. Boolean Algebra, Logic Gates
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Digital Design.
Propositional Calculus Math Foundations of Computer Science.
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.
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:
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
CS1Q Computer Systems Lecture 9 Simon Gay. Lecture 9CS1Q Computer Systems - Simon Gay2 Addition We want to be able to do arithmetic on computers and therefore.
CS1Q Computer Systems Lecture 8
LOGIC GATES & TRUTH TABLE – Digital Circuit 1 Choopan Rattanapoka.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
CSC Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.
Binary Number System & Logic Operations. The focus of the last lecture was on the microprocessor During that lecture we learnt about the function of the.
Combinational Logic 1.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /05/2013 Lecture 4: Basics of Logic Design Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
CS1Q Computer Systems Lecture 7
CMP 100 Introduction to Computing Lecture Binary Numbers & Logic Operations.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Chapter-3: BOOLEAN ALGEBRA & LOGIC GATES Analysis and logical design.
Logic Gates. A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment,
CS1Q Computer Systems Lecture 8
CHAPTER 5 Combinational Logic Analysis
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
Minute Paper 4/4/04 Z=50+j86.7=100
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Digital Logic. Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Computer Architecture & Operations I
Computer Architecture & Operations I
Unit 1 Logical operators.
Basics of Logic gates - Part 1
Digital Logic.
Morgan Kaufmann Publishers
Logic Gates and Logic Circuits
Eng. Mai Z. Alyazji October, 2016
Logic Gates.
Logic Gates Benchmark Companies Inc PO Box Aurora CO
EI205 Lecture 5 Dianguang Ma Fall 2008.
Digital Signals Digital Signals have two basic states:
Basic Digital Logic Basic Gates
Fundamentals & Ethics of Information Systems IS 201
Boolean Algebra & Logic Circuits
Agenda – 2/12/18 Questions? Readings: CSI 4, P
Universal gates.
Logic Gates.
Logic Gates.
GCSE Computer Science – Logic Gates & Boolean Expressions
Chapter 4 Gates and Circuits.
Truth tables Mrs. Palmer.
Logic Gates By: Asst Lec. Besma Nazar Nadhem
What are Logic Gates?.
Agenda Lecture Content: Combinatorial Circuits Boolean Algebras
Presentation transcript:

CS1Q Computer Systems Lecture 5 Simon Gay

Lecture 5CS1Q Computer Systems - Simon Gay2 Where we are Global computing: the Internet Networks and distributed computing Application on a single computer Operating System Architecture Digital Logic Electronics Physics Working upwards within the digital logic level, in order to understand architecture in more detail

Lecture 5CS1Q Computer Systems - Simon Gay3 Processing Digital Information We’ll start with some fundamental operations on binary digits and work up to more complicated operations. If x and y are binary digits (either 0 or 1) then x AND y is a binary digit, defined by x AND y = 1 if x = 1 and y = 1 = 0 otherwise AND

Lecture 5CS1Q Computer Systems - Simon Gay4 The Truth Table for AND If we think of the binary values as true and false instead of 1 and 0 then AND has its ordinary meaning: x AND y is true if x is true and y is true A truth table makes the meaning explicit: xyx AND y xy fff ftf tff ttt True/false, high/low, 1/0 are all alternatives. We will usually stick to 1/0 in truth tables.

Lecture 5CS1Q Computer Systems - Simon Gay5 Diagrammatic Representation There is a conventional notation for diagrams in which the AND operation is represented by: x y x AND y To make it easier to draw diagrams, we might just use a labelled box instead: x y x AND y and2

Lecture 5CS1Q Computer Systems - Simon Gay6 OR If x and y are binary digits (either 0 or 1) then x OR y is a binary digit, defined by x OR y = 1 if x = 1 or y = 1, or both = 0 otherwise xyx OR y Truth table:Diagram: x y x OR y x y or2

Lecture 5CS1Q Computer Systems - Simon Gay7 Example: Majority Voting Imagine that three people have to vote either Yes (represented by 1) or No (represented by 0). The overall result is the majority decision. If x, y, z stand for the three votes, and r stands for the result, then we can write r = (x AND y) OR (y AND z) OR (z AND x) Diagrammatically: This can be viewed as a circuit diagram and implemented electronically. The components are then called logic gates.

Lecture 5CS1Q Computer Systems - Simon Gay8 Example: Majority Voting We can use a truth table to check that the circuit works. yxzbacedr The result r is 1 in the four cases when two of x, y, z are 1.

Lecture 5CS1Q Computer Systems - Simon Gay9 What We Have Defined We have defined a function with three boolean (truth value) arguments (inputs) and a boolean result (output). Mathematically, we have if B is the set {0,1}. The truth table (columns x, y, z, r) shows the result (an element of B) for each combination of inputs (each combination of inputs is an element of ). The truth table defines a subset of whose elements correspond to the rows: ((0,0,0),0), ((0,0,1),0), etc. It is a relation with attributes and B. For each element (x,y,z) of the relation contains exactly one tuple whose input attributes match (x,y,z). This property is what makes it into a function. The output attribute of this tuple is the result r.

Lecture 5CS1Q Computer Systems - Simon Gay10 Majority Voting in Ada We can make use of the logical operations to express the majority voting function in Ada. function Majority(x, y, z : Boolean) return Boolean is begin return (x and y) or (y and z) or (z and x); end Majority; This gives a flavour of hardware description languages, which are used in preference to circuit diagrams for complex designs.

Lecture 5CS1Q Computer Systems - Simon Gay11 NOT xNOT x It turns out that AND and OR are not sufficient to define all functions on binary digits. (Because, any function constructed from AND and OR must output 1 if all inputs are 1.) The missing ingredient is NOT. xNOT x x not Again, if we think in terms of truth values, NOT has its familiar meaning. A NOT gate is often called an inverter.

Lecture 5CS1Q Computer Systems - Simon Gay12 (AND or OR) and NOT By using AND, OR and NOT in combination, it is possible to define any desired function on binary numbers. We will see how to do this in a few lectures’ time. Perhaps surprisingly, we only need NOT and just one of AND and OR. Exercise: work out the truth table for the following circuit and check that it is equivalent to the OR function.

Lecture 5CS1Q Computer Systems - Simon Gay13 OR from AND and NOT xybacz

Lecture 5CS1Q Computer Systems - Simon Gay14 AND from OR and NOT xybacz Exercise: check that this circuit is equivalent to the AND function.

Lecture 5CS1Q Computer Systems - Simon Gay15 One Fundamental Operation Even more remarkably, it is possible to build up all functions from combinations of just one operation: the NAND operation. xyx NAND y x y x y nand2 NAND is short for NOT AND. We can check that x NAND y = NOT (x AND y)

Lecture 5CS1Q Computer Systems - Simon Gay16 NAND is Universal Assuming that we have NAND, we can define the other operations: NOT x = x NAND x x AND y = NOT (x NAND y) = (x NAND y) NAND (x NAND y) x OR y = (NOT x) NAND (NOT y) = (x NAND x) NAND (y NAND y) Exercise: check these equations by constructing truth tables. xx NAND x 0 1 xyx NAND y NOT(x NAND y)

Lecture 5CS1Q Computer Systems - Simon Gay17 Another Fundamental Operation The NOR operation is also sufficient for building all functions. xyx NOR y x y x y nand2 NOR is short for NOT OR. We can check that x NOR y = NOT (x OR y)

Lecture 5CS1Q Computer Systems - Simon Gay18 NOR is Universal Assuming that we have NOR, we can define the other operations: NOT x = x NOR x x OR y = NOT (x NOR y) = (x NOR y) NOR (x NOR y) x AND y = (NOT x) NOR (NOT y) = (x NOR x) NOR (y NOR y) Exercise: check these equations by constructing truth tables. xx NOR x 0 1 xyx NOR y NOT(x NOR y) Exercise: prove that NAND and NOR are the only universal operations.

Lecture 5CS1Q Computer Systems - Simon Gay19 XOR If x and y are binary digits thenx XOR y is a binary digit, defined by x XOR y = 1 if either x = 1 or y = 1, but not both = 0 otherwise xyx XOR y Truth table:Diagram: x y x XOR y x y xor2 XOR is exclusive or. OR is inclusive or.

Lecture 5CS1Q Computer Systems - Simon Gay20 Implication Implication is a logical operation although it is not used in digital circuits. x => y means “x implies y” or “if x then y” or “if x is true then y is true”. xyx => y false true falsetrue false true Example If 2+2=5 then the moon is made of cheese. If 2+2=5 then Glasgow is in Scotland. If Glasgow is in Scotland then 2+2=5. If Glasgow is in Scotland then 2+2=4. x => y is true if it is logically valid to deduce y from x. It is true in all cases except when x is true and y is false. Note: x => y does not mean that x causes y.