Fundamentals of Computer Systems

Similar documents
Fundamentals of Computer Systems

Fundamentals of Computer Systems

Understand Video Games; Understand Everything

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

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

Week-I. Combinational Logic & Circuits

Digital Circuit And Logic Design I. Lecture 3

211: Computer Architecture Summer 2016

Digital Logic (2) Boolean Algebra

Digital Logic Design. Combinational Logic

CHAPTER1: Digital Logic Circuits Combination Circuits

Logic Design Combinational Circuits. Digital Computer Design

Chapter 2. Boolean Algebra and Logic Gates

Fundamentals of Computer Systems

Logic Design. Chapter 2: Introduction to Logic Circuits

Unit 2 Session - 6 Combinational Logic Circuits

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

CS 226: Digital Logic Design

ELCT201: DIGITAL LOGIC DESIGN

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

Chapter 2: Boolean Algebra and Logic Gates

Combinational Logic. Review of Combinational Logic 1

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

WEEK 3.1 MORE ON KARNAUGH MAPS

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

Fundamentals of Computer Systems

ENG2410 Digital Design Combinational Logic Circuits

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

EEE130 Digital Electronics I Lecture #4

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

1. Name the person who developed Boolean algebra

CHAPTER 12 Boolean Algebra

Contents. Chapter 2 Digital Circuits Page 1 of 30

Boolean Algebra and Logic Gates

MODULAR CIRCUITS CHAPTER 7

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

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

MC9211 Computer Organization

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

Combinational Logic Fundamentals

Contents. Chapter 3 Combinational Circuits Page 1 of 36

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

This form sometimes used in logic circuit, example:

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

Chapter-2 BOOLEAN ALGEBRA

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

Karnaugh Maps Objectives

Chapter 7 Logic Circuits

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Number System conversions

Combinatorial Logic Design Principles

Boolean Algebra and Digital Logic

Simplifying Logic Circuits with Karnaugh Maps

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

Combinational Logic Design Principles

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

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

Lecture 2 Review on Digital Logic (Part 1)

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

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

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

CS61c: Representations of Combinational Logic Circuits

Chap 2. Combinational Logic Circuits

Boolean Algebra and logic gates

Switches: basic element of physical implementations

Chapter 2 Boolean Algebra and Logic Gates

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

Boolean Algebra & Logic Gates. By : Ali Mustafa

Chapter 2 Combinational Logic Circuits

WEEK 2.1 BOOLEAN ALGEBRA

Computer Organization: Boolean Logic

Standard Expression Forms

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

Karnaugh Maps (K-Maps)

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

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

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

CHAPTER III BOOLEAN ALGEBRA

Chapter 2 Combinational logic

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

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

Solutions to Assignment No 5 Digital Techniques Fall 2007

Possible logic functions of two variables

Minimization techniques

Review for Test 1 : Ch1 5

Chapter 1: Logic systems

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

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

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

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

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

Spiral 1 / Unit 5. Karnaugh Maps

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

Logic Gate Level. Part 2

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

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

CHAPTER III BOOLEAN ALGEBRA

CPE100: Digital Logic Design I

Lecture A: Logic Design and Gates

Transcription:

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

Boolean Logic George Boole 1815 1864

Boole s Intuition Behind Boolean Logic Variables X,,... represent classes of things No imprecision: A thing either is or is not in a class If X is sheep and is white things, X are all white sheep, and X = X XX = X. If X is men and is women, X + is both men and women, X + = + X and X + X = X. If X is men, is women, and Z is European, Z(X + ) is European men and women and Z(X+) = ZX+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 X 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 + A not operator X A false value 0 A A true value 1 A Axioms X + = + X X = X X + ( + Z) = (X + ) + Z X ( Z) = (X ) Z X + (X ) = X X (X + ) = X X ( + Z) = (X ) + (X Z) X + ( Z) = (X + ) (X + Z) X + X = 1 X X = 0

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 X A false value 0 A A true value 1 A Axioms X + = + X X = X X + ( + Z) = (X + ) + Z X ( Z) = (X ) Z X + (X ) = X X (X + ) = X X ( + Z) = (X ) + (X Z) X + ( Z) = (X + ) (X + Z) X + X = 1 X X = 0 We will use the first non-trivial Boolean Algebra: A = {0, 1}. This adds the law of excluded middle: if X 0 then X = 1 and if X 1 then X = 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 X + (X ) X + = + X X = X X + ( + Z) = (X + ) + Z X ( Z) = (X ) Z X + (X ) = X X (X + ) = X X ( + Z) = (X ) + (X Z) X + ( Z) = (X + ) (X + Z) X + X = 1 X X = 0 Lemma: X 1 = X (X + X) = X (X + ) if = X = X

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 X + (X ) = (X + X) (X + ) X + = + X X = X X + ( + Z) = (X + ) + Z X ( Z) = (X ) Z X + (X ) = X X (X + ) = X X ( + Z) = (X ) + (X Z) X + ( Z) = (X + ) (X + Z) X + X = 1 X X = 0 Lemma: X 1 = X (X + X) = X (X + ) if = X = X

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 X + (X ) = (X + X) (X + ) = 1 (X + ) X + = + X X = X X + ( + Z) = (X + ) + Z X ( Z) = (X ) Z X + (X ) = X X (X + ) = X X ( + Z) = (X ) + (X Z) X + ( Z) = (X + ) (X + Z) X + X = 1 X X = 0 Lemma: X 1 = X (X + X) = X (X + ) if = X = X

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 X + (X ) = (X + X) (X + ) = 1 (X + ) = X + Lemma: X + = + X X = X X + ( + Z) = (X + ) + Z X ( Z) = (X ) Z X + (X ) = X X (X + ) = X X ( + Z) = (X ) + (X Z) X + ( Z) = (X + ) (X + Z) X + X = 1 X X = 0 X 1 = X (X + X) = X (X + ) if = X = X

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

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

More Examples XZ + X( + Z) = XZ + X + XZ Expand = X(Z + + Z) Factor w.r.t. X = X(Z + + Z + Z) Z Z + Z = X(Z + Z + + Z) Reorder = X ( (Z + Z) + + Z ) Factor w.r.t. = X( + + Z) + = 1 = X(1 + Z) 1 + Z = 1 = X X1 = X (X + + Z)(X + Z) = XX + XZ + X + Z + ZX + Z Z = X + XZ + X + Z + XZ = X + Z

Sum-of-products form Can always reduce a complex Boolean expression to a sum of product terms: X + X ( X + (Z + X) + Z ) = X + X(X + Z + X + Z) = X + XX + XZ + XX + X Z = X + XZ + X Z (can do better) = (X + XZ) + X Z = (X + Z) + X Z = X Z + X Z = + X 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 X = 0 or X = 1

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

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

Be Careful with Bars X X

Be Careful with Bars X X Let s check all the combinations of X and : X X X X X 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 X Minterm Maxterm X X X X + X + 0 0 X X + 1 0 1 0 1 0 1 X X + 1 0 1 1 0 1 0 X X + 0 0 1 1 0 1 1 X X + 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: X Minterm Maxterm F 0 0 X X + 0 0 1 X X + 1 1 0 X X + 1 1 1 X X + 0 The sum of the minterms where the function is 1: F = X + X The product of the maxterms where the function is 0: F = (X + )(X + )

Expressions to Schematics F = X + X X

Expressions to Schematics F = X + X X X

Expressions to Schematics F = X + X X X X

Expressions to Schematics F = X + X X X X X

Expressions to Schematics F = X + X X X X X + X = F X

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

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

Expressions to Schematics 2 F = X + X + X = X + X X + X + X = F X + = 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 XOR XNOR + 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 X + = X X = X + Proof by Truth Table: X X + X X X + 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 0 0 X X 1 0 1 1 0 1 1 0 1 1 1 1 1 X X 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, X 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 X s are 0 s and use Minterms: A = MLR + MLR B = M LR + M LR + 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 X 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 X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 0 0 X X 1 0 1 1 0 1 1 0 1 1 1 1 1 X X 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 X X 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 X X 1 0 0 X X 1 0 1 1 0 1 1 0 1 1 1 1 1 X X

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 0 0 X X 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 X X

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

Karnaugh Maps Basic trick: put similar variable values near each other so simple functions are obvious M L R A B 0 0 0 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 0 0 X X 1 1 1 X X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 1 1 X X 1 0 0 X X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X Let s rearrange the L s by permuting two pairs of rows 1 1 0 1 1 1 1 1 X X 1 0 0 X X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 1 0 1 1 1 1 1 X X 1 0 0 X X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 1 0 1 1 1 1 1 X X 1 0 0 X X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 1 0 1 1 1 1 1 X X 1 0 0 X X 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 X X 0 0 1 0 1 0 1 0 0 1 0 1 1 X X 1 1 0 1 1 1 1 1 X X 1 0 0 X X 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 X0 X1 0 0 1 1 0 1 0X 1X The R s are really crazy; let s use the second dimension 1 1 1 1 0 1 1X 1X 1 1 0 0 0 1 X1 X0

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 X0 X1 0 0 1 1 0 1 0X 1X MR 1 1 1 1 0 1 1X 1X 1 1 0 0 0 1 X1 X0 M

Maurice Karnaugh s Maps Transactions of the AIEE, 1953

Karnaugh maps (a.k.a., K-maps) All functions can be expressed with a map. There is one square for each minterm in a function s truth table X minterm 0 0 X m0 0 1 X m1 1 0 X m2 1 1 X m3 X 0 1 0 m0 m1 1 m2 m3

Karnaugh maps (a.k.a., K-maps) All functions can be expressed with a map. There is one square for each minterm in a function s truth table X minterm 0 0 X m0 0 1 X m1 1 0 X m2 1 1 X m3 X 0 1 0 m0 m1 X 1 m2 m3 X

Karnaugh maps (a.k.a., K-maps) All functions can be expressed with a map. There is one square for each minterm in a function s truth table X minterm 0 0 X m0 0 1 X m1 1 0 X m2 1 1 X m3 X 0 1 0 m0 m1 1 m2 m3

Karnaugh maps (a.k.a., K-maps) Cont. 1 Fill out the table with the values of some function. X F 0 0 0 0 1 1 1 0 1 1 1 1 X 0 1 0 1 0 1 1 1

Karnaugh maps (a.k.a., K-maps) Cont. 2 When two cells share an edge and both are 1, those two terms can be combined to form a single, simpler term. X 0 1 0 0 1 1 1 1 F = X + X + X

Karnaugh maps (a.k.a., K-maps) Cont. 2 When two cells share an edge and both are 1, those two terms can be combined to form a single, simpler term. X 0 1 0 1 0 1 1 1 F = X + X + X X 0 1 0 1 0 1 1 1 F = X + X X 0 1 0 1 0 1 1 1 F = + X

Karnaugh maps (a.k.a., K-maps) Cont. 2 When two cells share an edge and both are 1, those two terms can be combined to form a single, simpler term. X 0 1 0 1 0 1 1 1 F = X + X + X X 0 1 0 1 0 1 1 1 F = X + X X 0 1 0 1 0 1 1 1 X 0 1 0 1 F = X + 0 1 1 1 F = + X

Karnaugh maps (a.k.a., K-maps) Summary So Far Circle contiguous groups of 1s (circle sizes must be a power of 2) There is a correspondence between circles on a k-map and terms in a function expression The bigger the circle, the simpler the term Add circles (and terms) until all 1s on the k-map are circled Prime implicant: circles that can be no bigger (smallest product term) Essential prime implicant: circles that uniquely covers a 1 is essential X 0 1 0 0 1 1 1 1 F = X +

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 X 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 X 00 01 11 10 0 1 m0 m1 m3 m2 m4 m5 m7 m6 X Z X 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 X 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 X X X X X X X 1 0 1 1 X X X X X X X 1 1 0 0 X X X X X X X 1 1 0 1 X X X X X X X 1 1 1 0 X X X X X X X 1 1 1 1 0 0 0 0 0 0 0 e f d g c b

Karnaugh Map for Seg. a W X 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 X 1 0 1 1 X 1 1 0 0 X 1 1 0 1 X 1 1 1 0 X 1 1 1 1 0 X Z 1 0 1 1 0 1 1 1 X X 0 X 1 1 X X 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 X s is optional.

Karnaugh Map for Seg. a W X 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 X 1 0 1 1 X 1 1 0 0 X 1 1 0 1 X 1 1 1 0 X 1 1 1 1 0 X Z 1 0 1 1 0 1 1 1 X X 0 X 1 1 X X W The minterm solution: cover each 1 with a single implicant. a = W X Z + W X Z + W X Z + W X Z + W X Z + W X Z + W X Z + W X Z 8 4 = 32 literals 4 inv + 8 AND4 + 1 OR8

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

Karnaugh Map for Seg. a W X 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 X 1 0 1 1 X 1 1 0 0 X 1 1 0 1 X 1 1 1 0 X 1 1 1 1 0 X Z 1 0 1 1 0 1 1 1 X X 0 X 1 1 X X W Missed one: Remember this is actually a torus. a = X Z + W + W X Z + W X 3 + 2 + 3 + 3 = 11 literals 4 inv + 3 AND3 + 1 AND2 + 1 OR4

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

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

Karnaugh Map for Seg. a W X 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 X 1 0 1 1 X 1 1 0 0 X 1 1 0 1 X 1 1 1 0 X 1 1 1 1 0 X Z 1 0 1 1 0 1 1 1 X X 0 X 1 1 X X W To display the score, PONG used a TTL chip with this solution in it: (13) (12) OUTPUT a OUTPUT b

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 X Z W X Z + W X Z+ W X Z + W X Z+ W X Z + W X Z+ W X Z + W X 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 X Z (W + W) X Z+ (W + W) X Z+ (W + W) X Z+ (W + W) X Z Use the identities W + W = 1 and 1 X = X.

Boolean Laws and Karnaugh Maps W 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 X Z X Z+ X Z+ X Z+ X 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 ( + ) X Z+ ( + ) X Z Apply the identities again X

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

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

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