CSE140: Components and Design Techniques for Digital Systems. Introduction. Instructor: Mohsen Imani

Similar documents
CSE140: Components and Design Techniques for Digital Systems. Introduction. Prof. Tajana Simunic Rosing

Combinational Logic. Review of Combinational Logic 1

Switches: basic element of physical implementations

CPE100: Digital Logic Design I

Lecture A: Logic Design and Gates

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

EECS Variable Logic Functions

EEE130 Digital Electronics I Lecture #4

Chapter 2: Switching Algebra and Logic Circuits

Administrative Notes. Chapter 2 <9>

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

Intro To Digital Logic

Floating Point Representation and Digital Logic. Lecture 11 CS301

Chapter 2 Combinational logic

Contents. Chapter 2 Digital Circuits Page 1 of 30

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

CS 226: Digital Logic Design

Lecture 2 Review on Digital Logic (Part 1)

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

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

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

Number System conversions

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

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

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

Combinational Logic Design Principles

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

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

L2: Combinational Logic Design (Construction and Boolean Algebra)

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

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

Lecture 22 Chapters 3 Logic Circuits Part 1

Digital Circuit And Logic Design I. Lecture 3

Possible logic functions of two variables

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

SAMPLE ANSWERS MARKER COPY

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

Introduction to Computer Engineering ECE 203

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

Combinational Logic Fundamentals

Slides for Lecture 10

Chapter 2 Boolean Algebra and Logic Gates

Chapter 2: Boolean Algebra and Logic Gates

CHAPTER1: Digital Logic Circuits Combination Circuits

Cs302 Quiz for MID TERM Exam Solved

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

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Chapter 1 :: From Zero to One

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Chap 2. Combinational Logic Circuits

Combinational Logic (mostly review!)

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

ELCT201: DIGITAL LOGIC DESIGN

MC9211 Computer Organization

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

EC-121 Digital Logic Design

CprE 281: Digital Logic

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

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

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

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

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

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

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

CPE100: Digital Logic Design I

Week-I. Combinational Logic & Circuits

CprE 281: Digital Logic

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

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

211: Computer Architecture Summer 2016

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

Computer Organization: Boolean Logic

ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2

KP/Worksheets: Propositional Logic, Boolean Algebra and Computer Hardware Page 1 of 8

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

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

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

Chapter-2 BOOLEAN ALGEBRA

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

Lab 1 starts this week: go to your session

Chapter 2 Combinational Logic Circuits

Fundamentals of Computer Systems

CPE100: Digital Logic Design I

Logic Design. Chapter 2: Introduction to Logic Circuits

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

Unit 8A Computer Organization. Boolean Logic and Gates

Fundamentals of Computer Systems

Boolean Algebra and Logic Gates

CS61c: Representations of Combinational Logic Circuits

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

CSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing

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

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

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

CHAPTER III BOOLEAN ALGEBRA

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

Chapter 2. Boolean Algebra and Logic Gates

CSE 140, Lecture 2 Combinational Logic CK Cheng CSE Dept. UC San Diego

Standard Expression Forms

Transcription:

CSE4: Components and Design Techniques for Digital Systems Introduction Instructor: Mohsen Imani Slides from: Prof.Tajana Simunic Rosing & Dr.Pietro Mercati

Welcome to CSE 4! Instructor: Mohsen Imani Email: moimani@ucsd.edu; please put CSE4 in the subject line Class: Tue/Thr :am-:5pm at PCYNH 22 Office Hours: Tue 3-5pm CSE 227 Discussion sessions: Tue/Thr -am at PCYNH 22 Course website: https://cseweb.ucsd.edu/classes/su7_2/cse4-a/index.html Announcements and online discussion: https://piazza.com SIGN UP SOON!!!! TAs and Tutors: Office hours listed on the class website/piazza

Grading: Grading Class participation using iclicker: 5% 4 Homeworks: 5% each Midterm: 3% Final: 45% Homeworks are out on Tuesdays and are due on the following Tuesday before am Tue discussion session will go over the HW solution Submission via gradescope: https://gradescope.com/ Only a subset of problems will be graded Late submissions will not be accepted! Homework will be out right after this class

Academic Honesty Some Class Policies Studying together in groups is encouraged Turned-in work must be completely your own Both giver and receiver are equally culpable Cheating on HW/ exams: F in the course. Any instance of cheating will be referred to Academic Integrity Office

Textbooks and Recommended Readings Recommended textbook: digital design by F. Vahid Other recommended textbooks: Digital Design by F. Vahid Digital Design & Computer Arch. by David & Sarah Harris Contemporary Logic Design by R. Katz & G. Borriello Lecture slides are derived from the slides designed for all three books

CSE4 & other CSE classes A pplication S oftw are Layers of abstraction program s O perating S ystem s device drivers CSE 3 CSE 4 CSE 4 focus of this course A rchitecture M icroarchitecture Logic D igital C ircuits instructions registers datapaths controllers adders m em ories A N D gates N O T gates Abstraction: A way to simplify by hiding details from other layers A nalog C ircuits D evices P h ys ic s am plifiers filte rs transistors diodes electrons

Why Study Digital Design? Look under the hood of your processors You become a better programmer when you understand hardware your code runs on Nvidia Tegra 2 die photo

The Scope of CSE4 We start with Boolean algebra Y = A and B End up with the design of a simple CPU What s next? CSE4 more complex CPU architectures Nvidia Tegra 2 die photo

Lets get started! Number representations Analog vs. Digital Digital representations: Binary, Hexadecimal, Octal Switches, MOS transistors, Logic gates What is a switch How a transistor operates Logic gates Building larger functions from logic gates Universal gates Boolean algebra Properties How Boolean algebra can be used to design logic circuits

What Does Digital Mean? Analog signal Infinite possible values Ex: voltage on a wire created by microphone Digital signal Finite possible values Ex: button pressed on a keypad Sound waves microphone value move the membrane, which moves the magnet, which creates current in the nearby wire analog signal Possible values:.,., 2.9,... infinite possibilities Which is analog? A) Wind speed B) Radio Signal C) Clicker response D) A) & B) E) All of the above value 4 3 2 2 3 4 2 digital signal Possible values:,, 2, 3, or 4. That s it. time time

Encoding Numbers Base & 2 Each position represents a quantity; symbol in position means how many of that quantity Base ten (decimal) Ten symbols:,, 2,..., 8, and 9 More than 9 -- next position So each position power of Nothing special about base -- used because we have fingers Base two (binary) Two symbols: and More than -- next position So each position power of 2 Decimal to binary: - Divide by two - Report the reminder - Concatenate the reminders NUMBER 523 26 3 65 32 6 8 4 2 REMINDER 523 =

Encoding Numbers Base & 2 Each position represents a quantity; symbol in position means how many of that quantity Base ten (decimal) Ten symbols:,, 2,..., 8, and 9 More than 9 -- next position So each position power of Nothing special about base -- used because we have fingers Base two (binary) Two symbols: and More than -- next position So each position power of 2 Binary to decimal: - Each position is a power of 2 - Sum up all the powers of 2 where you have a 9 8 7 6 5 4 3 2 2 + 2 + 2 + 2 = 523

Bases Sixteen & Eight hex 2 3 4 5 6 7 6 4 6 3 6 2 binary 8 A F 8 6 6 A F hex 8 9 A B C D E F binary Base sixteen Used as compact way to write binary numbers Basic digits: -9, A-F Known as hexadecimal, or just hex Base eight Basic digits: -7 Known as octal octal 2 3 4 5 6 7 8 4 8 3 8 2 binary 4 2 7 4 8 8 2 7

Bases Sixteen & Eight hex 2 3 4 5 6 7 binary hex binary Hexadecimal to binary: 8 9 - Expand each hexadecimal digit into the corresponding binary string A B C D E F 8 A F = Binary to hexadecimal: - Pad the binary string with zeros on the left until you have a number of digits multiple of 4 - Group digits 4-by-4 starting from the right and convert into the corresponding hexadecimal symbol 2 D

Question AB is a hex value. What s the equivalent value in Octal? A. 534 B. 526 C. AB D. 342 E. None

Question 38 is a decimal value. What s the equivalent value in hex? A. 6 B. 2A C. 4 D. E. None

Combinational circuit building blocks: Switches & CMOS transistors

CMOS circuit CMOS Switches Consists of N and PMOS transistors Both N and PMOS are similar to basic switches A positive voltage here......attracts electrons here, turning the channel between source and drain into a conductor. nmos gate source gate oxide drain IC package conducts d o e s n o t conduct pmos gate (a) IC Silicon -- not quite a conductor or insulator: Semiconductor does not conduct conducts

Transistor Circuit Design nmos: Turns on when gate is connected to When turned on, nmos passes zeros well, but not ones, so connect source to GND nmos forms a pull-down network pmos: Turns on when gate is connected to When turned on, pmos passes ones well, but not zeros, so connect source to V DD pmos forms a pull-up network Note: Vahid s textbook shows some circuits with pmos connected to GND and nmos to Vdd: this is NOT normally done in practice! inputs V DD pmos pull-up network nmos pull-down network output

CMOS Switches The following is true for CMOS switches: A. nmos turns on when gate is connected to logic B. pmos is an open switch when gate is connect to logic C. All of the above D. None of the above A positive voltage here......attracts electrons here, turning the channel between source and drain into a conductor. nmos g a t e gate source oxide drain IC package pmos gate (a) IC

Logic gates: CMOS NOT Gate NOT V DD A Y = A Y A P Y N A Y GND A P N Y

CMOS Two Input NAND Gate A B NAND Y = AB Y A B Y V DD P2 P Y A B N N2 GND A B P P2 N N2 Y

Common Logic Gates a b AND a b a b OR a+b a NOT a a BUF a (a b) (a+b) ab + a b ab + a b A B Y N2 N P2 P V DD A Y GND N P a b NAND a b NOR a b XNOR a b XOR

B = {, } Variables represent or only Operators return or only Basic operators Boolean algebra Intersection: is logical AND: a AND b returns only when a= & b= Union: + is logical OR: a OR b returns if either a= or b= (or both) Complement: is logical NOT: NOT a returns the opposite of a AND OR NOT BUFFER a b a b AND Derived operators: a+b a b OR NAND NOR XOR XNOR a b NAND (a b) (a+b) a b NOR a a a b NOT XOR a a a b BUF XNOR

Boolean Algebra X and Y are Boolean variables with X=, Y= What is X+X+Y? A. B. C. 2 D. None of the above

BREAK!

Universal Gate: NAND Any logic function can be implemented using just NAND gates. Boolean algebra s basic operators are AND, OR and NOT https://en.wikipedia.org/wiki/nand_logic

F= A + B C Gate level Implementation

F= (A+B).(C+D) Gate level Implementation What s the minimum number of NAND gates to implement this function? A. 4 B. 8 C. 6 D.

Universal Gate: NOR Any logic function can be implemented using just NOR gates. Boolean algebra needs AND, OR and NOT https://en.wikipedia.org/wiki/nor_logic

Boolean Axioms & Theorems

Boolean theorems of multiple variables

Boolean Duality Derived by replacing by +, + by, by, and by & leaving variables unchanged Generalized duality: X + Y +... X Y... f (X,X 2,...,X n,,,+, ) f(x,x 2,...,X n,,,,+) Any theorem that can be proven is also proven for its dual! Note: this is NOT demorgan s Law

Covering Theorem Explained Covering Theorem: A*(A+B) = A+A*B = A Venn Diagrams

Combining Theorem Explained Combining Theorem: AB+AB = (A+B)*(A+B ) = A

Proving theorems with Boolean Algebra Using the axioms of Boolean algebra: e.g., prove the consensus theorem: X Y + X Y = X distributivity X Y + X Y = X (Y + Y ) complementarity X (Y + Y ) = X () identity X () = X e.g., prove the covering theorem: X + X Y = X identity X + X Y = X + X Y distributivity X + X Y = X ( + Y) identity X ( + Y) = X () identity X () = X

Consensus Theorem of 3 Variables Consensus Theorem: AB+B C+AC = AB+B C

Proof of Consensus Theorem with Boolean Algebra Consensus Theorem: (X Y) + (Y Z) + (X Z) = X Y + X Z (X Y) + (Y Z) + (X Z) identity (X Y) + () (Y Z) + (X Z) complementarity (X Y) + (X + X) (Y Z) + (X Z) distributivity (X Y) + (X Y Z) + (X Y Z) + (X Z) commutativity (X Y) + (X Y Z) + (X Y Z) + (X Z) factoring (X Y) ( + Z) + (X Z) ( + Y) null (X Y) () + (X Z) () identity (X Y) + (X Z)

Applying Boolean Algebra Theorems Which of the following is CB+BA+C A equal to? A. AB+AC B. BC+AC C. AB+BC D. None of the above

DeMorgan s Theorem (Bubble Pushing) Y = AB = A + B A B A B Y Y Y = A + B = A B A B A B Y Y

Example of Transforming Circuits with Bubble Pushing 42

F = X Y + Z Implement using only NORs

Proving Theorems with Perfect Induction Using perfect induction = complete the truth table: e.g., de Morgan s: (X + Y) = X Y NOR is equivalent to AND with inputs complemented X Y X Y (X + Y) X Y (X Y) = X + Y NAND is equivalent to OR with inputs complemented X Y X Y (X Y) X + Y

Specifying Logic Problems with Truth Tables Half Adder: Truth table -> Boolean Eq. -> Logic Circuit a Truth Table a b carry sum b Sum Carry 45

Going from a Truth Table to a Boolean Equation Truth Table a b carry sum Boolean Equation: Sum (a, b) = a b + ab = = a XOR b Carry (a, b) = ab 46

How do we get a Boolean Equation from the Truth Table? Truth Table a b carry sum How? Boolean Equation Sum (a, b) = a b + ab Carry (a, b) = ab 47

Need Some Definitions Complement: variable with a bar over it or a A, B, C Literal: variable or its complement A, A, B, B, C, C Implicant: product of literals ABC, AC, BC Implicate: sum of literals (A+B+C), (A+C), (B+C) Minterm: AND that includes all input variables ABC, A BC, AB C Maxterm: OR that includes all input variables (A+B+C), (A +B+C), (A +B +C) 48

Minterms of Two Input Functions A B Minterm Maxterm A B A B AB AB A+B A+B A +B A +B

CSE4: Components and Design Techniques for Digital Systems Canonical representation 5

Canonical Form -- Sum of Minterms Truth tables are too big for numerous inputs Use standard form of equation instead Known as canonical form Regular algebra: group terms of polynomial by power ax 2 + bx + c (3x 2 + 4x + 2x 2 + 3 + --> 5x 2 + 4x + 4) Boolean algebra: create a sum of minterms (or a product of maxterms) 5

Canonical form? Is F(a,b)=ab+a in canonical form? A) True B) False 52

Sum-of-products Canonical Form Also known as disjunctive normal form Minterm expansion: F = F = A B C + A BC + AB C + ABC + ABC A B C F F F = A B C + A BC + AB C 53

Sum-of-products canonical form (cont d) Product minterm ANDed product of literals input combination for which output is each variable appears exactly once, true or inverted (but not both) You can write a canonical form in multiple ways A B C minterms A B C m A B C m A BC m2 A BC m3 AB C m4 AB C m5 ABC m6 ABC m7 short-hand notation for minterms of 3 variables F F in canonical form: F(A, B, C) = m(,3,5,6,7) = m + m3 + m5 + m6 + m7 = A B C + A BC + AB C + ABC + ABC canonical form minimal form F(A, B, C) = A B C + A BC + AB C + ABC + ABC = (A B + A B + AB + AB)C + ABC = ((A + A)(B + B))C + ABC = C + ABC = ABC + C = AB + C 54

Sum of Products Canonical Form Minterm A B Carry Sum A B A B AB AB I. sum(a,b) = II. carry(a,b)= 55

Sum of Products Canonical Form A B Y Does the following SOP canonical expression correctly express the above truth table: A.Yes B.No Y(A,B)= Σm(2,3) 56

Product-of-sums canonical form Also known as conjunctive normal form Also known as maxterm expansion Implements zeros of a function A B C F F F = F = (A + B + C) (A + B + C) (A + B + C) F = (A + B + C ) (A + B + C ) (A + B + C ) (A + B + C) (A + B + C ) 57

Product-of-sums canonical form (cont d) Sum term (or maxterm) ORed sum of literals input combination for which output is false each variable appears exactly once, true or inverted (but not both) A B C maxterms A+B+C M A+B+C M A+B +C M2 A+B +C M3 A +B+C M4 A +B+C M5 A +B +C M6 A +B +C M7 F F in canonical form: F(A, B, C) = M(,2,4) = M M2 M4 = (A + B + C) (A + B + C) (A + B + C) canonical form minimal form F(A, B, C) = (A + B + C) (A + B + C) (A + B + C) = (A + B + C) (A + B + C) (A + B + C) (A + B + C) = (A + C) (B + C) short-hand notation for maxterms of 3 variables 58

What we reviewed thus far: Summary Number representations Switches, logic gates Universal gates Boolean algebra Using Boolean algebra to simplify Boolean equations There is an easier way! What is next: Combinational logic: Minimization (the easier way) Designs of common combinational circuits Adders, comparators, subtractors, multipliers, etc.

Claude Shannon: Historical Note In 936, Shannon began his graduate studies in electrical engineering at MIT While studying the complicated ad hoc circuits of this analyzer, Shannon designed switching circuits based on Boole's concepts. In 937, he wrote his master's degree thesis, A Symbolic Analysis of Relay and Switching Circuits, [9] A paper from this thesis was published in 938. [] In this work, Shannon proved that his switching circuits could be used to simplify the arrangement of the electromechanical relays that were used then in telephone call routing switches. Next, he expanded this concept, proving that these circuits could solve all problems that Boolean algebra could solve. In the last chapter, he presents diagrams of several circuits, including a 4-bit full adder. [9] Using this property of electrical switches to implement logic is the fundamental concept that underlies all electronic digital computers https://en.wikipedia.org/wiki/claude_shannon#logic_circuits http://www.maa.org/press/periodicals/convergence/applications-of-boolean-algebra-claude-shannon-and-circuit-design