Computer Architecture I: Digital Design Dr. Robert D. Kent Lecture 2a Boolean Algebra & Calculus, Basic Gates, Digital Logic.

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Logical Systems Synthesis.
Chapter 2 Logic Circuits.
Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 4 Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty.
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE 331 – Digital System Design Boolean Algebra (Lecture #3) The slides included herein were taken from the materials accompanying Fundamentals of Logic.
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.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.
EECC341 - Shaaban #1 Lec # 5 Winter Switching Algebra: Principle of Duality Any theorem or identity in switching algebra remains true if.
Boolean Algebra and Logic Gates
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Logic Gate Level Combinational Circuits, Part 1. Circuits Circuit: collection of devices physically connected by wires to form a network Net can be: –
Lecture 3. Boolean Algebra, Logic Gates
Chapter 2: Boolean Algebra and Logic Functions
Boolean Algebra Computer Organization 1 © McQuain Boolean Algebra A Boolean algebra is a set B of values together with: -two binary operations,
1 Why study Boolean Algebra? 4 It is highly desirable to find the simplest circuit implementation (logic) with the smallest number of gates or wires. We.
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
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
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
1 Representation of Logic Circuits EE 208 – Logic Design Chapter 2 Sohaib Majzoub.
Combinational Logic 1.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Boolean Algebra 1854, George Boole created a two valued algebraic system which is now called Boolean algebra. 1938, Claude Shannon adapted Boolean algebra.
Module 4.  Boolean Algebra is used to simplify the design of digital logic circuits.  The design simplification are based on: Postulates of Boolean.
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.
June 11, 2002© Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn.
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.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
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.
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Lecture 18: Boolean Algebra Boolean Functions. w = Chris is allowed to watch television x = Chris's homework is finished y = it is a school night z =
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
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
Boolean Algebra & Logic Gates
Lecture 4 Topics Boolean Algebra Huntington’s Postulates Truth Tables
ECE 301 – Digital Electronics
Chapter 11 (Part 1): Boolean Algebra
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Chapter 2: Boolean Algebra and Logic Functions
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CS 105 Digital Logic Design
Princess Sumaya University
Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn how to how use Boolean algebra to.
ECE 331 – Digital System Design
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
CSE 311 Foundations of Computing I
Propositional Calculus: Boolean Algebra and Simplification
Boolean Algebra.
Boolean Algebra.
Lecture 14: Boolean Algebra
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
Combinatorial Logic Circuit
Lecture 4 Topics Boolean Algebra Huntington’s Postulates Truth Tables
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
Boolean Algebra Introduction CSCI 240
Chapter 2 Introduction to Logic Circuits
Presentation transcript:

Computer Architecture I: Digital Design Dr. Robert D. Kent Lecture 2a Boolean Algebra & Calculus, Basic Gates, Digital Logic

Boolean Logic First developed by George Boole (1850’s) in a study of 2- valued sets and their properties. He aimed to model intelligence and knowledge. Later realized to be of fundamental importance in the design and construction of digital logic devices, namely the computer (Claude Shannon ’s). The discovery of the transistor (npn and pnp junctions) and other solid-state microelectronic components (Josephson, Bardeen, Cooper et al) led to manufacture of basic gate devices that realized the various primitive logic operations –not, and, or, xor, nand, nor, xnor

Boolean Logic We will cover the following points, in order: –Definitions and Mathematics –Review of basic operations and their truth tables –Boolean postulates –Boolean expressions –Algebraic Simplification –Gate (diagrammatic) representations for circuit layout & design

Boolean Logic We emphasize that we are studying –two-valued logic bits (0’s and 1’s) –the operations that act on bits –the calculus for manipulating the operators and expressions formed from them and the data being operated on

Boolean Algebra - Mathematics A Boolean algebra is a system consisting of a set of elements, B, two binary operators (+ and ), parentheses to indicate the nested order of evaluation and an = operator to perform assignment of an expression. The algebra must further obey six fundamental postulates, or axioms: All theorems to be derived depend on the postulates. –Postulates, or axioms, are the “ground rules” that underly everything there is to say (or derive) about a mathematical system –Theorems are “practical applications” of postulates – theorems can be proven based on the postulates

Boolean Algebra - Mathematics Postulates: –P6: Existence There exist at least two elements x,y in B such that x ≠ y –P1: Closure: There exists x,y in B such that two independent operations,. (dot) and + (plus) are defined:x + y in Bx. y in B –P2: Identity: There exist identity elements 0,1 in B relative to the operations + and., such that for every x in B: 0 + x = x + 0 = x1. x = x. 1 = x –P3: Commutativity: The operations + and. are commutative for all x,y in B: x + y = y + xx. y = y. x

Boolean Algebra - Mathematics Postulates: (Continued) –P4: Distributivity: Each operation + and. is distributive over the other; that is, for all x,y,z in B: x. ( y + z ) = x. y + x. Z x + ( y. z ) = ( x + y ). ( x + z ) –P5: Complementation: For every element x in B there exists an element ~x, called the complement of x, satisfying: x + ~x = 1x. ~x = 0 Very useful Theorem: Property of Idempotency: x + x = xx. x = x

Boolean Algebra - Mathematics The various postulates satisfy a principle of duality, in that you obtain one form of postulate from the corresponding other one by interchanging the operations + and, and also the identity elements: Postulate Dual Postulate x + y x y 0 + x = x + 0 = x1 x = x 1 = x x + y = y + xx y = y x x + ( y z ) = ( x + y ) ( x + z ) x ( y + z ) = ( x y ) +( x z ) x + x = 1x x = 0 THM: x + x = xx x = x

Basic operations There are seven (7) commonly used Boolean, or logic, operations: not and nand ornor eorenor (xor) (xnor)

Boolean Algebraic Representation It will be increasingly inconvenient to write out the Boolean operators using words. We therefore adopt the notations: AlgebraicWord form A ( A’ )not A AB (A B)A and B A + BA or B A + BA xor B A BA nand B A + BA nor B A + BA xnor B

Boolean Algebraic Representation It will be increasingly inconvenient to write out the Boolean operators using words. We therefore adopt the notations: AlgebraicWord form A ( A’ )not A AB (A B)A and B A + BA or B A + BA xor B A BA nand B A + BA nor B A + BA xnor B

Boolean Algebraic Representation A~A (A’) A.BB=01 A= A+BB=01 A= (A+B)’B=01 A= (A.B)’B=01 A= A x BB=01 A= (AxB)’B=01 A= Truth tables for the fundamental logic operations

Theorems & Proof Techniques The circuits inside a computer involve a huge number (millions to billions) of individual data bits, each of which can provide input to an operation. –To construct truth tables for such complex circuits is clearly impractical, if not impossible, given the huge number of variable bits. –Further, to prove that a circuit design is correct, or to simplify the expression of a circuit using truth tables is also clearly impractical.

Theorems & Proof Techniques The methods of the Boolean Algebra, namely its calculus, provide general and powerful techniques for –establishing the correctness of derived equivalent expressions for circuits –simplifying the expressions to a more optimal form optimality, here, refers to both simplicity and elegance of expression and provision of more efficient execution in hardware.

Theorems & Proof Techniques The cornerstones of Boolean Calculus are: Axioms Algebraic representation Theorems … which lead to more complicated and powerful theorems. Proofs are established through the application and re-application of the prior axioms and theorems, usually also based on the clever use and manipulation of the algebraic representation.

Theorems & Proof Techniques REMEMBER! Mathematical proof is a formal and rigorous technique that must be practiced and studied seriously in order to develop into a natural and faithful tool. This is not just a hardware or logic design issue - it also appears in –formal software engineering –proofs of algorithmic correctness –artificial intelligence –genetic algorithms –… and many other places in computer science!

Formal Proofs: Theorem 1 T1: The element X’ is uniquely determined by X, as in P5. Proof: Assume there are two elements X 1 ’ and X 2 ’, both determined by X. (Note: there can only be two in B) –it follows from P5 that X + X 1 ’ = 1 X + X 2 ’ = 1 X X 1 ’ = 0 X X 2 ’ = 0 The following steps apply: X 1 ’ = X 1 ’.1= X 2 ’.X + X 2 ’. X 1 ’ = X 1 ’.(X+X 2 ’) = X 2 ’.(X + X 1 ’) = X 1 ’.X + X 1 ’. X 2 ’ = X 2 ’.1 = X. X 1 ’ + X 1 ’. X 2 ’ = X 2 ’ = 0 + X 1 ’. X 2 ’ = X. X 2 ’ + X 1 ’. X 2 ’So: X 1 ’ = X 2 ’ QED! Since the original assumption was that X 1 ’ and X 2 ’ were different, we have proven the contradiction, namely that both are identical and therefore X’ is uniquely determined by X.

Formal Proofs: Theorem 2 T2: For each X in B: (a)X + 1 = 1 (b)X. 0 = 0 Proof of (a): X + 1= 1. (X + 1) = (X + X’). (X + 1) = X + (X’. 1) = X + X’ = 1 QED! Proof of (b): X. 0= 0 + (X. 0) = (X. X’) + (X. 0) = X. (X’ + 0) = X. X’ = 0 QED! Note the duality in the two proofs. Change + to. and 1’s to 0’s.

Formal Proofs: Idempotent Theorem Idempotent Theorem: For each X in B: (a)X + X = X (b)X. X = X Proof of (a): X + X= (X + X). 1 = (X + X). (X + X’) = X + (X. X’) = X + 0 = X QED! Proof of (b): By duality.

Formal Proofs: Involution Theorem Involution Theorem (Double Negation) For each X in B, X’’ = X. Proof: Let X’ be the complement of X, and X’’ be the complement of X’. It follows that: X + X’= 1X. X’ = 0 X’ + X’’ = 1X’. X’’ = 0 Then: X’’ = X’’ + 0 = X’’ + X. X’ = (X’’ + X). (X’’ + X’) = (X’’ + X). 1 = (X’’ + X). (X’ + X) = X + (X’. X’’) = X + 0 = X QED!

Formal Proofs: Absorption Theorem Absorption Theorem: For every X, Y in B: (a)X + X. Y = X (b)X. (X + Y) = X Proof of (a): X + X. Y= X. 1 + X. Y = X. (1 + Y) = X. 1 = X QED! Proof of (b): By duality.

Formal Proofs: Collapse Theorem Collapse Theorem: For every X, Y in B: (a)X + X’. Y = X + Y (b)X. (X’ + Y) = X. Y Proof of (a): X + X’. Y= (X + X’). (X + Y) = 1. (X + Y) = (X + Y) QED! Proof of (b): By duality.

Formal Proofs: De Morgan’s Theorems De Morgan’s Theorems: For every X, Y in B: (a)(X + Y)’ = X’. Y’ (b) (X. Y)’ = X’ + Y’ Proof of (a): Letting A=(X+Y) and B=X’.Y’, then (a) states: A’ = B. If true, then it must follow that: A + A’ = A + B = (X+Y) + (X’.Y’) = [(X+Y) + X’]. [(X+Y) + Y’] = [(X+X’) + Y]. [(Y+Y’) + X] = [1 + Y]. [1 + X] = 1. 1 = 1 Self-consistent! QED Proof of (b): By duality.

Formal Proofs versus Truth Tables All of the previous theorems can be proven using the technique of proof by exhaustion, based on the use of truth tables. By listing all possible combinations of values (0 and 1) for each variable, its complement and all sub-expressions, one proceeds toward the goal of establishing that each possible expression value on the right and left sides of the theorem relation are equivalent. –This is referred to as perfect induction.

Boolean Expressions In digital design, circuits are expressed as formulae. Examples: f(x,y,z) = (x’ + y) z f(x,y) = xy’ + x’y In general, f(x) is a multi-nomial of degree one in each of the element variables x k in x. The usual goal is to express f(x) in the simplest form possible. –Such forms typically involve the minimum number of literals (i.e. variable elements, including complements and repeated elements) –They represent hardware designs that are partially or fully optimal. 3 literals 4 literals variables

Boolean Expressions When the expression of f is of the form: f = A + BC + DEF it is called a Sum of Products, or Disjunctive Normal Form (DNF). When the expression of f is of the form: f = (A). (B + D). (D + E + F) it is called a Product of Sums, or Conjunctive Normal Form (CNF). SOP POS

Boolean Expressions - Canonical Forms When the SOP expression of F(A,B,C) involves terms in which all variables appear (some or all may be complemented), it is called a Sum of Minterms: F(A,B,C) = ABC + A’BC + AB’C’ a minterm has all 3 variables When the POS expression of f involves terms in which all variables appear (some or all may be complemented), it is called a Sum of Maxterms: F = (A+B+C). (A’+B+C). (A+B’+C’) a maxterm has all 3 variables If f(x) depends on N variables, the maximum number of terms it can have is 2 N.

Boolean Expressions - Canonical Forms It is usually the case that F(x) is not given a priori. Rather, its boolean value is given for each specific set of x values. These are conveniently expressed in a truth table, as in: K X Y Z F K The row index value is just the decimal equivalent to the binary sequence of variable values in each row.

Boolean Expressions - Canonical Forms It is usually the case that f(x) is not given a priori. Rather, its boolean value is given for each specific set of x values. These are conveniently expressed in a truth table. Example: K X Y Z F K The minterm canonical form is obtained by collecting all minterms for which F K = 1, namely: F = X’Y’Z + X’YZ + XY’Z’ Note: We write the variable name itself when its corresponding entry in the table is 1 - otherwise, we write the complement of the variable.

Boolean Expressions - Canonical Forms It is usually the case that f(x) is not given a priori. Rather, its boolean value is given for each specific set of x values. These are conveniently expressed in a truth table. Example: K X Y Z F K The minterm canonical form is obtained by collecting all minterms for which F K = 1, namely: F = X’Y’Z + X’YZ + XY’Z’ = SUM m(1,3,4) This shorthand notation is often useful. Note that the row values listed in brackets are the decimal equivalents to the binary sequence of variable values.

Boolean Expressions - Canonical Forms It is usually the case that f(x) is not given a priori. Rather, its boolean value is given for each specific set of x values. These are conveniently expressed in a truth table. Example: Maxterm Expression K X Y Z F K The maxterm canonical form is obtained by collecting all maxterms for which F K = 0, namely: F = (X+Y+Z)(X+Y’+Z)(X’+Y+Z’) (X’+Y’+Z) (X’+Y’+Z’)

Boolean Expressions - Canonical Forms It is usually the case that f(x) is not given a priori. Rather, its boolean value is given for each specific set of x values. These are conveniently expressed in a truth table. Example: K X Y Z F K The maxterm canonical form is obtained by collecting all maxterms for which F K = 0, namely: F = (X+Y+Z)(X+Y’+Z)(X’+Y+Z’) (X’+Y’+Z) (X’+Y’+Z’) = PROD M(0,2,5,6,7)SHORTHAND NOTATION! In mathematics we encounter SUM and PRODuct of terms and we use the notations: SUM F K F K PROD F K F K Greek capital sigma Greek capital pi

Algebraic Simplification Algebraic simplification is usually applied to canonical minterm and maxterm expressions. The number of individual terms and variable combinations can be minimized in many cases. The power of algebraic simplification is quite limited and we will need to replace these techniques by other, even more powerful techniques.

Gate Representations Gate (diagrammatic) representations are used for circuit layout & design. These gates, or logic devices, are manufactured and used to construct actual microelectronic circuits, such as memories, ALU’s, CU’s, CPU’s, buses and so on. Transistor types: (a) NPN, and (b) PNP with base (B), collector (C) and emitter (E) wires.

Gate Representations Each logic operation has its own gate diagram and truth table: not (inverter) and / nand or / nor xor / xnor XX XYXY XYXY XYXY XYXY XYXY XYXY XY X+Y X Y X+Y X Y

Gate Representations Manufacturing of gate level logic devices sometimes benefits the lower cost of production of certain types of gates –nand, nor A very powerful property of Boolean Algebra is that all of the basic gate types (boolean operations) can be expressed in terms of just one specific gate –nand, nor This implies that an entire computer (except for a few items!) can be constructed from a single gate type. Although true in principle, there are many reasons why a variety of gate types are actually used.

Gate Representations Theorem: For each X, Y in B, X + Y = (X. Y’) + (X’. Y) In words, X xor Y = ( X and ( not Y ) ) or ( ( not X ) and Y ) And, as an equivalent circuit, XYXY X Y X XY’ Y X’Y (XY’)+(X’Y) Y’ X’

Gate Representations All of the previous theorems can also be re-developed using only the nor gate as the fundamentally primitive gate type. In principle, all gates can be represented in terms of any one gate, with the exception of the not (inverter/complementer) –You cannot construct a binary operator from a purely unary one.

Gate Representations Example: Express the Inverter (complementer) using only a NAND gate Use the idempotency relationship, namely: X = X.X Now, since the complement of X is just X’, it follows that X’ = (X.X)’ = not( X and X) = X nand X In diagrammatic form: X X’

Gate Representations Example: Express the Inverter (complementer) using only a NOR gate Once again, use the idempotency relationship, namely: X = X + X Now, since the complement of X is just X’, it follows that X’ = (X+X)’ = not( X or X) = X nor X In diagrammatic form: X X’

Gate Representations The circle associated with logic gates corresponds to an inversion (complementation) operation By moving the position of the circle(s), one can often achieve simple results Example: X’’ = (X’ ) ‘ = X X X’ XX

Gate Representations Example: De Morgan’s Theorem (X+Y)’ = (X’).(Y’) X (X+Y)’ Y X X’ (X’).(Y’) Y Y’ By manipulating the circles (moving them along lines and through gates) one can often achieve simplified, or alternative, expressions.

Summary We have considered the Boolean Algebra –formal mathematical definition –algebraic representation (0 and 1) –postulates –theorems –formal proof techniques –Boolean expressions SOP and POS forms minterms and maxterms –Gate diagrams for circuit logic We will now continue to study algebraic simplification, followed by general reduction techniques for simplifying complex boolean expressions.