CprE 281: Digital Logic

Similar documents
CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

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

Unit 3 Session - 9 Data-Processing Circuits

CprE 281: Digital Logic

Digital Logic Design ENEE x. Lecture 14

Combinational Logic. By : Ali Mustafa

CprE 281: Digital Logic

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

Chapter 3 Combinational Logic Design

ECE 341. Lecture # 3

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

ELCT201: DIGITAL LOGIC DESIGN

DESIGN AND IMPLEMENTATION OF ENCODERS AND DECODERS. To design and implement encoders and decoders using logic gates.

Slides for Lecture 19

MODULAR CIRCUITS CHAPTER 7

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

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

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

Combinational Logic Design Combinational Functions and Circuits

3. Combinational Circuit Design

Function of Combinational Logic ENT263

Floating Point Representation and Digital Logic. Lecture 11 CS301

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

Logic Design Combinational Circuits. Digital Computer Design

CSEE 3827: Fundamentals of Computer Systems. Combinational Circuits

Chapter 3 Ctd: Combinational Functions and Circuits

ECE 2300 Digital Logic & Computer Organization

211: Computer Architecture Summer 2016

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

Slides for Lecture 16

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

CMSC 313 Lecture 19 Combinational Logic Components Programmable Logic Arrays Karnaugh Maps

CPE100: Digital Logic Design I

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

Boolean Algebra & Digital Logic

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

COMBINATIONAL LOGIC FUNCTIONS

CHAPTER VI COMBINATIONAL LOGIC BUILDING BLOCKS

Lecture 2 Review on Digital Logic (Part 1)

CHAPTER1: Digital Logic Circuits Combination Circuits

Fundamentals of Digital Design

Systems I: Computer Organization and Architecture

Computer Science Final Examination Friday December 14 th 2001

Introduction to Computer Engineering ECE 203

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

CprE 281: Digital Logic

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

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

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

Boolean Algebra, Gates and Circuits

Binary addition example worked out

Numbers and Arithmetic

CS 226: Digital Logic Design

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

Numbers and Arithmetic

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

COSC3330 Computer Architecture Lecture 2. Combinational Logic

Chapter 3 Combinational Logic Design

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Hardware Design I Chap. 4 Representative combinational logic

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

Logic Design I (17.341) Fall Lecture Outline

A B OUT_0 OUT_1 OUT_2 OUT_

CSC9R6 Computer Design. Practical Digital Logic

Boolean Logic Continued Prof. James L. Frankel Harvard University

CS1800 Discrete Structures Final Version A

ENGIN 112 Intro to Electrical and Computer Engineering

Chapter 2 Combinational Logic Circuits

Combinatorial RTL Components

Combinational Logic Design/Circuits

Software Engineering 2DA4. Slides 8: Multiplexors and More

CHAPTER VI COMBINATIONAL LOGIC BUILDING BLOCKS

Design of Sequential Circuits

Philadelphia University Student Name: Student Number:

Introduction to Karnaugh Maps

UNIVERSITY OF WISCONSIN MADISON

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

Class Website:

Answers. Name: Grade: Q1 Q2 Q3 Q4 Total mean: 83, stdev: 14. ESE370 Fall 2017

Slides for Lecture 10

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

Arithmetic Circuits-2

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

1 Boolean Algebra Simplification

Sample Test Paper - I

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

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

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

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

Lecture 1: Shannon s Theorem

Transcription:

CprE 28: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/

Code Converters CprE 28: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev

HW 7 is out Administrative Stuff It is due next Monday (Oct 6) @ 4pm

Administrative Stuff The second midterm is in 2 weeks.

Midterm Exam #2 Administrative Stuff When: Friday October 27 @ 4pm. Where: This classroom What: Chapters, 2, 3, 4 and 5.-5.8 The exam will be open book and open notes (you can bring up to 3 pages of handwritten/typed notes).

Midterm 2: Format The exam will be out of 3 points You need 95 points to get an A on the exam It will be great if you can score more than points. but you can t roll over your extra points L

Quick Review

Decoders

2-to-4 Decoder (Definition) Has two inputs: w and w Has four outputs: y, y, y 2, and y 3 If w = and w =, then the output y is set to If w = and w =, then the output y is set to If w = and w =, then the output y 2 is set to If w = and w =, then the output y 3 is set to Only one output is set to. All others are set to.

Truth Table and Graphical Symbol for a 2-to-4 Decoder [ Figure 4.3a-b from the textbook ]

Truth Table and Graphical Symbol for a 2-to-4 Decoder The outputs are one-hot encoded [ Figure 4.3a-b from the textbook ]

Truth Logic Circuit for a 2-to-4 Decoder [ Figure 4.3c from the textbook ]

Adding an Enable Input En [ Figure 4.3c from the textbook ]

Truth Table and Graphical Symbol for a 2-to-4 Decoder with an Enable Input [ Figure 4.4a-b from the textbook ]

Truth Table and Graphical Symbol for a 2-to-4 Decoder with an Enable Input x indicates that it does not matter what the value of these variable is for this row of the truth table [ Figure 4.4a-b from the textbook ]

Graphical Symbol for a Binary n-to-2 n Decoder with an Enable Input A binary decoder with n inputs has 2 n outputs The outputs of an enabled binary decoder are one-hot encoded, meaning that only a single bit is set to, i.e., it is hot. [ Figure 4.4d from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w y w y w w 2 w y y 2 En y 3 y y 2 y 3 En w y y 4 w y y 2 En y 3 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 3-to-8 decoder using two 2-to-4 decoders w w y y w w y y y 2 y 2 w 2 En y 3 y 3 En w En y w y y 2 y 3 y 4 y 5 y 6 y 7 [ Figure 4.5 from the textbook ]

A 4-to-6 decoder built using a decoder tree w w y y w w En y y 2 y 3 y y 2 y 3 w 2 w 3 En w y w y y 2 En y 3 w w y y 2 En y 3 w y y w w y y 2 En y 3 y 4 y 5 y 6 y 7 y 8 y 9 y y [ Figure 4.6 from the textbook ] w y w y y 2 En y 3 y 2 y 3 y 4 y 5

Let s build a 5-to-32 decoder

Let s build a 5-to-32 decoder y y 5 En y 6 y 3

Let s build a 5-to-32 decoder w w w 2 w 3 y y 5 w 4 En w w w 2 w 3 y 6 y 3

Demultiplexers

-to-4 Demultiplexer (Definition) Has one data input line: D Has two output select lines: w and w Has four outputs: y, y, y 2, and y 3 If w = and w =, then the output y is set to D If w = and w =, then the output y is set to D If w = and w =, then the output y 2 is set to D If w = and w =, then the output y 3 is set to D Only one output is set to D. All others are set to.

A -to-4 demultiplexer built with a 2-to-4 decoder [ Figure 4.4c from the textbook ]

A -to-4 demultiplexer built with a 2-to-4 decoder output select lines the four output lines data input line D [ Figure 4.4c from the textbook ]

Multiplexers (Implemented with Decoders)

A 4-to- multiplexer built using a 2-to-4 decoder w w s s w y w y y 2 w 2 En y 3 f w 3 [ Figure 4.7 from the textbook ]

Encoders

Binary Encoders

4-to-2 Binary Encoder (Definition) Has four inputs: w 3, w 2, w, and w Has two outputs: y and y Only one input is set to ( one-hot encoded). All others are set to. If w = then y = and y = If w = then y = and y = If w 2 = then y = and y = If w 3 = then y = and y =

Truth table for a 4-to-2 binary encoder w 3 w 2 w w y y [ Figure 4.9 from the textbook ]

Truth table for a 4-to-2 binary encoder w 3 w 2 w w y y The inputs are one-hot encoded [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w w y w 2 w 3 y [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w? w y w 2 w 3 y [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w It is assumed that the inputs are one hot encoded w y w 2 w 3 y [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w w w 2 y w 3 y [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w w w 2 y w 3 y [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w w w 2 y w 3 y [ Figure 4.9 from the textbook ]

Circuit for a 4-to-2 binary encoder w 3 w 2 w w y y w w w 2 y w 3 y [ Figure 4.9 from the textbook ]

A 2 n -to-n binary encoder 2 n inputs w w 2 n y y n n outputs [ Figure 4.8 from the textbook ]

Priority Encoders

Truth table for a 4-to-2 priority encoder (abbreviated version) w 3 w 2 w w y y z x x x x x x d d [ Figure 4.2 from the textbook ]

Truth table for a 4-to-2 priority encoder (abbreviated version) w 3 w 2 w w y y z x x x x x x d d [ Figure 4.2 from the textbook ]

Truth table for a 4-to-2 priority encoder x x x x x x w 3 w 2 w w y y z d d

Expressions for 4-to-2 priority encoder w 3 w 2 w w y y z d d w 3 w 2 w w d y = w 3 + w 2

Expressions for 4-to-2 priority encoder w 3 w 2 w w y y z d d w 3 w 2 w w d y = w 3 + w w 2

Expressions for 4-to-2 priority encoder w 3 w 2 w w y y z d d w 3 w 2 w w z = w 3 + w 2 + w + w

Circuit for the 4-to-2 priority encoder w 3 w 2 w w y y z

d w y d y z x x x w x x w 2 x w 3 The textbook derives a different circuit for the 4-to-2 priority encoder using a 4-to-2 binary encoder

The textbook derives a different circuit for the 4-to-2 priority encoder using a 4-to-2 binary encoder w 3 w 2 w w y y z x x x x x x d d w w y w 2 w 3 y

The textbook derives a different circuit for the 4-to-2 priority encoder using a 4-to-2 binary encoder w 3 w 2 w w y y z x x x x x x d d i w i w y i 2 w 2 i 3 w 3 y i + i + i 2 + i 3 z

The textbook derives a different circuit for the 4-to-2 priority encoder using a 4-to-2 binary encoder w 3 w 2 w w y y z x x x x x x d d i w i w y i 2 w 2 i 3 w 3 y i + i + i 2 + i 3 z Try to prove that this is equivalent to the circuit that was derived above.

Code Converters

Code Converter (Definition) Converts from one type of input encoding to a different type of output encoding.

Code Converter (Definition) Converts from one type of input encoding to a different type of output encoding. A decoder does that as well, but its outputs are always one-hot encoded so the output code is really only one type of output code. A binary encoder does that as well but its inputs are always one-hot encoded so the input code is really only one type of input code.

A hex-to-7-segment display code converter [ Figure 4.2 from the textbook ]

A hex-to-7-segment display code converter [ Figure 4.2 from the textbook ]

A hex-to-7-segment display code converter [ Figure 4.2 from the textbook ]

A hex-to-7-segment display code converter [ Figure 4.2 from the textbook ]

A hex-to-7-segment display code converter [ Figure 4.2 from the textbook ]

What is the circuit for this code converter? x 3 x 2 x x

What is the circuit for this code converter? x 3 x 2 x x f(x, x 2, x 3, x 4 ) = Σ m(, 2, 3, 5, 6, 7, 8, 9,, 2, 4, 5)

What is the circuit for this code converter? x 3 x 2 x x x x x 2 x 3 x 4 m m 4 m 2 m 8 x 3 m m 5 m 3 m 2 m 6 m 3 m 7 m 5 m 4 m 9 m m x 4 x 2 f(x, x 2, x 3, x 4 ) = Σ m(, 2, 3, 5, 6, 7, 8, 9,, 2, 4, 5)

What is the circuit for this code converter? x 3 x 2 x x

What is the circuit for this code converter? x 3 x 2 x x x x x 2 x 3 x 4 m m 4 m 2 m 8 x 3 m m 5 m 3 m 2 m 6 m 3 m 7 m 5 m 4 m 9 m m x 4 x 2 f(x, x 2, x 3, x 4 ) = Σ m(, 2, 3, 5, 6, 8, 9,, 2, 3, 4)

Arithmetic Comparison Circuits

Truth table for a one-bit digital comparator [http://en.wikipedia.org/wiki/digital_comparator]

A one-bit digital comparator circuit [http://www.personal.psu.edu/users///c/w/cwb596/old%2site/index_files/cmpenlab4.htm]

Truth table for a two-bit digital comparator [http://en.wikipedia.org/wiki/digital_comparator]

A two-bit digital comparator circuit [http://forum.allaboutcircuits.com/showthread.php?t=56]

A four-bit comparator circuit [ Figure 4.22 from the textbook ]

Example Problems from Chapter 4

Example : SOP vs Decoders Implement the function f(w, w 2, w 3 ) = Σ m(,, 3, 4, 6, 7) by using a 3-to-8 binary decoder and one OR gate.

Solution Circuit w 3 w y w 2 w w w 2 y y 2 y 3 y 4 y 5 y 6 En y 7 f(w, w 2, w 3 ) = Σ m(,, 3, 4, 6, 7) [ Figure 4.44 from the textbook ]

Notice this swap of variables in the two lists. w 3 w Solution Circuit y w 2 w w w 2 Need to match the least significant with the least significant in both. y y 2 y 3 y 4 y 5 y 6 En y 7 f(w, w 2, w 3 ) = Σ m(,, 3, 4, 6, 7) [ Figure 4.44 from the textbook ]

Example 2: Implement an 8-to-3 binary encoder [ Figure 4.45 from the textbook ]

Example 2: Implement an 8-to-3 binary encoder y = w + w 3 + w 5 + w 7 y = w 2 + w 3 + w 6 + w 7 y 2 = w 4 + w 5 + w 6 + w 7 [ Figure 4.45 from the textbook ]

Circuit for the 8-to-3 binary encoder w 7 w 6 w 5 w 4 w 3 w 2 w w y y y 2 y = w + w 3 + w 5 + w 7 y = w 2 + w 3 + w 6 + w 7 y 2 = w 4 + w 5 + w 6 + w 7

Example 3: Implement an 8-to-3 priority encoder

Example 3: Implement an 8-to-3 priority encoder x x x x x x x x x x x x x x x x x x x x x x x x x x x x

Example 3: Implement an 8-to-3 priority encoder x x x x x x x x x x x x x x x x x x x x x x x x x x x x d d d z

Example 3: Implement an 8-to-3 priority encoder x x x x x x x x x x x x x x x x x x x x x x x x x x x x d d d z

Example 3: Implement an 8-to-3 priority encoder i = w 7 w 6 w 5 w 4 w 3 w 2 w w i = w 7 w 6 w 5 w 4 w 3 w 2 w i 2 = w 7 w 6 w 5 w 4 w 3 w 2 i 3 = w 7 w 6 w 5 w 4 w 3 i 4 = w 7 w 6 w 5 w 4 i 5 = w 7 w 6 w 5 i 6 = w 7 w 6 i 7 = w 7 z = i +i +i 2 +i 3 +i 4 +i 5 +i 6 +i 7 x x x x x x x x x x x x x x x x x x x x x x x x x x x x d d d z

Circuit for the 8-to-3 binary encoder w 7 w 6 w 5 w 4 w 3 w 2 w w y y y 2

Circuit for the 8-to-3 priority encoder i 7 i 6 i 5 i 4 i 3 i 2 i i w 7 w 6 w 5 w 4 w 3 w 2 w w y y y 2 z

Example 4:Circuit implementation using a multiplexer Implement the function f(w, w 2, w 3, w 4, w 5 ) = w w 2 w 4 w 5 + w w 2 + w w 3 + w w 4 + w 3 w 4 w 5 using a 4-to- multiplexer

Some Boolean Algebra Leads To w w 2 w 4 w 5 + w w 2 + w w 3 + w w 4 + w 3 w 4 w 5 w w 4 (w 5 w 2 ) + w 4 (w 3 w 5 ) + w (w 2 + w 3 ) + w w 4 () w w 4 (w 5 w 2 ) + ( w +w )w 4 (w 3 w 5 ) + w ( w 4 +w 4 ) (w 2 + w 3 ) + w w 4 () w w 4 (w 5 w 2 ) + w w 4 (w 3 w 5 ) + w w 4 (w 2 + w 3 ) + w w 4 ( w 3 w 5 + (w 2 +w 3 ) + ) w w 4 (w 5 w 2 ) + w w 4 (w 3 w 5 ) + w w 4 (w 2 + w 3 ) + w w 4 () Note that the split is by w and w 4, not w and w 2

Solution Circuit [ Figure 4.46 from the textbook ]

Some Final Things from Chapter 4

A shifter circuit [ Figure 4.5 from the textbook ]

A shifter circuit

A shifter circuit

A shifter circuit w 3 w 2 w w No shift in this case.

A shifter circuit

A shifter circuit

A shifter circuit w 3 w 2 w Shift to the right by bit

A shifter circuit w 3 w 2 w w Shift to the right by bit

A barrel shifter circuit [ Figure 4.5 from the textbook ]

Questions?

THE END