Circuits & Boolean algebra.

Similar documents
UNIVERSITI TENAGA NASIONAL. College of Information Technology

MC9211 Computer Organization

Logic Design. Chapter 2: Introduction to Logic Circuits

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

Chapter 2 Combinational Logic Circuits

Chapter 2: Switching Algebra and Logic Circuits

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

CHAPTER 2 BOOLEAN ALGEBRA

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

Unit 2 Boolean Algebra

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

ELCT201: DIGITAL LOGIC DESIGN

CHAPTER1: Digital Logic Circuits Combination Circuits

Boolean Algebra & Logic Gates. By : Ali Mustafa

CS61c: Representations of Combinational Logic Circuits

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

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

Signals and Systems Digital Logic System

Boolean Algebra. Boolean Variables, Functions. NOT operation. AND operation. AND operation (cont). OR operation

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

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

Boolean Algebra and Logic Gates

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

Chapter 2 Combinational Logic Circuits

EEE130 Digital Electronics I Lecture #4

ELCT201: DIGITAL LOGIC DESIGN

Chap 2. Combinational Logic Circuits

Chapter 2 Boolean Algebra and Logic Gates

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

Chapter 2 Combinational Logic Circuits

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Chapter 2 Combinational Logic Circuits

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

Chapter 2. Boolean Algebra and Logic Gates

BOOLEAN ALGEBRA TRUTH TABLE

Chapter 2. Digital Logic Basics

Digital Circuit And Logic Design I. Lecture 3

Week-I. Combinational Logic & Circuits

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Gate-Level Minimization

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

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

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

Computer Organization: Boolean Logic

Lecture 2 Review on Digital Logic (Part 1)

Digital Logic Design. Combinational Logic

Chapter 2 Boolean Algebra and Logic Gates

Chapter 2 Boolean Algebra and Logic Gates

UNIT 3 BOOLEAN ALGEBRA (CONT D)

Chapter 2: Boolean Algebra and Logic Gates

20. Combinational Circuits

Chapter 7 Logic Circuits

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

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

ECE 238L Boolean Algebra - Part I

ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2

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

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

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

EEA051 - Digital Logic 數位邏輯 吳俊興高雄大學資訊工程學系. September 2004

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

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

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

Boolean Algebra, Gates and Circuits

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

Boolean Algebra. Philipp Koehn. 9 September 2016

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA (CONT.)

Number System conversions

School of Computer Science and Electrical Engineering 28/05/01. Digital Circuits. Lecture 14. ENG1030 Electrical Physics and Electronics

Logic Gates and Boolean Algebra

CHAPTER 3 BOOLEAN ALGEBRA

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

CS 226: Digital Logic Design

Combinational Logic. Review of Combinational Logic 1

Logic Gate Level. Part 2

Chapter 3. Boolean Algebra. (continued)

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

WEEK 2.1 BOOLEAN ALGEBRA

Binary Logic and Gates. Our objective is to learn how to design digital circuits.

Unit 2 Boolean Algebra

Switches: basic element of physical implementations

Unit 8A Computer Organization. Boolean Logic and Gates

Fundamentals of Computer Systems

Chapter 2 Boolean Algebra and Logic Gates

BOOLEAN LOGIC. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

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

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Chapter 2 Combinational logic

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

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

Unit 2 Session - 6 Combinational Logic Circuits

Chapter 2 Combinational Logic Circuits

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

LOGIC GATES. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

CPE100: Digital Logic Design I

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

ENG2410 Digital Design Combinational Logic Circuits

Transcription:

Circuits & Boolean algebra http://xkcd.com/730/ CSCI 255: Introduction to Embedded Systems Keith Vertanen Copyright 2011

Digital circuits Overview How a switch works Building basic gates from switches Boolean algebra Sum-of-products notation Rules of Boolean algebra Minimization 2

Building blocks: Wires Digital circuits Propagate an ON/OFF value 1 = connected to power 0 = not connect to power Any wire connected to a wire that is on is also on Switches Controls propagation of an ON/OFF value through a wire 3

Building a switch Controlled switch 3 connections: input, output, control control = OFF, input connected to output control input output 4

Switch types Relay Vacuum tube Transistor Pass transistor 5

Logic gates Build NOT, OR, AND gates from switches NOT = x' x NOT 0 1 1 0 OR = x + y x y OR 0 0 0 0 1 1 1 0 1 1 1 1 6

Logic gates AND = xy x y AND 0 0 0 0 1 0 1 0 0 1 1 1 7

Inverted gate variants NOR(x,y) x y NOR 0 0 1 0 1 0 1 0 0 1 1 0 NAND(x,y) x y NAND 0 0 1 0 1 1 1 0 1 1 1 0 XNOR(x,y) x y XNOR 0 0 1 0 1 0 1 0 0 1 1 1 8

Boolean algebra Boolean algebra Every variable is either 0 or 1 Functions whose inputs and outputs are 0 or 1 Relationship to circuits: Boolean variable = signal (ON/OFF) Boolean function = circuit made of gates & wires Relationship to truth tables: Systematic way to represent any Boolean function One row for any input combination 9

2 variable truth tables Given 2 variables, how many possible Boolean functions? x y function 1 function 2 function N 0 0 0 1 1 0 1 1 10

All 2 variable Boolean functions x y ZERO AND x y XOR OR 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 x y NOR EQ y' x' NAND ONE 0 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 11

3 variables truth tables Given 3 variables, how many total possible Boolean functions? x y z function 1 function 2 function N 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 12

Representing Boolean functions 16 = 2 4 Boolean functions of 2 variables 256 = 2 8 Boolean functions of 3 variables 65536 = 2 16 Boolean functions of 4 variables 2 2n Boolean functions of n variables! We need a more compact representation 13

Sum-of-products Universality: any Boolean function can be expressed using {AND, OR, NOT} Also universal: Sum-of-products {AND, NOT}, {OR, NOT}, {NAND}, {NOR} Create Boolean expression from truth table Form AND term for each 1 in table OR terms together 14

Sum-of-products: XOR XOR = x y x y XOR 0 0 0 0 1 1 1 0 1 1 1 0 XOR(x,y) = x'y + xy' Form AND term for each 1 in table OR terms together Easy to convert to circuit using only AND, OR, NOT 15

Sum-of-products: XOR XOR = x y x y XOR 0 0 0 0 1 1 1 0 1 1 1 0 XOR(x,y) = x'y + xy' 16

Majority function Majority function 1 if majority of bits are 1, 0 otherwise x y z MAJ(x,y,z) 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 1 0 1 1 1 1 1 17

Majority function x y z MAJ(x,y,z) 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 1 0 1 1 1 1 1 MAJ(x,y,z) = x'yz + xy'z + xyz' + xyz Can we do better? 18

Minimizing MAJ(x,y,z) MAJ(x,y,z) = x'yz + xy'z + xyz' + xyz = xy + yz + xz 4, 3-input AND gates 3, NOT gates 1, 4-input OR gate 3, 2-input AND gates 1, 3-input OR gate 19

Products-of-sums Products-of-sums Create Boolean expression from truth table Form OR term for each 0 in table Use X in OR term if X = 0, X is X = 1 AND terms together 20

Product of sums: Majority x y z MAJ(x,y,z) 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 1 0 1 1 1 1 1 MAJ(x,y,z) = (x + y + z) (x + y + z ) (x + y + z) (x + y + z) 21

Comparing POS vs. SOP Products-of-sums (POS) Create Boolean expression from truth table Form OR term for each 0 in table Use X in OR term if X = 0, X is X = 1 AND terms together Sum-of-products (SOP) Create Boolean expression from truth table Form AND term for each 1 in table Use X in AND term if X = 1, use X if X = 0 OR terms together 22

Rules of Boolean algebra (a) (b) 1. Commutative law x + y = y + x xy = yx 2. Associate law (x + y) + z = x + (y + z) (xy)z=x(yz) 3. Distributive law x(y + z) = xy + xz (x + y)(x + z) = x + yz 4. Identity law x + x = x xx = x 5. xy + xy' = x (x + y)(x + y') = x 6. Redundance law x + xy = x x(x + y) = x 7. 0 + x = x 0x = 0 8. 1 + x = 1 1x = x 9. x' + x = 1 x'x = 0 10. x + x'y = x + y x(x' + y) = xy 11. De Morgan's Theorem (x + y)' = x'y' (xy)' = x' + y' 23

Minimizing MAJ(x, y, z) MAJ(x, y, z) = x'yz + xy'z + xyz' + xyz = x'yz + xy'z + xy(z' + z) [3a] distributive = x'yz + xy'z + xy [9a] = x'yz + xy'z + xy(1 + z) [8a] = x'yz + xy'z + xy + xyz [3a] distributive = yz(x' + x) + xy'z + xy [3a] distributive = yz + xy'z + xy [9a] = yz + xy'z + xy(1 + z) [8a] = yz + xy'z + xy + xyz [3a] distributive = yz + xz(y' + y) + xy [3a] distributive = yz + xz + xy [9a] 24

Problem 1: Odd parity function Odd parity 1 if odd number of bits are 1 Find sum-of-products Draw the circuit x y z ODD(x,y,z) 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 25

Problem 2: Absolute value 3-bit number in two s complement Bits = xyz Create a truth table for ABS(x,y,z) >= 2 ABS() is 1 if and only if absolute value is 2 or more Find sum-of-products Minimize the Boolean expression Draw the circuit 26

Problem 3: Show that {NAND} is universal Hint: show you can build AND, OR, NOT from 1-3 NAND gates Show that {NOR} is universal Show that {AND, NOT} is universal Hint: Use De Morgan s on sum-of-products to eliminate OR Show that {OR, NOT} is universal Hint: Use De Morgan s on products-of-sums to eliminate AND 27

Summary Wires + switches gates {AND, OR, NOT} Truth table sum-of-products Boolean expression Sum-of-products circuit Simplification via rules of Boolean algebra 28