CS2100 Computer Organisation

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

CS2100 Computer Organisation
Logical Systems Synthesis.
Chapter 2 Logic Circuits.
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
CS1104: Computer Organisation Lecture 3: Boolean Algebra
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Digital Design.
Chapter 2: Boolean Algebra and Logic Functions
CHAPTER 2 Boolean Algebra
CS1104: Computer Organisation School of Computing National University of Singapore.
Boolean Algebra – I. Outline  Introduction  Digital circuits  Boolean Algebra  Two-Valued Boolean Algebra  Boolean Algebra Postulates  Precedence.
IKI a-Boolean Algebra Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes at UIUC,
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
ECE 331 – Digital System Design
Chapter 4 Combinational Logic Design Principles. Overview Objectives -Define combinational logic circuit -Analysis of logic circuits (to describe what.
CT455: Computer Organization Boolean Algebra
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
LOGIC GATES & BOOLEAN ALGEBRA
1 Boolean Algebra  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
Chap 2. Combinational Logic Circuits
Discrete Mathematics CS 2610 September Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B.
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
Boolean Algebra – II. Outline  Basic Theorems of Boolean Algebra  Boolean Functions  Complement of Functions  Standard Forms.
A. Abhari CPS2131 Chapter 2: Boolean Algebra and Logic Gates Topics in this Chapter: Boolean Algebra Boolean Functions Boolean Function Simplification.
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.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
Logic Circuits Lecture 3 By Amr Al-Awamry. Basic Definitions Binary Operators  AND z = x y = x yz=1 if x=1 AND y=1  OR z = x + y z=1 if x=1 OR y=1 
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
Boolean Algebra. BOOLEAN ALGEBRA Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0).
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
CHAPTER 2 Boolean algebra and Logic gates
CS2100 Computer Organisation
Morgan Kaufmann Publishers
Chapter 2: Boolean Algebra and Logic Functions
Unit 2 Boolean Algebra.
Computer Organisation
CS2100 Computer Organisation
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CS 105 Digital Logic Design
CHAPTER 2 Boolean Algebra
CHAPTER 2 Boolean Algebra This chapter in the book includes:
Princess Sumaya University
Boolean Algebra – Part 1 ECEn 224.
SLIDES FOR CHAPTER 2 BOOLEAN ALGEBRA
FIGURES FOR CHAPTER 2 BOOLEAN ALGEBRA
ECE 331 – Digital System Design
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Lecture 3: Boolean Algebra
17-Nov-18 Logic Algebra 1 Combinational logic.
Boolean Algebra.
Lecture 4 Sums of Product Circuits Simplification
Boolean Algebra.
Lecture 14: Boolean Algebra
Chapter 2 Boolean Algebra and Logic Gate
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
January 19 W’05 Yutao He 4532B Boelter Hall CSM51A/EEM16-Sec.1 W’05
Chapter 2 Introduction to Logic Circuits
COMS 361 Computer Organization
From now on: Combinatorial Circuits:
Analysis of Logic Circuits Example 1
Chapter 4 Combinational Logic Design Principles. Overview Objectives -Define combinational logic circuit -Analysis of logic circuits (to describe what.
Presentation transcript:

CS2100 Computer Organisation http://www.comp.nus.edu.sg/~cs2100/ Boolean Algebra (AY2016/7 Semester 2)

ROAD MAP Number systems Boolean algebra Logic gates and circuits Simplification Combinational circuits Sequential circuits Assembly language Performance The processor: Datapath and control Pipelining Memory hierarchy: Cache Input/output Preparation: 2 weeks Logic Design: 2 weeks Computer Organisation CS2100 Boolean Algebra

CHECK LIST Have you done the Quick Review Questions for Chapter 2 Number Systems? Have you attempted the Self-Assessment Exercise #1 on IVLE Assessment? Have you clarified your doubts on IVLE forum? Ready to do a pop quiz? CS2100 Boolean Algebra

BOOLEAN ALGEBRA Read up DLD for details! Boolean Algebra Precedence of Operators Truth Table Duality Basic Theorems Complement of Functions Standard Forms Minterms and Maxterms Canonical Forms Read up DLD for details! CS2100 Boolean Algebra

DIGITAL CIRCUITS (1/2) Two voltage levels High, true, 1, asserted Low, false, 0, deasserted A digital watch Signals in digital circuit High Low Signals in analog circuit CS2100 Boolean Algebra

DIGITAL CIRCUITS (2/2) Advantages of digital circuits over analog circuits More reliable (simpler circuits, less noise-prone) Specified accuracy (determinable) Abstraction can be applied using simple mathematical model – Boolean Algebra Ease design, analysis and simplification of digital circuit – Digital Logic Design CS2100 Boolean Algebra

TYPES OF LOGIC BLOCKS Combinational: no memory, output depends solely on the input Gates Decoders, multiplexers Adders, multipliers Sequential: with memory, output depends on both input and current state Counters, registers Memories CS2100 Boolean Algebra

BOOLEAN ALGEBRA Boolean values: Connectives Truth tables Logic gates True (T or 1) False (F or 0) Connectives Conjunction (AND) A  B; A  B Disjunction (OR) A + B; A  B Negation (NOT) ; A; A' Truth tables A B A  B 1 A B A + B 1 A A' 1 Logic gates A B AB A A' A B A+B CS2100 Boolean Algebra

AND (∙) Do write the AND operator ∙ (instead of omitting it) Example: Write a∙b instead of ab Why? Writing ab could mean that it is a 2-bit value. CS2100 Boolean Algebra

LAWS OF BOOLEAN ALGEBRA Identity laws A + 0 = 0 + A = A A  1 = 1  A = A Inverse/complement laws A + A' = 1 A  A' = 0 Commutative laws A + B = B + A A  B = B  A Associative laws A + (B + C) = (A + B) + C A  (B  C) = (A  B)  C Distributive laws A  (B + C) = (A  B) + (A  C) A + (B  C) = (A + B)  (A + C) CS2100 Boolean Algebra

PRECEDENCE OF OPERATORS Precedence from highest to lowest Not (') And () Or (+) Examples: A  B + C = (A  B) + C X + Y' = X + (Y') P + Q'  R = P + ((Q')  R) Use parenthesis to overwrite precedence. Examples: A  (B + C) [ Without parenthesis: A  B + C ] (P + Q)'  R [ Without parenthesis: P + Q'  R ] CS2100 Boolean Algebra

TRUTH TABLE Provide a listing of every possible combination of inputs and its corresponding outputs. Inputs are usually listed in binary sequence. Example Truth table with 3 inputs x, y, z and 2 outputs x y z y + z x  (y + z) 1 CS2100 Boolean Algebra

PROOF USING TRUTH TABLE Prove: x  (y + z) = (x  y) + (x  z) Construct truth table for LHS and RHS x y z y + z x  (y + z) x  y x  z (x  y) + (x  z) 1 Check that column for LHS = column for RHS CS2100 Boolean Algebra 

QUICK REVIEW QUESTIONS (1) DLD page 59 Question 3-1. CS2100 Boolean Algebra

DUALITY If the AND/OR operators and identity elements 0/1 in a Boolean equation are interchanged, it remains valid Example: The dual equation of a+(bc)=(a+b)(a+c) is a(b+c)=(ab)+(ac) Duality gives free theorems – “two for the price of one”. You prove one theorem and the other comes for free! Examples: If (x+y+z)' = x'y'z' is valid, then its dual is also valid: (xyz)' = x'+y'+z' If x+1 = 1 is valid, then its dual is also valid: x0 = 0 CS2100 Boolean Algebra

BASIC THEOREMS Idempotency One element / Zero element Involution X + X = X X  X = X One element / Zero element X + 1 = 1 X  0 = 0 Involution ( X' )' = X Absorption X + XY = X X(X + Y) = X Absorption (variant) X + X'Y = X + Y X(X' + Y) = XY DeMorgans’ (can be generalised to more than 2 variables) (X + Y)' = X'  Y' (X  Y)' = X' + Y' Concensus XY + X'Z + YZ = XY + X'Z (X+Y)(X'+Z)(Y+Z) = (X+Y)(X'+Z) CS2100 Boolean Algebra

PROVING A THEOREM Theorems can be proved using truth table, or by algebraic manipulation using other theorems/laws. Example: Prove absorption theorem X + XY = X X + XY = X1 + XY (by identity) = X(1+Y) (by distributivity) = X(Y+1) (by commutativity) = X1 (by one element) = X (by identity) By duality, we can also cite (without proof) that X(X+Y) = X CS2100 Boolean Algebra

BOOLEAN FUNCTIONS Examples of Boolean functions (logic equations): F1(x,y,z) = xyz' F2(x,y,z) = x + y'z F3(x,y,z) = x'y'z + x'yz + xy' F4(x,y,z) = xy' + x'z x y z F1 F2 F3 F4 1 x y z F1 F2 F3 F4 1 From the truth table, F3 = F4. Can you prove F3 = F4 by using Boolean Algebra? CS2100 Boolean Algebra 

COMPLEMENT FUNCTION Given a Boolean function F, the complement of F, denoted as F', is obtained by interchanging 1 with 0 in the function’s output values. Example: F1 = xyz' What is F1' ? F1' = (xyz')' = x' + y' + (z')' (DeMorgan’s) = x' + y' + z (Involution) x y z F1 F1' 1 x y z F1 F1' 1 CS2100 Boolean Algebra 

STANDARD FORMS (1/2) Certain types of Boolean expressions lead to circuits that are desirable from implementation viewpoint. Two standard forms: Sum-of-Products Product-of-Sums Literals A Boolean variable on its own or in its complemented form Examples: x, x', y, y' Product term A single literal or a logical product (AND) of several literals Examples: x, xyz', A'B, AB, dg'vw CS2100 Boolean Algebra

STANDARD FORMS (2/2) Sum term Sum-of-Products (SOP) expression A single literal or a logical sum (OR) of several literals Examples: x, x+y+z', A'+B, A+B, c+d+h'+j Sum-of-Products (SOP) expression A product term or a logical sum (OR) of several product terms Examples: x, x + yz', xy' + x'yz, AB + A'B', A + B'C + AC' + CD Product-of-Sums (POS) expression A sum term or a logical product (AND) of several sum terms Examples: x, x(y+z'), (x+y')(x'+y+z), (A+B)(A'+B'), (A+B+C)D'(B'+D+E') Every Boolean expression can be expressed in SOP or POS. CS2100 Boolean Algebra

DO IT YOURSELF Put the right ticks in the following table.       SOP expr: A product term or a logical sum (OR) of several product terms. POS expr: A sum term or a logical product (AND) of several sum terms. Put the right ticks in the following table. Expression SOP? POS? X'∙Y + X∙Y' + X∙Y∙Z (X+Y')∙(X'+Y)∙(X'+Z') X' + Y + Z X∙(W' + Y∙Z) X∙Y∙Z' W∙X'∙Y + V∙(X∙Z + W')             CS2100 Boolean Algebra 

QUICK REVIEW QUESTIONS (2) DLD page 59 Questions 3-2 to 3-5. CS2100 Boolean Algebra

MINTERMS & MAXTERMS (1/2) A minterm of n variables is a product term that contains n literals from all the variables. Example: On 2 variables x and y, the minterms are: x'∙y', x'∙y, x∙y' and x∙y A maxterm of n variables is a sum term that contains n literals from all the variables. Example: On 2 variables x and y, the maxterms are: x'+y', x'+y, x+y' and x+y In general, with n variables we have 2n minterms and 2n maxterms. CS2100 Boolean Algebra

MINTERMS & MAXTERMS (2/2) The minterms and maxterms on 2 variables are denoted by m0 to m3 and M0 to M3 respectively. x y Minterms Maxterms Term Notation x'∙y' m0 x+y M0 1 x'∙y m1 x+y' M1 x∙y' m2 x'+y M2 x∙y m3 x'+y' M3 Each minterm is the complement of the corresponding maxterm Example: m2 = x∙y' m2' = ( x∙y' )' = x' + ( y' )' = x' + y = M2 CS2100 Boolean Algebra

CANONICAL FORMS Canonical/normal form: a unique form of representation. Sum-of-minterms = Canonical sum-of-products Product-of-maxterms = Canonical product-of-sums CS2100 Boolean Algebra

SUM-OF-MINTERMS Given a truth table, example: y z F1 F2 F3 1 F2 = x'∙y'∙z + x∙y'∙z' + x∙y'∙z + x∙y∙z' + x∙y∙z = m1 + m4 + m5 + m6 + m7 = Sm(1,4,5,6,7) or Sm(1,4 – 7) Obtain sum-of-minterms expression by gathering the minterms of the function (where output is 1). F1 = x∙y∙z' = m6 F3 = x'∙y'∙z + x'∙y∙z + x∙y'∙z' + x∙y'∙z = m1 + m3 + m4 + m5 = Sm(1,3,4,5) or Sm(1,3 – 5) CS2100 Boolean Algebra 

PRODUCT-OF-MAXTERMS Given a truth table, example: y z F1 F2 F3 1 F2 = (x+y+z) ∙ (x+y'+z) ∙ (x+y'+z') = M0 ∙ M2 ∙ M3 = PM(0,2,3) Obtain product-of-maxterms expression by gathering the maxterms of the function (where output is 0). F3 = (x+y+z) ∙ (x+y'+z) ∙ (x'+y'+z) ∙ (x'+y'+z') = M0 ∙ M2 ∙ M6 ∙ M7 = PM(0,2,6,7) CS2100 Boolean Algebra 

CONVERSION We can convert between sum-of-minterms and product-of-maxterms easily Example: F2 = Sm(1,4,5,6,7) = PM(0,2,3) Why? See F2' in truth table. x y z F2 F2' 1 F2' = m0 + m2 + m3 Therefore, F2 = (m0 + m2 + m3)' = m0' ∙ m2' ∙ m3' (by DeMorgan’s) = M0 ∙ M2 ∙ M3 (as mx' = Mx) CS2100 Boolean Algebra

READING ASSIGNMENT Conversion of Standard Forms Read up DLD section 3.4, pg 57 – 58. CS2100 Boolean Algebra

QUICK REVIEW QUESTIONS (3) DLD pages 60 - 61 Questions 3-6 to 3-13. CS2100 Boolean Algebra

END CS2100 Boolean Algebra