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

Similar documents
Lecture 22 Chapters 3 Logic Circuits Part 1

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

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

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

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

Floating Point Representation and Digital Logic. Lecture 11 CS301

211: Computer Architecture Summer 2016

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

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

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

CS/COE0447: Computer Organization and Assembly Language

Fundamentals of Digital Design

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

CHAPTER1: Digital Logic Circuits Combination Circuits

Organisasi dan Arsitektur Komputer L#1: Fundamental Concepts Amil A. Ilham

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

DIGITAL LOGIC CIRCUITS

CSC9R6 Computer Design. Practical Digital Logic

Intro To Digital Logic

DIGITAL LOGIC CIRCUITS

UNIVERSITY OF WISCONSIN MADISON

CS 226: Digital Logic Design

Chapter 7 Logic Circuits

Sample Test Paper - I

CS470: Computer Architecture. AMD Quad Core

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

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

Computer organization

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

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

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

Unit 8A Computer Organization. Boolean Logic and Gates

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Switches: basic element of physical implementations

COMBINATIONAL LOGIC FUNCTIONS

Section 3: Combinational Logic Design. Department of Electrical Engineering, University of Waterloo. Combinational Logic

CMSC 313 Lecture 15 Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Slides for Lecture 19

Learning Objectives 10/7/2010. CE 411 Digital System Design. Fundamental of Logic Design. Review the basic concepts of logic circuits. Dr.

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

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

ECE/CS 250 Computer Architecture

CMSC 313 Lecture 18 Midterm Exam returned Assign Homework 3 Circuits for Addition Digital Logic Components Programmable Logic Arrays

COMP2611: Computer Organization. Introduction to Digital Logic

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Combinational Logic Design Combinational Functions and Circuits

CS61C : Machine Structures

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

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

Lecture 7: Logic design. Combinational logic circuits

This form sometimes used in logic circuit, example:

Philadelphia University Student Name: Student Number:

CPE100: Digital Logic Design I

CMSC 313 Lecture 16 Announcement: no office hours today. Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

CS61C : Machine Structures

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

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

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

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

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

Systems I: Computer Organization and Architecture

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

Logic Design Combinational Circuits. Digital Computer Design

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

CHAPTER 7. Exercises 17/ / /2 2 0

Chapter 2 Boolean Algebra and Logic Gates

MC9211 Computer Organization

CprE 281: Digital Logic

Digital Logic Appendix A

University of Guelph School of Engineering ENG 2410 Digital Design Fall There are 7 questions, answer all questions.

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

CS/COE0447: Computer Organization

Latches. October 13, 2003 Latches 1

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

Boolean Algebra, Gates and Circuits

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

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

Standard Expression Forms

Cs302 Quiz for MID TERM Exam Solved

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

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


EC-121 Digital Logic Design

Chapter 2: Boolean Algebra and Logic Gates

Boolean Algebra and Logic Simplification

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

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

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

Computer Organization: Boolean Logic

Chap 2. Combinational Logic Circuits

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

CS/COE0447: Computer Organization

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

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

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

3 Logic Function Realization with MSI Circuits

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

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

Design of Sequential Circuits

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

Transcription:

CS211 Computer Architecture Digital Logic l Topics l Transistors (Design & Types) l Logic Gates l Combinational Circuits l K-Maps Figures & Tables borrowed from:! http://www.allaboutcircuits.com/vol_4/index.html!

Class Checkpoint l What have discussed up until now & why: l C Programming language l More low-level then Java. l Better idea about what s really going on. l Covered data representation l Computers manipulate data. How is this data stored and manipulated? l Covered Machine-Level representation of programs (assembly lanaguage - x86) l Computers don t work on C code (or Java). Need instructions closer to hardware. l What s next? Processor Design how does machine instructions actually make the processor work?

But first l Before we go into processor design, we re going to cover some topics in Digital Logic. l Book covers this only sparingly, we re going to go into a bit more detail. l Specifically: l Transistors l Logic gates l Combinational & Sequential Circuits l Flip-Flops l Memory

Transistor: Building Block of Computers l Microprocessors contain millions of transistors l Intel Pentium 4 (2000): 48 million l IBM PowerPC 750FX (2002): 38 million l IBM/Apple PowerPC G5 (2003): 58 million l Logically, each transistor acts as a switch l Combined to implement logic functions l AND, OR, NOT l Combined to build higher-level structures l Adder, multiplexer, decoder, register, l Combined to build processor

Simple Switch Circuit l Switch open: l No current through circuit l Light is off l V out is +2.9V l Switch closed: l Short circuit across switch l Current flows l Light is on l V out is 0V Switch-based circuits can easily represent two states: on/off, open/closed, voltage/no voltage.

n-type MOS Transistor l MOS = Metal Oxide Semiconductor l two types: n-type and p-type l n-type l when Gate has positive voltage, short circuit between #1 and #2 (switch closed) l when Gate has zero voltage, open circuit between #1 and #2 (switch open) Gate = 1 Terminal #2 must be connected to GND (0V). Gate = 0

p-type MOS Transistor l p-type is complementary to n-type l when Gate has positive voltage, open circuit between #1 and #2 (switch open) l when Gate has zero voltage, short circuit between #1 and #2 (switch closed) Gate = 1 Terminal #1 must be connected to +2.9V. Gate = 0

Inverter (NOT Gate) Truth table In Out 0 V 2.9 V 2.9 V 0 V In Out 0 1 1 0

NOR Gate A B C 0 0 1 0 1 0 1 0 0 1 1 0 Note: Serial structure on top, parallel on bottom.

OR Gate A B C 0 0 0 0 1 1 1 0 1 1 1 1 Add inverter to NOR.

NAND Gate (NOT(AND)) A B C 0 0 1 0 1 1 1 0 1 1 1 0 Note: Parallel structure on top, serial on bottom.

AND Gate A B C 0 0 0 0 1 0 1 0 0 1 1 1 Add inverter to NAND.

Basic Logic Gates Symbols XOR A O + B

XOR: truth table A^B A B 0 0 0 0 1 1 1 0 1 1 1 0 A XOR B + - - A^B= A & B + A&B

DeMorgan's Law l NOT (A and B) = NOT (A) OR NOT (B) l NOT (A OR B) = NOT(A) AND NOT (B) A BB NOT(A AND B) NOT (A) NOT (B) 0 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 NOT(A) OR NOT(B)

DeMorgan's Law l Converting AND to OR (with some help from NOT) l Consider the following gate: To convert AND to OR (or vice versa), invert inputs and output. A B A B A B A B 0 0 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 Same as A OR B

More than 2 Inputs? l AND/OR can take any number of inputs. l AND = 1 if all inputs are 1. l OR = 1 if any input is 1. l Similar for NAND/NOR. l Can implement with multiple two-input gates, or with single CMOS circuit.

Building Functions from Logic Gates l Combinational Logic Circuit l output depends only on the current inputs l stateless l Sequential Logic Circuit l output depends on the sequence of inputs (past and present) l stores information (state) from past inputs l We'll first look at some useful combinational circuits, then show how to use sequential circuits to store

Half adder l A half adder is used to add just two bits. l The result consists of two bits: a sum (the right bit) and a carry out (the left bit) l Here is the circuit and its block symbol S X Y CS 0 + 0 = 00 0 + 1 = 01 1 + 0 = 01 1 + 1 = 10 C

Full Adder l Add two bits and carry-in, produce one-bit sum and carry-out. A B C in S C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1

Four-bit Adder (carry-ripple adder) Disadvantage: Delay through N-1 Stages

Carry Save adder l Compute Sum and Carry independently l 101 101 l 101 101 l ------ ---------- l 000 101- l Then add S + C 000 l 101- l ---------------- l 1010

Carry Save adder l Delay reduced compared to Carry ripple adder l Add 3 Numbers and Produce two numbers S and C X: Y: Z: C: 1 0 0 1 1 + 1 1 0 0 1 + 0 1 0 1 1 1 1 0 1 1 l Final result is S + shifted carry X: Y: Z: + + 1 0 0 1 1 1 1 0 0 1 0 1 0 1 1 S: 0 0 0 0 1 C: 1 1 0 1 1 Sum: 1 1 0 1 1 1 X: Y: Z: S: + + 1 0 0 1 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1

Carry Save Adder Design X Y Z X n-1 Y n-1 Z n-1 X n-2 Y n-2 Z n-2 X 0 Y 0 Z 0 CSA FA FA FA n+1 n C n-1 C 1 C n S n-1 S n-2 S 0 C 0 =0 C=carry S=sum + N Bit Carry Save Adder Block

Decoder l n inputs, 2 n outputs l exactly one output is 1 for each possible input pattern 2-bit decoder

Decoder l n inputs, 2 n outputs l exactly one output is 1 for each 0 possible input pattern 1 2-bit decoder 2 3

Selecting Memory A0.. A7 256 x 8 RAM 256 x 8 RAM 256 x 8 RAM 256 x 8 RAM A8 A9 2 to 4 decoder

Multiplexer (MUX) l n-bit selector and 2 n inputs, one output l output equals one of the inputs, depending on selector 4-to-1 MUX

Circuit Design l Designing circuits is a process 1. Have a good idea. What kind of circuit might be useful? 2. Derive a truth table for this circuit. 3. Derive a Boolean expression for the truth table. 4. Build a circuit given the Boolean expression l l Building the circuit involves mapping the Boolean expression to actual gates. This part is easy. Deriving the Boolean expression is easy. Deriving a good one is tricky.

Converting Truth Table to Boolean Expression l Given a circuit, isolate that rows in which the output of the circuit should be true.

Converting Truth Table to Boolean Expression l Given a circuit, isolate that rows in which the output of the circuit should be true. l A product term that contains exactly one instance of every variable is called a minterm.

Converting Truth Table to Boolean Expression l Given the expressions for each row, build a larger Boolean expression for the entire table. l This is a sum-of-products (SOP) form.

Converting Truth Table to Boolean Expression l Finally build the circuit. l Problem: SOP forms are often not minimal. l Solution: Make it minimal. We ll go over two ways.

First Approach: Algebraic l Simply use the rules of Boolean logic

The Result

Karnaugh Maps or K-Maps l K-maps are a graphical technique to view minterms and how they relate. l The map is a diagram made up of squares, with each square representing a single minterm. l Minterms resulting in a 1 are marked as 1, all others are marked 0

2 Variable K-Map

2 Variable K-Map

2 Variable K-Map 0 0 1 1

Finding Commonality

Finding the best solution l Grouping become simplified products. l Both are correct. A+B is preferred.

Simplify Example

Simplify Example

3 Variable K-Maps C l Note in higher maps, several variables occupy a given axis l The sequence of 1s and 0s follow a Gray Code Sequence. B

3 Variable K-Maps

3 Variable K-Maps C B

3 Variable K-Maps

3 Variable K-Maps

3 Variable K-Maps

Back to our earlier example.. l The K-map and the algebraic produce the same result.

Up up and let s keep going D A B C

Few more examples D A B C

Few more examples D A B C