Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Similar documents
CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Fundamentals of Digital Design

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

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

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

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

ELEN Electronique numérique

UNIVERSITY OF WISCONSIN MADISON

CHAPTER1: Digital Logic Circuits Combination Circuits

Latches. October 13, 2003 Latches 1

UNIVERSITI TENAGA NASIONAL. College of Information Technology

211: Computer Architecture Summer 2016

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

CPE100: Digital Logic Design I

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

Lecture 3 Review on Digital Logic (Part 2)

Sample Test Paper - I

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

ECE 341. Lecture # 3

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

CS61C : Machine Structures

Gates and Flip-Flops

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

CS61C : Machine Structures

Philadelphia University Student Name: Student Number:

Combinational Logic Design Combinational Functions and Circuits

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

CS 226: Digital Logic Design

Chapter 7 Logic Circuits

DIGITAL LOGIC CIRCUITS

Adders, subtractors comparators, multipliers and other ALU elements

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

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

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Lecture 22 Chapters 3 Logic Circuits Part 1

CS/COE0447: Computer Organization

Lecture 7: Logic design. Combinational logic circuits

Adders, subtractors comparators, multipliers and other ALU elements

Synchronous Sequential Logic

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Combinational Logic. Review of Combinational Logic 1


Digital Logic Appendix A

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

CPE100: Digital Logic Design I

Floating Point Representation and Digital Logic. Lecture 11 CS301

Chapter 7. Sequential Circuits Registers, Counters, RAM

Sequential vs. Combinational

ELCT201: DIGITAL LOGIC DESIGN

Combinational Logic. By : Ali Mustafa

CSC9R6 Computer Design. Practical Digital Logic

CS/COE0447: Computer Organization

KUMARAGURU COLLEGE OF TECHNOLOGY COIMBATORE

Sequential Circuit Analysis

Mealy & Moore Machines

Lecture 10: Synchronous Sequential Circuits Design

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

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

CprE 281: Digital Logic

Chapter 3 Digital Logic Structures

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

EE 209 Logic Cumulative Exam Name:

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

COMBINATIONAL LOGIC FUNCTIONS

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

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

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

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

Decoding A Counter. svbitec.wordpress.com 1

Digital Logic (2) Boolean Algebra

ECE 2300 Digital Logic & Computer Organization

Fundamentals of Boolean Algebra

Design of Sequential Circuits

SRC Language Conventions. Class 6: Intro to SRC Simulator Register Transfers and Logic Circuits. SRC Simulator Demo. cond_br.asm.

CprE 281: Digital Logic

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Sequential Logic Circuits

CS470: Computer Architecture. AMD Quad Core

Boolean Algebra. Philipp Koehn. 9 September 2016

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

Adders allow computers to add numbers 2-bit ripple-carry adder

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

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

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.

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

Transcription:

Digital Logic: Boolean Algebra and Gates Textbook Chapter 3

Basic Logic Gates XOR CMPE12 Summer 2009 02-2

Truth Table The most basic representation of a logic function Lists the output for all possible input combinations How many rows of the truth table needed? Can get big very fast 2 #inputs Inputs A B Outputs X Y CMPE12 Summer 2009 02-3

Truth Table: Inverter Inverted signals are denoted with an overbar Or with a prime symbol A Input Output A Y = A CMPE12 Summer 2009 02-4

Truth Table: AND Gate The result of an AND operation is 1 if and only if all inputs are 1 Depict AND by the multiplication symbol A B Or by lumping the signals together AB We don t really build these gates Inputs A B Output Y = A B CMPE12 Summer 2009 02-5

Truth Table: OR Gate The result of an OR operation is 1 if and only if any inputs are 1 Depict OR by the addition symbol A+B Inputs A B Output Y = A + B CMPE12 Summer 2009 02-6

Sum of Products How do you get from a truth table to a logic expression? Sum of products is standard way of synthesizing simple circuits Procedure: 1. Find the rows with the 1 output 2. Write the product-form expression for the inputs in that row (0=inverted, 1=normal) 3. Combine the products in step 2 into a sum (OR the results of step 2) CMPE12 Summer 2009 02-7

Sum of Products XOR Gate 1. Find the rows with the 1 A B Y output 2. Write the product-form 0 0 0 expression for the inputs in that row (0=inverted, 0 1 1 1=normal) 3. Combine the products in 1 0 1 step 2 into a sum (OR 1 1 0 the results of step 2) CMPE12 Summer 2009 02-8

Product of Sums Procedure: 1. Find the rows with the 0 output 2. Write the sum-form expression for the inputs in that row (0=normal, 1=inverted) 3. Combine the sums in step 2 into a product (AND the results of step 2) Note: we treat 0 and 1 reverse than for SoP CMPE12 Summer 2009 02-9

Examples of SoP and PoS CMPE12 Summer 2009 02-10

De Morgan s Laws Break the line, change the sign Two laws: A + B = (AB) A B = (A+B) CMPE12 Summer 2009 02-11

De Morgan s Laws (A + B) = A B conversely (AB) = A + B Break the line, change the sign A B A+B A+B A B A B 0 0 0 1 1 0 1 1 CMPE12 Summer 2009 02-12

De Morgan s Laws (A + B) = A B conversely (AB) = A + B Break the line, change the sign A B AB AB A B A+B 0 0 0 1 1 0 1 1 CMPE12 Summer 2009 02-13

De Morgan s Laws and SP Generate equivalent circuits NAND/NAND NOR/NOR We prefer NAND/NAND circuits Same transistor count as NOR NANDs are faster CMPE12 Summer 2009 02-14

Logical Completeness Can implement ANY truth table with AND, OR, NOT. A B C D 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 1. AND combinations that yield a "1" in the truth table. 2. OR the results of the AND gates. 3. Is not necessarily a minimal solution. CMPE12 Summer 2009 02-15

More Than Two Inputs? AND and OR gates can take any number of inputs AND gives 1 if all inputs are 1 OR gives 1 if any input is 1 NAND?? NOR?? Not associative! CMPE12 Summer 2009 02-16

Two-Way Multiplexer CMPE12 Summer 2009 02-17

Two-Way Multiplexer 2-way multiplexer: the output is equal to one of the two inputs, based on a selector S A B Y 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 CMPE12 Summer 2009 02-18

Four-Way Multiplexer n-bit selector and 2 n inputs, one output output equals one of the inputs, depending on selector Four-to-one mux CMPE12 Summer 2009 02-19

Two-to-Four Decoder n inputs, 2 n outputs exactly one output is 1 for each possible input pattern Generates a walkingones pattern Uses: Convert memory or register address to a control line Convert an opcode to one of n control lines We will get to this in the LC-3 material CMPE12 Summer 2009 02-20

Binary Addition and Half-Adder 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 =... A half-adder can add 2 bits and produces a sum and carry signal Sum = A xor B Carry = AB CMPE12 Summer 2009 02-21

One-Bit Full Adder A B C in C out S 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 CMPE12 Summer 2009 02-22

Four-Bit Full Adder Ripple-carry adder CMPE12 Summer 2009 02-23

Masking Want to look only at certain bits of a binary word Use a mask to remove the uninteresting bits Example: CMPE12 Summer 2009 02-24

Axioms of Boolean Algebra 0 0 = 1 + 1 = 1 1 = 0 + 0 = 0 1 = 1 0 = 1 + 0 = 0 + 1 = 1 + 0 = 0 + 1 = if x = 0 then x = if x = 1 then x = CMPE12 Summer 2009 02-25

Single-Variable Theorems x 0 = x + 1 = x 1 = x + 0 = x x = x + x = x x = x + x = (x ) = CMPE12 Summer 2009 02-26

Properties of Boolean Algebra Commutative x y = x + y = Associative x (y z) = x + (y + z) = Distributive x (y + z ) = x + y z = CMPE12 Summer 2009 02-27

Properties of Boolean Algebra Absorption x + x y = x (x + y) = Combining x y + x y = (x + y) (x + y ) = CMPE12 Summer 2009 02-28

Properties of Boolean Algebra De Morgan s Laws (x y) = (x + y) = Other x + x y = x (x + y) = CMPE12 Summer 2009 02-29

Logic Minimization A B C Y 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 CMPE12 Summer 2009 02-30

Combinational vs. Sequential Two types of combination locks 4 1 8 4 25 20 30 15 5 10 Combinational Success depends only on the values, not the order in which they are set. Sequential Success depends on the sequence of values (e.g, R-13, L-22, R-3). CMPE12 Summer 2009 02-32

Combinational vs. Sequential Combinational circuit Always gives the same output for a given set of inputs Example: Adder always generates sum and carry, regardless of previous inputs Sequential circuit Remembers previous input Output depends on state and input CMPE12 Summer 2009 02-33

Reset-Set (RS) Latch or SR Two inputs: Set and Reset Set to 0 one of the two inputs at a time to store a value, S sets, R clears The transition to 00 generates an undefined output CMPE12 Summer 2009 02-35

R-S Latch CMPE12 Summer 2009 02-36

D-Latch D-latch (D for data) is a gated RS latch Two inputs: D (data) and WE (write enable) D D Q Q WE WE CMPE12 Summer 2009 02-37

D-Latch: Timing Diagram D WE D Q E Q WE 1 0 time D 1 0 time Q 1 0 time CMPE12 Summer 2009 02-38

D-Flip-Flop Two D-latches hooked together Connect one latch to the inverted clock D-flip-flop is edgetriggered (changes only on the edge of the clock) Also called edgetriggered d-latch This is an example of an edge trigged DFF with an enable D WE Ck D Q E Q CMPE12 Summer 2009 02-39

D-Flip Flop: Timing Diagram Ck 1 0 time D WE Ck D Q E Q WE 1 0 time D 1 0 time Q 1 0 time CMPE12 Summer 2009 02-40

D-Flip Flops in a Pipeline 1 Ck 0 time D WE D Q E D Q E WE 1 0 time Ck D Q 1 0 time Q 1 0 time Q 1 0 time CMPE12 Summer 2009 02-41

Register A register stores a multi-bit value Common WE which latches the n-bit value CMPE12 Summer 2009 02-42

Memory Now that we know how to store bits, we can build a memory a logical k m array of stored bits. Address Space: number of locations (usually a power of 2) Addressability: number of bits per location (e.g., byte-addressable) k = 2 n locations m bits CMPE12 Summer 2009 02-43

2 2 x 3 Memory address word select word WE input bits write enable address decoder output bits CMPE12 Summer 2009 02-44

State Machine The basic type of sequential circuit Combines combinational logic with storage Remembers state, and changes output (and state) based on inputs and current state State Machine Inputs Combinational Logic Circuit Outputs Storage Elements CMPE12 Summer 2009 02-45

Example of sequential machine Combinational lock R13, L22, R3: CMPE12 Summer 2009 02-46

Representing Multi-bit Values Number bits from right (0) to left (n-1) just a convention -- could be left to right, but must be consistent Use brackets to denote range: D[l:r] denotes bit l to bit r, from left to right 15 A = 0101001101010101 0 A[14:9] = 101001 A[2:0] = 101 May also see A<14:9>, especially in hardware block diagrams. CMPE12 Summer 2009 02-47

LC-3 Data Path Combinational Logic Storage State Machine CMPE12 Summer 2009 02-48