Review: Additional Boolean operations

Similar documents
Chapter 3 Ctd: Combinational Functions and Circuits

CHAPTER1: Digital Logic Circuits Combination Circuits

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Logic Gate Level. Part 2

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

Systems I: Computer Organization and Architecture

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

Contents. Chapter 2 Digital Circuits Page 1 of 30

MC9211 Computer Organization

Logic Design. Chapter 2: Introduction to Logic Circuits

Digital Logic (2) Boolean Algebra

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

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

Chapter 2: Switching Algebra and Logic Circuits

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

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

Combina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge

UNIVERSITI TENAGA NASIONAL. College of Information Technology

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

Chapter 2. Boolean Algebra and Logic Gates

Chapter 2 Combinational Logic Circuits

Lecture 2 Review on Digital Logic (Part 1)

Combinational Logic. By : Ali Mustafa

Chap 2. Combinational Logic Circuits

MODULAR CIRCUITS CHAPTER 7

Chapter 2: Boolean Algebra and Logic Gates

Review for Test 1 : Ch1 5

Chapter 2 Boolean Algebra and Logic Gates

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

Binary addition example worked out

211: Computer Architecture Summer 2016

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

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

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

Boolean Algebra, Gates and Circuits

Combinational Logic Design Principles

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

Chapter 3 Combinational Logic Design

Computer organization

EECS Variable Logic Functions

Fundamentals of Digital Design

Standard Expression Forms

Combinatorial Logic Design Principles

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

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

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

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

Chapter 2 Boolean Algebra and Logic Gates

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

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

CS 226: Digital Logic Design

CHAPTER 12 Boolean Algebra

EC-121 Digital Logic Design

Chapter 2 Combinational Logic Circuits

Unit 8A Computer Organization. Boolean Logic and Gates

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

ELCT201: DIGITAL LOGIC DESIGN

Latches. October 13, 2003 Latches 1

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

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

PG - TRB UNIT-X- DIGITAL ELECTRONICS. POLYTECHNIC-TRB MATERIALS

Chapter 2 Combinational Logic Circuits

. T SHREE MAHAPRABHU PUBLIC SCHOOL & COLLEGE NOTES FOR BOARD EXAMINATION SUBJECT COMPUTER SCIENCE (Code: 083) Boolean Algebra

Class Website:

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

CSC9R6 Computer Design. Practical Digital Logic

Digital Circuit And Logic Design I. Lecture 3

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

Boolean Algebra and Logic Gates

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

Logic. Combinational. inputs. outputs. the result. system can

Implementation of Boolean Logic by Digital Circuits

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

Signals and Systems Digital Logic System

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

Computer Organization: Boolean Logic

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

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

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

Boolean Logic Prof. James L. Frankel Harvard University. Version of 3:20 PM 29-Aug-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved.

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

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.

EEE130 Digital Electronics I Lecture #4

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

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

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

Logic Gates and Boolean Algebra

Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Lecture 7: Logic design. Combinational logic circuits

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

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

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

Combinational Logic. Review of Combinational Logic 1

Lecture A: Logic Design and Gates

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

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

ELCT201: DIGITAL LOGIC DESIGN

Transcription:

Review: Additional Boolean operations Operation: NAND (NOT-AND) NOR (NOT-OR) XOR (exclusive OR) Expressions: (xy) = x + y (x + y) = x y x y = x y + xy Truth table: x y (xy) x y (x+y) x y x y 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 0 0 1 1 1 0 1 1 1 0 Logic gates: Decoders 1

XOR gates A two-input XOR gate outputs true when exactly one of its inputs is true: x y x y 0 0 0 0 1 1 x y = x y + x y 1 0 1 1 1 0 XOR corresponds more closely to typical English usage of or, as in eat your vegetables or you won t get any pudding. Several fascinating properties of the XOR operation: x 0 = x x 1 = x x x = 0 x x = 1 x (y z) = (x y) z [ Associative ] x y = y x [ Commutative ] Decoders 2

More XOR tidbits The general XOR function is true when an odd number of its arguments are true. For example, we can use Boolean algebra to simplify a three-input XOR to the following expression and truth table. x (y z) = x (y z + yz ) [ Definition of XOR ] = x (y z + yz ) + x(y z + yz ) [ Definition of XOR ] = x y z + x yz + x(y z + yz ) [ Distributive ] = x y z + x yz + x((y z) (yz ) ) [ DeMorgan s ] = x y z + x yz + x((y + z )(y + z)) [ DeMorgan s ] = x y z + x yz + x(yz + y z ) [ Distributive ] = x y z + x yz + xyz + xy z [ Distributive ] x y z 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 XOR is especially useful for building adders (as we ll see on later) and error detection/correction circuits. Decoders 3

XNOR gates Finally, the complement of the XOR function is the XNOR function. A two-input XNOR gate is true when its inputs are equal: x y (x y) 0 0 1 0 1 0 1 0 0 1 1 1 (x y) = x y + xy Decoders 4

Design considerations, and where they come from Circuits made up of gates, that don t have any feedback, are called combinatorial circuits No feedback: outputs are not connected to inputs If you change the inputs, and wait for a while, the correct outputs show up. Why? Capacitive loading: fill up the water level analogy. So, when such ckts are used in a computer, the time it takes to get stable outputs is important. For the same reason, a single output cannot drive too many inputs Will be too slow to fill them up May not have enough power So, the design criteria are: Propagation delay (how many gets in a sequence from in to out) Fan-out Fan-in (Number of inputs to a single gate) Decoders 5

Decoders Next, we ll look at some commonly used circuits: decoders and multiplexers. These serve as examples of the circuit analysis and design techniques from last lecture. They can be used to implement arbitrary functions. We are introduced to abstraction and modularity as hardware design principles. Throughout the semester, we ll often use decoders and multiplexers as building blocks in designing more complex hardware. Decoders 6

What is a decoder In older days, the (good) printers used be like typewriters: To print A, a wheel turned, brought the A key up, which then was struck on the paper. Letters are encoded as 8 bit codes inside the computer. When the particular combination of bits that encodes A is detected, we want to activate the output line corresponding to A (Not actually how the wheels worked) How to do this detection : decoder General idea: given a k bit input, Detect which of the 2^k combinations is represented Produce 2^k outputs, only one of which is 1. Decoders 7

What a decoder does A n-to-2 n decoder takes an n-bit input and produces 2 n outputs. The n inputs represent a binary number that determines which of the 2 n outputs is uniquely true. A 2-to-4 decoder operates according to the following truth table. The 2-bit input is called S1S0, and the four outputs are Q0-Q3. If the input is the binary number i, then output Qi is uniquely true. S1 S0 Q0 Q1 Q2 Q3 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 For instance, if the input S1 S0 = 10 (decimal 2), then output Q2 is true, and Q0, Q1, Q3 are all false. This circuit decodes a binary number into a one-of-four code. Decoders 8

How can you build a 2-to-4 decoder? Follow the design procedures from last time! We have a truth table, so we can write equations for each of the four outputs (Q0-Q3), based on the two inputs (S0-S1). S1 S0 Q0 Q1 Q2 Q3 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 In this case there s not much to be simplified. Here are the equations: Q0 = S1 S0 Q1 = S1 S0 Q2 = S1 S0 Q3 = S1 S0 Decoders 9

A picture of a 2-to-4 decoder S1 S0 Q0 Q1 Q2 Q3 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 Decoders 10

Enable inputs Many devices have an additional enable input, which is used to activate or deactivate the device. For a decoder, EN=1 activates the decoder, so it behaves as specified earlier. Exactly one of the outputs will be 1. EN=0 deactivates the decoder. By convention, that means all of the decoder s outputs are 0. We can include this additional input in the decoder s truth table: EN S1 S0 Q0 Q1 Q2 Q3 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 Decoders 11

An aside: abbreviated truth tables In this table, note that whenever EN=0, the outputs are always 0, regardless of inputs S1 and S0. EN S1 S0 Q0 Q1 Q2 Q3 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 We can abbreviate the table by writing x s in the input columns for S1 and S0. EN S1 S0 Q0 Q1 Q2 Q3 0 x x 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 Decoders 12

Blocks and abstraction Decoders are common enough that we want to encapsulate them and treat them as an individual entity. Block diagrams for 2-to-4 decoders are shown here. The names of the inputs and outputs, not their order, is what matters. Q0 = S1 S0 Q1 = S1 S0 Q2 = S1 S0 Q3 = S1 S0 A decoder block provides abstraction: You can use the decoder as long as you know its truth table or equations, without knowing exactly what s inside. It makes diagrams simpler by hiding the internal circuitry. It simplifies hardware reuse. You don t have to keep rebuilding the decoder from scratch every time you need it. These blocks are like functions in programming! Decoders 13

A 3-to-8 decoder Larger decoders are similar. Here is a 3-to-8 decoder. The block symbol is on the right. A truth table (without EN) is below. Output equations are at the bottom right. Again, only one output is true for any input combination. S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 Q0 = S2 S1 S0 Q1 = S2 S1 S0 Q2 = S2 S1 S0 Q3 = S2 S1 S0 Q4 = S2 S1 S0 Q5 = S2 S1 S0 Q6 = S2 S1 S0 Q7 = S2 S1 S0 Decoders 14

So what good is a decoder? Do the truth table and equations look familiar? S1 S0 Q0 Q1 Q2 Q3 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 Q0 = S1 S0 Q1 = S1 S0 Q2 = S1 S0 Q3 = S1 S0 Decoders are sometimes called minterm generators. For each of the input combinations, exactly one output is true. Each output equation contains all of the input variables. These properties hold for all sizes of decoders. This means that you can implement arbitrary functions with decoders. If you have a sum of minterms equation for a function, you can easily use a decoder (a minterm generator) to implement that function. Decoders 15

Design example: addition Let s make a circuit that adds three 1-bit inputs X, Y and Z. We will need two bits to represent the total; let s call them C and S, for carry and sum. Note that C and S are two separate functions of the same inputs X, Y and Z. Here are a truth table and sum-of-minterms equations for C and S. 0 + 1 + 1 = 10 X Y Z C S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 C(X,Y,Z) = m(3,5,6,7) 0 1 1 1 0 S(X,Y,Z) = m(1,2,4,7) 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 1 + 1 + 1 = 11 Decoders 16

Decoder-based adder Here, two 3-to-8 decoders implement C and S as sums of minterms. C(X,Y,Z) = m(3,5,6,7) S(X,Y,Z) = m(1,2,4,7) The +5V symbol ( 5 volts ) is how you represent a constant 1 or true in LogicWorks. We use it here so the decoders are always active. Decoders 17

Using just one decoder Since the two functions C and S both have the same inputs, we could use just one decoder instead of two. C(X,Y,Z) = m(3,5,6,7) S(X,Y,Z) = m(1,2,4,7) Decoders 18

Building a 3-to-8 decoder You could build a 3-to-8 decoder directly from the truth table and equations below, just like how we built the 2-to-4 decoder. Another way to design a decoder is to break it into smaller pieces. Notice some patterns in the table below: When S2 = 0, outputs Q0-Q3 are generated as in a 2-to-4 decoder. When S2 = 1, outputs Q4-Q7 are generated as in a 2-to-4 decoder. S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 Q0 = S2 S1 S0 = m 0 Q1 = S2 S1 S0 = m 1 Q2 = S2 S1 S0 = m 2 Q3 = S2 S1 S0 = m 3 Q4 = S2 S1 S0 = m 4 Q5 = S2 S1 S0 = m 5 Q6 = S2 S1 S0 = m 6 Q7 = S2 S1 S0 = m 7 Decoders 19

Decoder expansion You can use enable inputs to string decoders together. Here s a 3-to-8 decoder constructed from two 2-to-4 decoders: S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 Decoders 20

Modularity Be careful not to confuse the inner inputs and outputs of the 2-to-4 decoders with the outer inputs and outputs of the 3-to-8 decoder (which are in boldface). This is similar to having several functions in a program which all use a formal parameter x. You could verify that this circuit is a 3-to-8 decoder, by using equations for the 2-to-4 decoders to derive equations for the 3-to-8. Decoders 21

A variation of the standard decoder The decoders we ve seen so far are active-high decoders. EN S1 S0 Q0 Q1 Q2 Q3 0 x x 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 An active-low decoder is the same thing, but with an inverted EN input and inverted outputs. EN S1 S0 Q0 Q1 Q2 Q3 0 0 0 0 1 1 1 0 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 x x 1 1 1 1 Decoders 22

Separated at birth? Active-high decoders generate minterms, as we ve already seen. Q3 = S1 S0 Q2 = S1 S0 Q1 = S1 S0 Q0 = S1 S0 The output equations for an active-low decoder are mysteriously similar, yet somehow different. Q3 = (S1 S0) = S1 + S0 Q2 = (S1 S0 ) = S1 + S0 Q1 = (S1 S0) = S1 + S0 Q0 = (S1 S0 ) = S1 + S0 It turns out that active-low decoders generate maxterms. Decoders 23

Active-low decoder example So we can use active-low decoders to implement arbitrary functions too, but as a product of maxterms. For example, here is an implementation of the function from the previous page, f(x,y,z) = M(4,5,7), using an active-low decoder. The ground symbol connected to EN represents logical 0, so this decoder is always enabled. Remember that you need an AND gate for a product of sums. Decoders 24

Summary A n-to-2 n decoder generates the minterms of an n-variable function. As such, decoders can be used to implement arbitrary functions. Later on we ll see other uses for decoders too. Some variations of the basic decoder include: Adding an enable input. Using active-low inputs and outputs to generate maxterms. We also talked about: Applying our circuit analysis and design techniques to understand and work with decoders. Using block symbols to encapsulate common circuits like decoders. Building larger decoders from smaller ones. Decoders 25