Fundamentals of Computer Systems

Similar documents
Fundamentals of Computer Systems

Fundamentals of Computer Systems

Understand Video Games; Understand Everything

211: Computer Architecture Summer 2016

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

CS 226: Digital Logic Design

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

Chapter 2: Switching Algebra and Logic Circuits

Digital Logic (2) Boolean Algebra

Digital Circuit And Logic Design I. Lecture 3

Logic Design Combinational Circuits. Digital Computer Design

Unit 2 Session - 6 Combinational Logic Circuits

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

Fundamentals of Computer Systems

Digital Logic Design. Combinational Logic

Working with Combinational Logic. Design example: 2x2-bit multiplier

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

14:332:231 DIGITAL LOGIC DESIGN. Combinational Circuit Synthesis

Week-I. Combinational Logic & Circuits

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Copyright 2007 Elsevier 2-<101>

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Fundamentals of Computer Systems

Logic Simplification. Boolean Simplification Example. Applying Boolean Identities F = A B C + A B C + A BC + ABC. Karnaugh Maps 2/10/2009 COMP370 1

This form sometimes used in logic circuit, example:

Combinational Logic. Review of Combinational Logic 1

ENG2410 Digital Design Combinational Logic Circuits

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

Karnaugh Maps Objectives

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

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

Simplifying Logic Circuits with Karnaugh Maps

Chapter 7 Logic Circuits

MODULAR CIRCUITS CHAPTER 7

ELCT201: DIGITAL LOGIC DESIGN

CHAPTER 12 Boolean Algebra

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

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

Chapter 2. Boolean Algebra and Logic Gates

Logic Design. Chapter 2: Introduction to Logic Circuits

Combinational Logic Fundamentals

1. Name the person who developed Boolean algebra

Minimization techniques

EEE130 Digital Electronics I Lecture #4

Combinational Logic Design Principles

CPE100: Digital Logic Design I

Combinatorial Logic Design Principles

CHAPTER1: Digital Logic Circuits Combination Circuits

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: Princess Sumaya Univ. Computer Engineering Dept.

Boolean Algebra and Digital Logic

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

Prove that if not fat and not triangle necessarily means not green then green must be fat or triangle (or both).

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

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

Spiral 1 / Unit 5. Karnaugh Maps

Chapter 2: Boolean Algebra and Logic Gates

CS61c: Representations of Combinational Logic Circuits

Karnaugh Maps (K-Maps)

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

Computer Organization: Boolean Logic

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

ELEC Digital Logic Circuits Fall 2014 Switching Algebra (Chapter 2)

Boolean Algebra and Logic Gates

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

Chapter-2 BOOLEAN ALGEBRA

Chapter 4 Optimized Implementation of Logic Functions

Contents. Chapter 2 Digital Circuits Page 1 of 30

WEEK 3.1 MORE ON KARNAUGH MAPS

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

BOOLEAN ALGEBRA CLASS XII. Presented By : Dinesh Patel PGT CS KV IIT Powai

CHAPTER III BOOLEAN ALGEBRA

ENGR 303 Introduction to Logic Design Lecture 3. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

Introduction to Karnaugh Maps

L4: Karnaugh diagrams, two-, and multi-level minimization. Elena Dubrova KTH / ICT / ES

Karnaugh Map & Boolean Expression Simplification

for Digital Systems Simplification of logic functions Tajana Simunic Rosing Sources: TSR, Katz, Boriello & Vahid

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

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

Number System conversions

WEEK 2.1 BOOLEAN ALGEBRA

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

Midterm1 Review. Jan 24 Armita

Switches: basic element of physical implementations

Chap 2. Combinational Logic Circuits

Chapter 2 Combinational Logic Circuits

MC9211 Computer Organization

Chapter 2. Introduction. Chapter 2 :: Topics. Circuits. Nodes. Circuit elements. Introduction

Intro To Digital Logic

Combinational Logic Circuits Part II -Theoretical Foundations

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

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

Slides for Lecture 10

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

Boolean Algebra and logic gates

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

Gates and Logic: From Transistors to Logic Gates and Logic Circuits

Review for Test 1 : Ch1 5

CHAPTER III BOOLEAN ALGEBRA

Boolean Algebra & Logic Gates. By : Ali Mustafa

Transcription:

Fundamentals of Computer Systems Boolean Logic Stephen A. Edwards Columbia University Summer 2017

Boolean Logic George Boole 1815 1864

Boole s Intuition Behind Boolean Logic Variables,,... represent classes of things No imprecision: A thing either is or is not in a class If is sheep and is white things, are all white sheep, and = =. If is men and is women, + is both men and women, and + = + + =. If is men, is women, and Z is European, Z( +) is European men and women and Z( +) = Z +Z.

The Axioms of (Any) Boolean Algebra A Boolean Algebra consists of A set of values A An and operator An or operator + A not operator A false value 0 A A true value 1 A

The Axioms of (Any) Boolean Algebra A Boolean Algebra consists of A set of values A An and operator An or operator + Axioms A not operator A false value 0 A A true value 1 A + = + = +( +Z) = ( +) +Z ( Z) = ( ) Z +( ) = ( +) = ( +Z) = ( ) +( Z) +( Z) = ( +) ( +Z) + = 1 = 0

The Axioms of (Any) Boolean Algebra A Boolean Algebra consists of A set of values A An and operator An or operator + Axioms A not operator A false value 0 A A true value 1 A + = + = +( +Z) = ( +) +Z ( Z) = ( ) Z +( ) = ( +) = ( +Z) = ( ) +( Z) +( Z) = ( +) ( +Z) + = 1 = 0 We will use the first non-trivial Boolean Algebra: A = {0,1}. This adds the law of excluded middle: if 0 then = 1 and if 1 then = 0.

Simplifying a Boolean Expression ou are a New orker if you were born in New ork or were not born in New ork and lived here ten years. Axioms +( ) + = + = +( +Z) = ( +) +Z ( Z) = ( ) Z +( ) = ( +) = ( +Z) = ( ) +( Z) +( Z) = ( +) ( +Z) + = 1 = 0 Lemma: 1 = ( +) = ( +) if = =

Simplifying a Boolean Expression ou are a New orker if you were born in New ork or were not born in New ork and lived here ten years. Axioms +( ) = ( +) ( +) + = + = +( +Z) = ( +) +Z ( Z) = ( ) Z +( ) = ( +) = ( +Z) = ( ) +( Z) +( Z) = ( +) ( +Z) + = 1 = 0 Lemma: 1 = ( +) = ( +) if = =

Simplifying a Boolean Expression ou are a New orker if you were born in New ork or were not born in New ork and lived here ten years. Axioms +( ) = ( +) ( +) = 1 ( +) + = + = +( +Z) = ( +) +Z ( Z) = ( ) Z +( ) = ( +) = ( +Z) = ( ) +( Z) +( Z) = ( +) ( +Z) + = 1 = 0 Lemma: 1 = ( +) = ( +) if = =

Simplifying a Boolean Expression ou are a New orker if you were born in New ork or were not born in New ork and lived here ten years. Axioms +( ) = ( +) ( +) = 1 ( +) = + Lemma: + = + = +( +Z) = ( +) +Z ( Z) = ( ) Z +( ) = ( +) = ( +Z) = ( ) +( Z) +( Z) = ( +) ( +Z) + = 1 = 0 1 = ( +) = ( +) if = =

More properties 0 +0 = 0 0 +1 = 1 1 +0 = 1 1 +1 = 1 1 +1+ +1 = 1 +0 = +1 = 1 + = + = + = + 0 0 = 0 0 1 = 0 1 0 = 0 1 1 = 1 1 1 1 = 1 0 = 0 1 = = ( +) = ( +) =

More Examples +Z( +Z) = +Z +ZZ = +Z = ( +Z) +( +Z) +Z = + +Z +Z = +Z +Z = +Z

More Examples Z +( +Z) = Z + +Z Expand = (Z + +Z) Factor w.r.t. = (Z + +Z +Z) Z Z = (Z +Z + +Z) Reorder = ( (Z +Z) + +Z ) Factor w.r.t. = ( + +Z) + = 1 = (1 +Z) 1 +Z = 1 = 1 = ( + +Z)( +Z) = +Z + + Z +Z +Z Z = +Z + +Z +Z = +Z

Sum-of-products form Can always reduce a complex Boolean expression to a sum of product terms: + ( +(Z +) +Z ) = +( +Z + +Z) = + +Z + + Z = +Z + Z (can do better) = ( +Z) + Z = ( +Z) + Z = Z + Z = + Z

What Does This Have To Do With Logic Circuits? Claude Shannon 1916 2001

Shannon s MS Thesis We shall limit our treatment to circuits containing only relay contacts and switches, and therefore at any given time the circuit between any two terminals must be either open (infinite impedance) or closed (zero impedance).

Shannon s MS Thesis It is evident that with the above definitions the following postulates hold. 0 0 = 0 A closed circuit in parallel with a closed circuit is a closed circuit. 1 +1 = 1 An open circuit in series with an open circuit is an open circuit. 1 +0 = 0 +1 = 1 An open circuit in series with a closed circuit in either order is an open circuit. 0 1 = 1 0 = 0 A closed circuit in parallel with an open circuit in either order is an closed circuit. 0 +0 = 0 A closed circuit in series with a closed circuit is a closed circuit. 1 1 = 1 An open circuit in parallel with an open circuit is an open circuit. At any give time either = 0 or = 1

Alternate Notations for Boolean Logic Operator Math Engineer Schematic Copy x or Complement x AND x y or OR x y + +

Definitions Literal: a Boolean variable or its complement E.g., Implicant: A product of literals E.g., Z Minterm: An implicant with each variable once E.g., Z Z Z Maxterm: A sum of literals with each variable once E.g., + +Z + +Z + +Z

Be Careful with Bars

Be Careful with Bars Let s check all the combinations of and : 0 0 1 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 0 1 0

Truth Tables A truth table is a canonical representation of a Boolean function Minterm Maxterm + + 0 0 + 1 0 1 0 1 0 1 + 1 0 1 1 0 1 0 + 0 0 1 1 0 1 1 + 0 1 0 1 0 Each row has a unique minterm and maxterm The minterm is 1 maxterm is 0 for only its row

Sum-of-minterms and Product-of-maxterms Two mechanical ways to translate a function s truth table into an expression: Minterm Maxterm F 0 0 + 0 0 1 + 1 1 0 + 1 1 1 + 0 The sum of the minterms where the function is 1: F = + The product of the maxterms where the function is 0: F = ( +)( +)

Expressions to Schematics F = +

Expressions to Schematics F = +

Expressions to Schematics F = +

Expressions to Schematics F = +

Expressions to Schematics F = + + = F

Expressions to Schematics F = + = ( +)( +) + = F ( +)( +) = F

Minterms and Maxterms: Another Example The minterm and maxterm representation of functions may look very different: Minterm Maxterm F 0 0 + 0 0 1 + 1 1 0 + 1 1 1 + 1 The sum of the minterms where the function is 1: F = + + The product of the maxterms where the function is 0: F = +

Expressions to Schematics 2 F = + + = + + + = F + = F

The Menagerie of Gates

The Menagerie of Gates Buffer Inverter AND NAND 0 0 1 1 0 1 1 0 0 1 0 0 0 1 0 1 0 1 0 1 1 1 1 0 OR NOR OR NOR + 0 1 0 0 1 1 1 1 + 0 1 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 1

De Morgan s Theorem + = = + Proof by Truth Table: + + 0 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0

De Morgan s Theorem in Gates AB = A +B = A +B = A B =

Bubble Pushing A B C D F Apply De Morgan s Theorem: Transform NAND into OR with inverted inputs

Bubble Pushing A B C D F Apply De Morgan s Theorem: Transform NAND into OR with inverted inputs Two bubbles on a wire cancel

Bubble Pushing A B C D F Apply De Morgan s Theorem: Transform NAND into OR with inverted inputs Two bubbles on a wire cancel

PONG PONG, Atari 1973 Built from TTL logic gates; no computer, no software Launched the video arcade game revolution

Horizontal Ball Control in PONG M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1 The ball moves either left or right. Part of the control circuit has three inputs: M ( move ), L ( left ), and R ( right ). It produces two outputs A and B. Here, means I don t care what the output is; I never expect this input combination to occur.

Horizontal Ball Control in PONG M L R A B 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 E.g., assume all the s are 0 s and use Minterms: A = MLR +MLR B = MLR +MLR +MLR 3 inv + 4 AND3 + 1 OR2 + 1 OR3

Horizontal Ball Control in PONG M L R A B 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1 1 Assume all the s are 1 s and use Maxterms: A = (M +L+R)(M +L+R) B = M +L+R 3 inv + 3 OR3 + 1 AND2

Horizontal Ball Control in PONG M L R A B 0 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 Choosing better values for the s and being much more clever: A = M B = MR 1 NAND2 (!)

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1 The M s are already arranged nicely

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 Let s rearrange the 0 0 1 0 1 L s by permuting two 0 1 0 0 1 pairs of rows 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 1 1

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 Let s rearrange the L s by permuting two pairs of rows 1 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 0 0 1 1 1 1 0 1 1 0

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0 Let s rearrange the L s by permuting two pairs of rows

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0 Let s rearrange the L s by permuting two pairs of rows

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0 The R s are really crazy; let s use the second dimension

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0 The R s are really crazy; let s use the second dimension

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 The R s are really crazy; let s use the second dimension 1 1 1 1 0 1 1 1 1 1 0 0 0 1 1 0

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 MR 1 1 1 1 0 1 1 1 1 1 0 0 0 1 1 0 M

Maurice Karnaugh s Maps Transactions of the AIEE, 1953

Karnaugh Maps All functions can be expressed with a map. There is one square for each minterm in a function s truth table minterm 0 0 m0 0 1 m1 1 0 m2 1 1 m3 0 1 0 m0 m1 1 m2 m3

Karnaugh Maps All functions can be expressed with a map. There is one square for each minterm in a function s truth table minterm 0 0 m0 0 1 m1 1 0 m2 1 1 m3 0 1 0 m0 m1 1 m2 m3

Karnaugh Maps All functions can be expressed with a map. There is one square for each minterm in a function s truth table minterm 0 0 m0 0 1 m1 1 0 m2 1 1 m3 0 1 0 m0 m1 1 m2 m3

Karnaugh Maps Fill out the table with the values of some function. F 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1

Karnaugh Maps When two cells share an edge and both are 1, those two terms can be combined to form a single, simpler term. 0 1 0 0 1 1 1 1 F = + +

Karnaugh Maps When two cells share an edge and both are 1, those two terms can be combined to form a single, simpler term. 0 1 0 1 0 1 1 1 F = + + 0 1 0 1 0 1 1 1 F = + 0 1 0 1 0 1 1 1 F = +

Karnaugh Maps When two cells share an edge and both are 1, those two terms can be combined to form a single, simpler term. 0 1 0 1 0 1 1 1 F = + + 0 1 0 1 0 1 1 1 F = + 0 1 0 1 0 1 1 1 0 1 0 1 F = + 0 1 1 1 F = +

Karnaugh Maps Circle contiguous groups of 1s Circles may be 1 1, 1 2, 1 4, 2 1, 2 2, 2 4, etc. Each circle represents an implicant The bigger the circle, the simpler the implicant Circle all and only 1 s to implement the function A Prime Implicant is a circle that can t be made bigger An Essential Prime Implicant is a prime implicant that covers a 1 covered by no other prime. 0 1 0 0 1 1 1 1 F = +

3-Variable Karnaugh Maps Use gray ordering on edges with multiple variables Gray encoding: order of values such that only one bit changes at a time Two minterms are considered adjacent if they differ in only one variable (this means maps wrap ) Z 00 01 11 10 0 m0 m1 m3 m2 1 m4 m5 m7 m6

3-Variable Karnaugh Maps Use gray ordering on edges with multiple variables Gray encoding: order of values such that only one bit changes at a time Two minterms are considered adjacent if they differ in only one variable (this means maps wrap ) Z 00 01 11 10 0 1 m0 m1 m3 m2 m4 m5 m7 m6 Z Z m0 m1 m3 m2 m4 m5 m7 m6

4-Variable Karnaugh Maps An extension of 3-variable maps. C D A B 00 01 11 10 00 01 11 10 0 1 3 2 4 5 7 6 B 12 13 15 14 8 9 11 10 A D C B D 0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 C A

The Seven-Segment Decoder Example a W Z a b c d e f g 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 e f d g c b

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 W The Karnaugh Map Sum-of-Products Challenge Cover all the 1 s and none of the 0 s using as few literals (gate inputs) as possible. Few, large rectangles are good. Covering s is optional.

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 W The minterm solution: cover each 1 with a single implicant. a = W Z +W Z +W Z + 8 4 = 32 literals W Z +W Z +W Z + W Z +W Z 4 inv + 8 AND4 + 1 OR8

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 Merging implicants helps Recall the distributive law: AB +AC = A(B +C) W a = W Z +W + W Z +W 4 +2+3+3 = 12 literals 4 inv + 1 AND4 + 2 AND3 + 1 AND2 + 1 OR4

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 W Missed one: Remember this is actually a torus. a = Z +W + 3 +2+3+3 = 11 literals W Z +W 4 inv + 3 AND3 + 1 AND2 + 1 OR4

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 W Taking don t-cares into account, we can enlarge two implicants: a = Z +W + 2 +2+3+2 = 9 literals W Z +W 3 inv + 1 AND3 + 3 AND2 + 1 OR4

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 W Can also compute the complement of the function and invert the result. Covering the 0 s instead of the 1 s: a = W Z + Z +W 4 +3+2 = 9 literals 5 inv + 1 AND4 + 1 AND3 + 1 AND2 + 1 OR3

Karnaugh Map for Seg. a W Z a 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Z 1 0 1 1 0 1 1 1 0 1 1 W To display the score, PONG used a TTL chip with this solution in it: (13) (12) OUTPUT a OUTPUT b

Another Karnaugh Map Example Z 0 0 0 0 0 1 1 0 1 1 0 0 0 0 W Consider building a minimal two-level circuit for this function. Start by choose a large number of adjacent 1 s and s in a cube shape.

Another Karnaugh Map Example Z Z 0 0 0 0 0 1 1 0 1 1 0 0 0 0 W 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 W Here s a big group and the Karnaugh map of the corresponding implicant.

Another Karnaugh Map Example Z Z 0 0 0 0 0 1 1 0 1 1 0 0 0 0 W 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 W The implicant covers 4 1 s, so it only consists of two terms.

Another Karnaugh Map Example Z Z Z 0 0 0 0 0 1 1 0 1 1 0 0 0 0 W 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 W 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 W Not all the 1 s are covered, so we need to choose another group of adjacent 1 s and s. Here is the Karnaugh map of the corresponding implicant.

Another Karnaugh Map Example Z Z Z 0 0 0 0 0 1 1 0 1 1 0 0 0 0 W 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 W 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 W W Z WZ This implicant only covers 2 1 s, so it has three terms.

Another Karnaugh Map Example Z Z Z 0 0 0 0 0 1 1 0 1 1 0 0 0 0 W 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 W 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 W W Z W Z WZ WZ + Together, these two implicants cover all the 1 s. ORing the two implicants together gives the answer.

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z W Z +W Z+ W Z +W Z+ W Z +W Z+ W Z +W Z Factor out the W s

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z (W +W) Z+ (W +W) Z+ (W +W) Z+ (W +W) Z Use the identities W +W = 1 and 1 =.

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z Z+ Z+ Z+ Z Factor out the s

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z ( +) Z+ ( +) Z Apply the identities again

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z Z+ Z Factor out Z

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z (Z +Z) Simplify

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z Done