Unit 8A Computer Organization. Boolean Logic and Gates

Similar documents
Computer Organization: Boolean Logic

Boolean Algebra, Gates and Circuits

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

Chapter 2 Combinational Logic Circuits

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Chapter 2: Switching Algebra and Logic Circuits

Chapter 2 Combinational Logic Circuits

Logic Design. Chapter 2: Introduction to Logic Circuits

Implementation of Boolean Logic by Digital Circuits

CS 226: Digital Logic Design

CHAPTER1: Digital Logic Circuits Combination Circuits

CSC9R6 Computer Design. Practical Digital Logic

Logic Gate Level. Part 2

Boolean Algebra. Philipp Koehn. 9 September 2016

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

Floating Point Representation and Digital Logic. Lecture 11 CS301

Computer organization

EECS Variable Logic Functions

MC9211 Computer Organization

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

Digital Logic. Lecture 5 - Chapter 2. Outline. Other Logic Gates and their uses. Other Logic Operations. CS 2420 Husain Gholoom - lecturer Page 1

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Every time has a value associated with it, not just some times. A variable can take on any value within a range

1 Boolean Algebra Simplification

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Combinational Logic Design Principles

Week-I. Combinational Logic & Circuits

Digital Circuit And Logic Design I. Lecture 3

Chapter 2 Boolean Algebra and Logic Gates

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Logic Gates and Boolean Algebra

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions.

CS61c: Representations of Combinational Logic Circuits

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

Switches: basic element of physical implementations

Lecture 22 Chapters 3 Logic Circuits Part 1

WEEK 2.1 BOOLEAN ALGEBRA

control in out in out Figure 1. Binary switch: (a) opened or off; (b) closed or on.

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

Computer Science. 20. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Digital Logic (2) Boolean Algebra

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

Review: Additional Boolean operations

Chapter 2: Boolean Algebra and Logic Gates

In Module 3, we have learned about Exclusive OR (XOR) gate. Boolean Expression AB + A B = Y also A B = Y. Logic Gate. Truth table

Learning Objectives 10/7/2010. CE 411 Digital System Design. Fundamental of Logic Design. Review the basic concepts of logic circuits. Dr.

Contents. Chapter 2 Digital Circuits Page 1 of 30

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

Chapter 2. Digital Logic Basics

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Circuits & Boolean algebra.

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Gate-Level Minimization

Applications. Smartphone, tablet, game controller, antilock brakes, microprocessor, Wires

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Boolean Algebra CHAPTER 15

ECE/CS 250 Computer Architecture

211: Computer Architecture Summer 2016

Computer Science. 19. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section 6.1.

Lecture A: Logic Design and Gates

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

University of Technology

This form sometimes used in logic circuit, example:

COS 140: Foundations of Computer Science

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Exclusive OR/ Exclusive NOR

Why digital? Overview. Number Systems. Binary to Decimal conversion

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

CS/COE0447: Computer Organization and Assembly Language

More Propositional Logic Algebra: Expressive Completeness and Completeness of Equivalences. Computability and Logic

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

Chapter 2 (Lect 2) Canonical and Standard Forms. Standard Form. Other Logic Operators Logic Gates. Sum of Minterms Product of Maxterms

Logic and Boolean algebra

Cs302 Quiz for MID TERM Exam Solved

20. Combinational Circuits

Chapter 2 Combinational Logic Circuits

Chapter 2. Boolean Algebra and Logic Gates

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

Digital Electronics H H

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Unit 4: Computer as a logic machine

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks

Experiment 7: Magnitude comparators

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Chap 2. Combinational Logic Circuits

EEE130 Digital Electronics I Lecture #4

CSC Discrete Math I, Spring Propositional Logic

Possible logic functions of two variables

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Boolean Algebra and Logic Gates

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

Combinational Logic. Review of Combinational Logic 1

EGC221: Digital Logic Lab

Transcription:

Unit 8A Computer Organization Boolean Logic and Gates

Announcements Bring ear buds or headphones to lab! 15110 Principles of Computing, Carnegie Mellon University - CORTINA 2

Representing and Manipulating Data Last Unit How to represent data as a sequence of bits How to interpret bit representations Use of levels of abstraction in representing more complex information (music, pictures) using simpler building blocks (numbers) This Unit How sequences of bits are implemented using electrical signals, and manipulated by circuits Use of levels of abstraction in designing more complex computer components from simpler components

Foundations Boolean logic is the logic of digital circuits 15110 Principles of Computing, Carnegie Mellon University - CORTINA 4

Implementing Bits Computers compute by manipulating electricity according to specific rules. We associate electrical signals inside the machine with bits. Any electrical device with two distinct states (e.g. on/off switch, two distinct voltage or current levels) could implement our bits. The rules are implemented by electrical circuits.

Conceptualizing bits and circuits ON or 1 : True OFF or 0 : False circuit behavior: expressed in Boolean logic or Boolean algebra 15110 Principles of Computing, Carnegie Mellon University - CORTINA 6

Boolean Logic (Algebra) Computer circuitry works based on Boolean Logic (Boolean Algebra) : operations on True (1) and False (0) values. A B A B (A B) (conjunction) A B (A OR B) (disjunction) 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 A A (NOT A) (negation) 0 1 1 0 A and B in the table are Boolean variables, and OR are operations (also called functions). 7

Boolean Logic & Truth Tables Example: You can think of A B below as 15110 is fun and 15110 is useful where A stands for the statement 15110 is fun, B stands for the statement 15110 is useful. A B A B (A B) (conjunction) A B (A OR B) (disjunction) A A (NOT A) (negation) 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 9

Logic gates the basic elements of digital circuits 15110 Principles of Computing, Carnegie Mellon University - CORTINA 10

Logic Gates A gate is a physical device that implements a Boolean operator by performing basic operations on electrical signals. Nowadays, gates are built from transistors. physical picture of gates Physical behavior of circuits is beyond the scope of our course. A B A B A B A B OR A NOT logical picture of gates 11

, OR, NOT Gates A B A B (A B) (conjunction) 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 A B A B A B A B (A OR B) (disjunction) A B OR A 0 1 1 0 A (NOT A) (negation) A NOT Truth tables define the input - output behavior of logic gates.

A Mechanical Implementation Push-pull logic gate For an input pushed-in lever represents 1 For an output pushed-in lever represents 0 Source: randomwraith.com by Martin Howard

Combinational circuits combinations of logic gates 15110 Principles of Computing, Carnegie Mellon University - CORTINA 14

Combinational Circuits The logic states of inputs at any given time determine the state of the outputs. A B OR output Q inputs A, B, C OR B C (B C) (C B) C B What is Q? (A B) ((B C) (C B)) 15

Truth Table of a Circuit OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 How do I know that there should be 8 rows in the truth table? Describes the relationship between inputs and outputs of a device http://www.allaboutcircuits.com/vol_4/chpt_7/6.html 16

Truth Table of a Circuit OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Describes the relationship between inputs and outputs of a device http://www.allaboutcircuits.com/vol_4/chpt_7/6.html 17

Truth Table of a Circuit OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Describes the relationship between inputs and outputs of a device http://www.allaboutcircuits.com/vol_4/chpt_7/6.html 18

Truth Table of a Circuit OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Describes the relationship between inputs and outputs of a device http://www.allaboutcircuits.com/vol_4/chpt_7/6.html 19

Truth Table of a Circuit OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Describes the relationship between inputs and outputs of a device http://www.allaboutcircuits.com/vol_4/chpt_7/6.html 20

Truth Table of a Circuit OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 1 1 1 Describes the relationship between inputs and outputs of a device http://www.allaboutcircuits.com/vol_4/chpt_7/6.html 21

Describing Behavior of Circuits Boolean expressions Circuit diagrams Truth tables Equivalent notations 22

Manipulating circuits Boolean algebra and logical equivalence 15110 Principles of Computing, Carnegie Mellon University - CORTINA 23

Why manipulate circuits? The design process o simplify a complex design for easier manufacturing, faster or cooler operation, Boolean algebra helps us find another design guaranteed to have same behavior 15110 Principles of Computing, Carnegie Mellon University - CORTINA 24

Logical Equivalence OR OR Q = (A B) ((B C) (C B)) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 Can we come up with a simpler circuit implementing the same truth table? Simpler circuits are typically cheaper to produce, consume less energy etc. 25

Logical Equivalence Q = (A B) ((B C) (C B)) OR OR OR Q = B (A C) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 This smaller circuit is logically equivalent to the one above: they have the same truth table. By using laws of Boolean Algebra we convert a circuit to another equivalent circuit. 26

Laws for the Logical Operators and (Similar to and +) Commutative: A B = B A A B = B A Associative: A B C = (A B) C = A (B C) A B C = (A B) C = A (B C) Distributive: A (B C) = (A B) (A C) A (B C) = (A B) (A C) Identity: A 1 = A A 0 = A Dominance: A 0 = 0 A 1 = 1 Idempotence: A A = A A A = A Complementation: A A = 0 A A = 1 Double Negation: A = A 27

Laws for the Logical Operators and (Similar to and +) Commutative: A B = B A A B = B A Associative: A B C = (A B) C = A (B C) A B C = (A B) C = A (B C) Distributive: A (B C) = (A B) (A C) A (B C) = (A B) (A C) Identity: A 1 = A A 0 = A Not true for + and The A s and B s here are schematic variables! You can instantiate them with any expression that has a Boolean value: (x y) z = z (x y) (by commutativity) A B = B A 28

Applying Properties for and Showing (x y) ((y z) (z y)) = y (x or z) Commutativity A B = B A (x y) ((z y) (y z)) Distributivity A (B C) = (A B) (A C) (x y) (z y y) (z y z) Associativity, Commutativity, Idempotence (x y) ((z y) (y z)) Commutativity, idempotence A A = A ( y x) (y z) Distributivity (backwards) (A B) (A C) = A (B C) y (x z) Conclusion: (x y) ((y z) (z y)) = y (x z)

Extending the system more gates and DeMorgan s laws 15110 Principles of Computing, Carnegie Mellon University - CORTINA 30

More gates (N, NOR, XOR) A B A nand B A nor B A xor B 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 0 0 nand ( not and ): A nand B = not (A and B) nor ( not or ): A nor B = not (A or B) xor ( exclusive or ): A xor B = (A and not B) or (B and not A) A B A B A B (A B) (A B) A B 31

A curious fact Functional Completeness of N and NOR o Any logical circuit can be implemented using N gates only Same applies to NOR

DeMorgan s Law Nand: (A B) = A B Nor: (A B) = A B 33

DeMorgan s Law Nand: Nor: (A B) = A B if not (x > 15 and x < 110):... is logically equivalent to if (not x > 15) or (not x < 110):... (A B) = A B if not (x < 15 or x > 110):... is logically equivalent to if (not x < 15) and (not x > 110):... 34

A circuit for parity checking Boolean expressions and circuits 15110 Principles of Computing, Carnegie Mellon University - CORTINA 35

A Boolean expression that checks parity 3-bit odd parity checker F: an expression that should be true when the count of 1 bits is odd: when 1 or 3 of the bits are 1s. P = ( A B C) ( A B C) (A B C) (A B C) A B C P 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 There are specific methods for obtaining canonical Boolean expressions from a truth table, such as writing it as a disjunction of conjunctions or as a conjunction of disjunctions. See the bonus slide at the end. Note we have four subexpressions above each of them corresponding to exactly one row of the truth table where P is 1. 36

The circuit 3-bit odd parity checker P = ( A B C) ( A B C) (A B C) (A B C) A B C P logically equivalent 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 A B P = (A B) C C P 37

Summary You should be able to: Identify basic gates Describe the behavior of a gate or circuit using Boolean expressions, truth tables, and logic diagrams Transform one Boolean expression into another given the laws of Boolean algebra 38

Using Minterms to Construct a Boolean Function from a Truth Table As presented by Alvarado et. al. in CS for All: 1. Write down the truth table for the Boolean function that you are considering 2. Delete all the rows from the truth table where the value of the function is 0 3. For each remaining row create a minterm as follows: a. For each variable that has a 1 in that row write the name of the variable. If the input variable is 0 in that row, write the variable with a negation symbol. b. Take their conjunction ( them together) 4. Combine all of the minterms using OR (take their disjunction)

Next Time How circuits are combined to form a computer o Von Neumann architecture revisited o Fetch Decode - Execute Cycle MEMORY CPU 40