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

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

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

Lecture 2 Review on Digital Logic (Part 1)

Combinational Logic. By : Ali Mustafa

CprE 281: Digital Logic

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

Fundamentals of Digital Design

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

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

Boolean Algebra, Gates and Circuits

Logic Design. Chapter 2: Introduction to Logic Circuits

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

Digital Logic Design ENEE x. Lecture 14

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

CHAPTER1: Digital Logic Circuits Combination Circuits

Chapter 2 Combinational Logic Circuits

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Introduction to Digital Logic Missouri S&T University CPE 2210 Boolean Algebra

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

CprE 281: Digital Logic

Digital System Design Combinational Logic. Assoc. Prof. Pradondet Nilagupta

CSC9R6 Computer Design. Practical Digital Logic

Class Website:

Circuits & Boolean algebra.

ELCT201: DIGITAL LOGIC DESIGN

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

Switches: basic element of physical implementations

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

CS 226: Digital Logic Design

ELCT201: DIGITAL LOGIC DESIGN

Combinational Logic. Review of Combinational Logic 1

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

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

Week-I. Combinational Logic & Circuits

Design of Sequential Circuits


Chap 2. Combinational Logic Circuits

Number System conversions

Chapter 2 Boolean Algebra and Logic Gates

Introduction to Digital Logic Missouri S&T University CPE 2210 Combinatorial Circuit Analysis and Synthesis

Lecture A: Logic Design and Gates

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

CSE 140 Lecture 11 Standard Combinational Modules. CK Cheng and Diba Mirza CSE Dept. UC San Diego

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

MC9211 Computer Organization

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

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

Chapter 2: Switching Algebra and Logic Circuits

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA (CONT.)

EEE130 Digital Electronics I Lecture #4

Systems I: Computer Organization and Architecture

Logic and Boolean algebra

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Digital Logic (2) Boolean Algebra

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Review: Additional Boolean operations

MODULAR CIRCUITS CHAPTER 7

CS61c: Representations of Combinational Logic Circuits

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

Logic Gates and Boolean Algebra

ELCT201: DIGITAL LOGIC DESIGN

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

Hardware Design I Chap. 4 Representative combinational logic

University of Toronto Faculty of Applied Science and Engineering Final Examination

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

Combinational Logic Design Combinational Functions and Circuits

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

Sample Test Paper - I

Boolean Algebra & Logic Gates. By : Ali Mustafa

Boolean Algebra. Philipp Koehn. 9 September 2016

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

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

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

Experiment 7: Magnitude comparators

EC-121 Digital Logic Design

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

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

UNIVERSITY OF CALIFORNIA, RIVERSIDE

Introduction to Digital Logic Missouri S&T University CPE 2210 Boolean Representations

Slides for Lecture 19

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

ENGIN 112 Intro to Electrical and Computer Engineering

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

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

COSC3330 Computer Architecture Lecture 2. Combinational Logic

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

Total Time = 90 Minutes, Total Marks = 100. Total /10 /25 /20 /10 /15 /20

Unit 8A Computer Organization. Boolean Logic and Gates

Digital Circuit And Logic Design I. Lecture 3

1.10 (a) Function of AND, OR, NOT, NAND & NOR Logic gates and their input/output.

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

COMBINATIONAL LOGIC FUNCTIONS

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Chapter 2 Combinational Logic Circuits

211: Computer Architecture Summer 2016

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

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

SAMPLE ANSWERS MARKER COPY

Transcription:

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

Lecture Roadmap Combinational Logic Basic Logic Review Basic Gates De Morgan s Laws Combinational Logic Building Blocks Multiplexers Decoders, Demultiplexers Encoders, Priority Encoders Multipliers Shifters, Rotators 2

Textbook References Combinational Logic Review Stephen Brown and Zvonko Vranesic, Fundamentals of Digital Logic with VHDL Design, 3 rd or 2 nd Edition Chapter 2 Introduction to Logic Circuits (2.-2.8 only) Chapter 6 Combinational-Circuit Building Blocks (6.-6.5 only) OR your undergraduate digital logic textbook (chapters on combinational logic) 3

Basic Logic Review some slides modified from: S. Dandamudi, Fundamentals of Computer Organization and Design 4

Rules If you believe that you know a correct answer, please raise your hand I will select one or more students (independently whether an answer given by the first student is correct or incorrect) Please, identify yourself by first name and give an answer Correct answer = bonus point 5

Problem List all 2-input logic gates that you can recall

Basic Logic Gates (2-input versions) 7

Problem 2 How would you generalize the definitions of 2-input logic gates to N-input logic gates?

Basic Logic Gates Generalized Simple logic gates AND à if one or more inputs is, otherwise AND à if all inputs are, otherwise OR à if one or more inputs is, otherwise OR à if all inputs are, otherwise NAND = AND + NOT if one or more inputs is, otherwise if all inputs are, otherwise NOR = OR + NOT if one or more input is, otherwise if all inputs are, otherwise XOR à if an odd number of inputs is, otherwise XNOR à if an even number of inputs is, otherwise NAND and NOR gates require fewer transistors than AND and OR in standard CMOS 9

Problem 3 How many 2-input logic functions can be theoretically defined (whether they make sense or not)? How many N-input logic functions can be theoretically defined (whether they make sense or not)?

Number of Functions Number of functions With N logical variables, we can define 2 2N functions Some of them are useful AND, NAND, NOR, XOR, Some are not useful: Output is always Output is always Number of functions definition is useful in proving completeness property

Problem 4 List all -input logic gates.

Problem 5 What is a minimum set of gates that can be used to implement any logic function?

Complete Set of Gates Complete sets A set of gates is complete if we can implement any logic function using only the type of gates in the set Some example complete sets {AND, OR, NOT} {AND, NOT} {OR, NOT} {NAND} {NOR} Minimal complete set A complete set with no redundant elements. Not a minimal complete set 4

NAND as a Complete Set Proving NAND gate is universal 5

Problem 6 List four ways of expressing logic functions.

Logic Functions Logic functions can be expressed in several ways: Truth table Logical expressions Graphical schematic form HDL code Example: Majority function Output is one whenever majority of inputs is We use 3-input majority function 7

Alternative Representations of Logic Function Truth table A B C F Logical expression form F = A B + B C + A C Graphical schematic form HDL code: F <= (A AND B) OR (B AND C) OR (A AND C) ; 8

Boolean Algebra Boolean identities Name AND version OR version Identity x. = x x + = x Complement x. x = x + x = Commutative x. y = y. x x + y = y + x Distribution x. (y+z) = xy+xz x + (y. z) = (x+y) (x+z) Idempotent x. x = x x + x = x Null x. = x + = 9

Problem 7 Prove the OR version of the Boolean Distribution identity: x + (y z) = (x+y) (x+z)

Boolean Algebra (cont d) Boolean identities (cont d) Name AND version OR version Involution x = (x ) --- Absorption x. (x+y) = x x + (x. y) = x Associative x. (y. z) = (x. y). z x + (y + z) = (x + y) + z 22

Problem 8 What are the De Morgan s Laws? Write their equations and draw their schematic representation.

De Morgan s Laws Name AND version OR version de Morgan (x. y) = x + y (x + y) = x. y 24

Alternative symbols for NAND and NOR 25

Deriving Equivalent Expressions Using NAND gates Get an equivalent expression A B + C D = (A B + C D) Using de Morgan s law A B + C D = ( (A B). (C D) ) Can be generalized Example: Majority function A B + B C + AC = ((A B). (B C). (AC) ) 26

Majority Function Using AND, OR, NOT 27

Majority Function Using NAND 28

Majority Function Using NAND 29

Combinational Logic Building Blocks Some slides modified from: S. Dandamudi, Fundamentals of Computer Organization and Design S. Brown and Z. Vranesic, "Fundamentals of Digital Logic" 3

Problem 9 How many select inputs does an 8-to- MUX have? How many select inputs does an n-to- MUX have?

Multiplexers log 2 n selection inputs n inputs output multiplexer n binary inputs (binary input = -bit input) log 2 n binary selection inputs binary output Function: one of n inputs is placed onto output Called n-to- multiplexer 32

2-to- Multiplexer s s f w w f w w (a) Graphical symbol (b) Truth table w w s f s w w f (c) Sum-of-products circuit (d) Circuit with transmission gates Source: Brown and Vranesic 33

4-to- Multiplexer s s s s f w w w 2 w 3 f w w w 2 w 3 (a) Graphic symbol (b) Truth table s s w w f w 2 w 3 Source: Brown and Vranesic (c) Circuit 34

Multi-bit 4-to- Multiplexer s s s s f w w w 2 w 3 8 8 f w w w 2 w 3 (a) Graphic symbol (b) Truth table When drawing schematics, can draw multi-bit multiplexers Example: 8-bit 4-to- multiplexer 4 inputs (each 8 bits) output (8 bits) 2 selection bits Can also have multi-bit 2-to- muxes, 6-to- muxes, etc. 35

8-bit 4-to- Multiplexer s s w (7) w (7) w 2 (7) w 3 (7) f(7) s s w w w 2 w 3 8 f = 8 s s w (6) w (6) w 2 (6) w 3 (6) f(6) An 8-bit 4-to- multiplexer is composed of eight [-bit] 4-to- multiplexers s s w () w () w 2 () w 3 () f() 36

Problem How many outputs does a decoder with two data inputs have? How many outputs does a decoder with n data inputs have?

Decoders n inputs w y 2 n w n- 2 n outputs Enable En y Decoder n binary inputs 2 n binary outputs Function: decode encoded information If enable=, one output is asserted high, the other outputs are asserted low If enable=, all outputs asserted low Often, enable pin is not needed (i.e. the decoder is always enabled) Called n-to-2 n decoder Can consider n binary inputs as a single n-bit input Can consider 2 n binary outputs as a single 2 n -bit output Decoders are often used for RAM/ROM addressing 38

2-to-4 Decoder En w w y 3 y 2 y y - - w En y 3 w y 2 y y (a) Truth table (b) Graphical symbol w y w y y 2 y 3 En Source: Brown and Vranesic (c) Logic circuit 39

Problem Show how to implement a decoder that recognizes the following 4 ranges of a 6-bit address A, and generates the corresponding enable signals e,e,e2,e3: For A in: C-CFFF: D-DFFF: E-EFFF: F-FFFF: Assert e e e2 e3

Demultiplexers log 2 n selection inputs input n outputs Demultiplexer binary input n binary outputs log 2 n binary selection inputs Function: places input onto one of n outputs, with the remaining outputs asserted low Called -to-n demultiplexer Closely related to decoder Can build -to-n demultiplexer from log 2 n-to-n decoder by using the decoder's enable signal as the demultiplexer's input signal, and using decoder's input signals as the demultiplexer's selection input signals. 43

-to-4 Demultiplexer 44

Problem 2 How many inputs does an encoder with two data outputs have? How many inputs does an encoder with n data outputs have?

Encoders 2 n inputs w 2 n w y y n n outputs Encoder 2 n binary inputs n binary outputs Function: encodes information into an n-bit code Called 2 n -to-n encoder Can consider 2 n binary inputs as a single 2 n -bit input Can consider n binary output as a single n-bit output Encoders only work when exactly one binary input is equal to 46

4-to-2 Encoder w 3 w 2 w w y y (a) Truth table w w y w 2 w 3 y (b) Circuit 47

Problem 3 What is a difference between encoder and priority encoder?

Priority Encoders 2 n inputs w 2 n w y n n outputs y z "valid" output Priority Encoder 2 n binary inputs n binary outputs binary "valid" output Function: encodes information into an n-bit code based on priority of inputs Called 2 n -to-n priority encoder Priority encoder allows for multiple inputs to have a value of '', as it encodes the input with the highest priority (e.g., MSB = highest priority, LSB = lowest priority) "valid" output indicates when priority encoder output is valid Priority encoder is more common than an encoder 49

5 4-to-2 MSB Priority Encoder - w y - y z - - - w - - w 2 - w 3

Problem 4 Show how to implement a 4-to-2 MSB Priority Encoder using multiplexers and a minimum number of logic gates

Problem 5 What is the width of an output of a 4x4 unsigned multiplier? What is the width of an output of a 4x4 signed multiplier? What is the width of an output of a NxN unsigned multiplier?

4x4-bit Unsigned Multiplier 4 4 a * c b U 8 54

4x4-bit Signed Multiplier 4 4 a * c b S 8 55

Problem 6 What is the width of an output of a 4x8 unsigned multiplier? What is the width of an output of a 4x8 signed multiplier? What is the width of an output of a NxM unsigned multiplier?

Problem 7 Give an example of binary inputs to an unsigned 4x4 multiplier and a signed 4x4 multiplier that produce different results.

Unsigned vs. Signed Multiplication Unsigned Signed 5 - x x 5 x x - 225 58

Problem 8 Explain the difference between logic shift right and arithmetic shift right What arithmetic operations these shifts correspond to?

Logical Shift Right A >> C 4 4 L A(3) A(2) A() A() A(3) A(2) A() A C 6

Arithmetic Shift Right A >> C 4 4 A A(3) A(2) A() A() A C A(3) A(3) A(2) A() 6

Fixed Rotation A 4 <<< A(3) A(2) A() A() A C 4 C A(2) A() A() A(3) 62

8-bit Variable Rotator Left A 8 3 B A <<< B C 8 63

Problem 9 Explain using simple diagrams (based on medium-scale logic components) how to efficiently perform the following operations in hardware using combinational logic only A. C = A <<< 3 B. C = A <<< B, where A and C are 6-bit variables and B is a 4-bit variable

Fixed rotation C = A <<< 3 a(5) a(4) a(3) a(2) a() a() a(9) a(8) a(7) a(6) a(5) a(4) a(3) a(2) a() a() <<< 3 a(2) a() a() a(9) a(8) a(7) a(6) a(5) a(4) a(3) a(2) a() a() a(5) a(4) a(3) 65

Variable rotation C = A <<< B