August 2003 CIS102/LECTURE 9/FKS 1 Mathematics for Computing Lecture 9 LOGIC Chapter 3.

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Presented by: Ms. Maria Estrellita D. Hechanova, ECE
1 Combinational Logic Design&Analysis. 2 Introduction We have learned all the prerequisite material: – Truth tables and Boolean expressions describe functions.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. CHAPTER 1 SPEAKING MATHEMATICALLY SPEAKING MATHEMATICALLY.
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
1 Digital Logic
Section 10.3 Logic Gates.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
Propositional Calculus Math Foundations of Computer Science.
Function: Definition A function is a correspondence from a first set, called the domain, to a second set, called the range, such that each element in the.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Temperature Readings The equation to convert the temperature from degrees Fahrenheit to degrees Celsius is: c(x) = (x - 32) The equation to convert the.
Chapter 3 Functions Functions provide a means of expressing relationships between variables, which can be numbers or non-numerical objects.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
An ordered n-tuple is a set of n objects with an order associated with them. If n objects are represented by x 1, x 2,..., x n, then we write the ordered.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Temperature Readings The equation to convert the temperature from degrees Fahrenheit to degrees Celsius is: c(x) = (x - 32) The equation to convert the.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Part 2 – Sequential.
Module Code MA1032N: Logic Lecture for Week Autumn.
FUNCTIONS.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Functions Definition: A relation ‘ f ’ from set X to set Y is a function if each element in set X is mapped to exactly one element in set Y
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Chapter 5 – Relations and Functions. 5.1Cartesian Products and Relations Definition 5.1: For sets A, B  U, the Cartesian product, or cross product, of.
MAT 125 – Applied Calculus 2.1 Functions and Their Graphs.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
Mathematical Preliminaries
Lecture 4 Boolean Algebra. Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
FUNCTIONS FUNCTIONS DOMAIN: THE INPUT VALUES FOR A RELATION. USUALLY X INDEPENDENT VARIABLE RANGE: THE OUTPUT VALUES FOR A RELATION. USUALLY.
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
Discrete Mathematics Lecture # 17 Function. Relations and Functions  A function F from a set X to a set Y is a relation from X to Y that satisfies the.
CHAPTER 2 Boolean algebra and Logic gates
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Unit 2 Boolean Algebra.
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CSE15 Discrete Mathematics 02/15/17
Chapter 2 Sets and Functions.
Princess Sumaya University
Computer Architecture CST 250
Fundamentals & Ethics of Information Systems IS 201
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
Gates Type AND denoted by X.Y OR denoted by X + Y NOR denoted by X + Y
DESIGN OF SEQUENTIAL CIRCUITS
Copyright © Cengage Learning. All rights reserved.
From now on: Combinatorial Circuits:
Finite Automaton with output
Chapter5: Synchronous Sequential Logic – Part 3
Presentation transcript:

August 2003 CIS102/LECTURE 9/FKS 1 Mathematics for Computing Lecture 9 LOGIC Chapter 3

August 2003 CIS102/LECTURE 9/FKS Logic Gates NOT p ¬p¬p p AND q p  qp  q OR p  qp  q p q Figure 3.8 The value of the output (0 or 1 ) for each value, or combination of values, for input (s) can be derived from the logic tables for ¬p, p  q and p  q ( see Figure 3.1 and Figure 3.2) Designing logic networks The logic gates can also be concatenated to represent more complicated compound statements. The circuits so formed are called logic networks.

August 2003 CIS102/LECTURE 9/FKS 3 Example 3.12 Design a logic network that has two inputs p and q and output p  q NOT OR p q ¬ p  q Figure 3.9 Example 3.13 Devise a logic network with four inputs p, q, r, s and output (p  q )→ (r  s).

August 2003 CIS102/LECTURE 9/FKS 4 Figure 3.10 NOT OR p q AND OR r s x y z Suppose we denote the output of p  q by x and the output of r  s by y. Then the required output is x  y. The AND-gate gives output x for inputs p, q; the OR-gate gives the output y for inputs r, s; the network shown in Figure 3.9 gives output x  y, for inputs x and y. Concatenating these components gives the network shown in Figure 3.10, where the final output is z = (p  q) → (r  s)

August 2003 CIS102/LECTURE 9/FKS 5 Working from left to right across the diagram, and determining the output of each gate in turn, we get: 1.Output r = ¬ q 2. Output s = p  ¬ q 3. Output t = p  q 4. Output w = ( p  ¬ q)  ( p  q ) Hence the output of this network is ( p  ¬ q )  ( p  q ) Example 3.14 Determine the output of the logic network in Figure 3.11 Figure 3.11 NOT p q AND OR r s t w AND

August 2003 CIS102/LECTURE 9/FKS 6 By distributive law, we have : w = ( p  ¬ q )  ( p  q ) = p  ( ¬ q  q ) Now, (¬ q  q ) = ( q  ¬ q ) = T, by commutative law and the complement law. Thus, w = p  T = p From the table, we see that the column for the output w = ( p  ¬ q )  ( p  q ) is identical to the column for p. Hence, this network can be replaced by the input p alone and no input q or gates are necessary. Example 3.15 Use truth tables to simplify the final output w = ( p  ¬ q )  ( p  q ) in Figure p q ¬ qp  ¬ qp  qp  q(p  ¬ q)  (p  q) Example 3.16 Use the laws of logic to simplify the final output w = ( p  ¬ q )  ( p  q ).

August 2003 CIS102/LECTURE 9/FKS 7 Mathematics for Computing Chapter 4. Functions 4.1 Definition of a function  A function may be imagined as a machine that accepts various inputs and transforms each input into a uniquely determined image.  A function f is a set of ordered pairs (x,y) of real numbers such that to each allowable value of x, there corresponds one and only one value of y Example 4.1 A “machine” that accepts as inputs the family names of all SIM students on the database and outputs the initial letter of each family name is an example of a function.  For each family name (input), there is just one uniquely determined initial letter (output).  A convenient set containing all possible outputs is the set of all letters of alphabet and the set of actual outputs is some subset of this. In a function, it may happen that several different inputs all give the same output.

August 2003 CIS102/LECTURE 9/FKS 8 Example 4.2 The integer scores awarded in a test are converted to grades as shown in the table. Explain briefly that it defines a function Score Grade FDCBA The above table defines a function since given any input score, the table determines just one possible grade as output. ● The set of inputs for this function is the set of integers {0,1,2,3,…,100} and the set of outputs is { A,B,C,D,F}. ● The definition of a function has three parts: 1. a set of inputs; 2.a rule that determines the unique output corresponding to each input ; 3. a set containing all outputs. ● We usually denote the rule of a function by a single letter, such as f or g. But some common functions are denoted by a string such as log, exp, ABS.

August 2003 CIS102/LECTURE 9/FKS 9 Definition 4.1 Suppose we given two sets X and Y and a rule f such that given any element x ? X, f assigns to x a unique y ? Y. Then we call f a function of X into Y, written f : X → Y. We denote the unique element y assigned to x by y = f (x). The set X ( the set of inputs) is called the domain of the function and the set Y (containing the outputs ) is called the co-domain of the function. The set of actual outputs is a subset of Y called the range of the function. Thus range of f = {f (x) : x  X} Definition 4.2 Let f : X → Y be a function of X into Y. We call f (x) the image of x under f and we called x a pre-image ( or ancestor) of f (x). We say that f maps x onto f (x). Example 4.3 Suppose S is a set of all 3-bit binary strings. Let SUM: S → Z be the rule defined by SUM (s) = the number of ones in s. Then SUM accepts any 3-bit binary string as input and outputs the number of ones in the string. The rule SUM is a function with domain S and co-domain Z. Determine (a) the image of the string 010 and 111; (b) the pre-image of the outputs 0, 2, and 5; (c) the range of SUM

August 2003 CIS102/LECTURE 9/FKS 10 (a) The image of 010 is the number of ones in the string 010, which is 1. Similarly, the image of 111 is the number of ones in the string 111, which is 3. (b) The only 3-bit string s containing no ones is 000. Hence the pre-image of 0 is 000. There are three 3-bit strings containing 2 ones, and so 2 has the set of pre-images {110,101,011}.There is no 3-bit string containing 5 ones, and hence the set of pre- image of 5 is Ø. (c) The outputs of this function with the given set of inputs are 0, 1, 2, 3. Hence the range of SUM is the set {0,1,2,3}.