COE 202: Digital Logic Design Combinational Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Similar documents
COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COE 202: Digital Logic Design Combinational Circuits Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

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

Chapter 3 Combinational Logic Design

Unit 3 Session - 9 Data-Processing Circuits

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

CprE 281: Digital Logic

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

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

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

COE 202: Digital Logic Design Combinational Logic Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Slides for Lecture 19

ENGIN 112 Intro to Electrical and Computer Engineering

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

Class Website:

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

Digital Logic Design ENEE x. Lecture 14

Function of Combinational Logic ENT263

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

Introduction to Digital Logic

Fundamentals of Digital Design

ECE 341. Lecture # 3

Combinational Logic. By : Ali Mustafa

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

UNIT III Design of Combinational Logic Circuits. Department of Computer Science SRM UNIVERSITY

ECE 2300 Digital Logic & Computer Organization

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

CSE 140L Spring 2010 Lab 1 Assignment Due beginning of the class on 14 th April

A B OUT_0 OUT_1 OUT_2 OUT_

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

Cs302 Quiz for MID TERM Exam Solved

Please read carefully. Good luck & Go Gators!!!

Arithmetic Circuits-2

Combinational Logic. Jee-Hwan Ryu. School of Mechanical Engineering Korea University of Technology and Education

Answers to Problems. For Fundamentals of Logic Design second edition (corrected version)

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

Combinational Logic Design Combinational Functions and Circuits

Philadelphia University Student Name: Student Number:

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

Sample Test Paper - I

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

CprE 281: Digital Logic

Floating Point Representation and Digital Logic. Lecture 11 CS301

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

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

CPE100: Digital Logic Design I

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

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

Computer Organization I. Lecture 13: Design of Combinational Logic Circuits

9.1. Unit 9. Implementing Combinational Functions with Karnaugh Maps or Memories

COMBINATIONAL CIRCUITS

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

Example: sending one bit of information across noisy channel. Effects of the noise: flip the bit with probability p.

Written exam with solutions IE Digital Design Friday 21/

211: Computer Architecture Summer 2016

University of Florida EEL 3701 Fall 2014 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Wednesday, 15 October 2014

CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha. BCD Codes

Chapter 3 Combinational Logic Design

Spiral 1 / Unit 5. Karnaugh Maps

Signals and Systems Digital Logic System

COMBINATIONAL LOGIC FUNCTIONS

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

UNIT II COMBINATIONAL CIRCUITS:

Digital Logic Design. Combinational Logic

Lecture 2 Review on Digital Logic (Part 1)

ELCT201: DIGITAL LOGIC DESIGN

Systems I: Computer Organization and Architecture

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

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

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

Numbers and Arithmetic

Ex code

Experiment 7: Magnitude comparators

Chapter 7 Combinational Logic Networks

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015

Decoding A Counter. svbitec.wordpress.com 1

Projects about Quantum adder circuits Final examination June 2018 Quirk Simulator

EE 209 Spiral 1 Exam Solutions Name:

Hardware Design I Chap. 4 Representative combinational logic

KUMARAGURU COLLEGE OF TECHNOLOGY COIMBATORE

CHAPTER1: Digital Logic Circuits Combination Circuits

CMP 334: Seventh Class

Fundamentals of Computer Systems

MODULAR CIRCUITS CHAPTER 7

Combina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge

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

EEL 3701 Fall Multiply out the following logic expressions to obtain the Sum of Products.

Computer organization

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

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Principles of Digital Techniques

Combinational Logic. Review of Combinational Logic 1

Review for Final Exam

University of Toronto Faculty of Applied Science and Engineering Final Examination

ว ตถ ประสงค ของบทเร ยน

CHAPTER 7. Solutions for Exercises

Arithmetic Circuits Didn t I learn how to do addition in the second grade? UNC courses aren t what they used to be...

Transcription:

COE 202: Digital Logic Design Combinational Circuits Part 4 Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: 22-324

Objectives Magnitude comparator Design of 4-bit magnitude comparator Design Examples using MSI components Adding Three 4-bit numbers Building 4-to-16 Decoders with 2-to-4 Decoders Getting the larger of 2 numbers (Maximum) Excess-3 Code Converter

Magnitude Comparator Definition: A magnitude comparator is a combinational circuit that compares two numbers A & B to determine whether: A > B, or A = B, or A < B Inputs First n-bit number A Second n-bit number B Outputs 3 output signals (GT, EQ, LT), where: n-bit input n-bit input n-bit magnitude comparator A GT = 1 IFF A > B EQ = 1 IFF A = B LT = 1 IFF A < B Note: Exactly One of these 3 outputs equals 1, while the other 2 outputs are 0`s B GT EQ LE

Example 1: Magnitude Comparator (4-bit) Problem: Design a magnitude comparator that compares 2 4-bit numbers A and B and determines whether: A > B, or A = B, or A < B 4-bit input 4-bit input 4-bit magnitude comparator A B GT EQ LE

Example 1: Magnitude Comparator (4-bit) Solution: Inputs: 8-bits (A 4-bits, B 4-bits) A and B are two 4-bit numbers Let A = A 3 A 2 A 1 A 0, and 4-bit input 4-bit magnitude comparator A GT Let B = B 3 B 2 B 1 B 0 Inputs have 2 8 (256) possible combinations (size of truth table and K-map?) Not easy to design using conventional techniques 4-bit input The circuit possesses certain amount of regularity can be designed algorithmically. B EQ LE

Example 1: Magnitude Comparator (4-bit) Designing EQ: Define X i = A i xnor B i = A i B i + A i B i X i = 1 IFF A i = B i i =0, 1, 2 and 3 X i = 0 IFF A i B i Therefore the condition for A = B or EQ=1 IFF A 3 = B 3 (X 3 = 1), and A 2 = B 2 (X 2 = 1), and A 1 = B 1 (X 1 = 1), and A 0 = B 0 (X 0 = 1). Thus, EQ=1 IFF X 3 X 2 X 1 X 0 = 1. In other words, EQ = X 3 X 2 X 1 X 0

Example 1: Magnitude Comparator (4-bit) Designing GT and LT: GT = 1 if A > B: If A 3 > B 3 A 3 = 1 and B 3 = 0 If A 3 = B 3 and A 2 > B 2 If A 3 = B 3 and A 2 = B 2 and A 1 > A 1 If A 3 = B 3 and A 2 = B 2 and A 1 = B 1 and A 0 > B 0 Therefore, GT = A 3 B 3 + X 3 A 2 B 2 + X 3 X 2 A 1 B 1 + X 3 X 2 X 1 A 0 B 0 Similarly, LT = A 3 B 3 + X 3 A 2 B 2 + X 3 X 2 A 1 B 1 + X 3 X 2 X 1 A 0 B 0

Example 1: Magnitude Comparator (4-bit) EQ = X 3 X 2 X 1 X 0 GT = A 3 B 3 + X 3 A 2 B 2 + X 3 X 2 A 1 B 1 + X 3 X 2 X 1 A 0 B 0 LT = B 3 A 3 + X 3 B 2 A 2 + X 3 X 2 B 1 A 1 + X 3 X 2 X 1 B 0 A 0 4-bit magnitude comparator

Example 1: Magnitude Comparator (4-bit) Do you need all three outputs? Two outputs can tell about the third one Example: when A is NOT GREATER THAN B, and A is NOT LESS THAN B THEN A is EQUAL TO B Therefore, we can save some logic gates: 4-bit input 4-bit input 4-bit magnitude comparator A B GT EQ LE EQ

Example 2: Adding three 4-bit numbers Problem: Add three 4-bit numbers using standard MSI combinational components Solution: Let the numbers be X 3 X 2 X 1 X 0, Y 3 Y 2 Y 1 Y 0, Z 3 Z 2 Z 1 Z 0, X 3 X 2 X 1 X 0 + Y 3 Y 2 Y 1 Y 0 ------------------- C 4 S 3 S 2 S 1 S 0 S 3 S 2 S 1 S 0 + Z 3 Z 2 Z 1 Z 0 ------------------- D 4 F 3 F 2 F 1 F 0 Note: C 4 and D 4 is generated in position 4. They must be added to generate the most significant bits of the result

Example 2: Adding three 4-bit numbers

Example 3: 4-to-16 Decoder Problem: Design a 4x16 Decoder using 2x4 Decoders Solution: Each group combination holds a unique value for A 3 A 2 - One Decoder can be therefore used with inputs: A 3 A 2 - Four more decoders are needed for representing each individual color combination A 3 A 2 = 00 A 3 A 2 = 01 A 3 A 2 = 10 A 3 A 2 = 11 A 3 A 2 A 1 A 0 Output 0 0 0 0 D 0 0 0 0 1 D 1 0 0 1 0 D 2 0 0 1 1 D 3 0 1 0 0 D 4 0 1 0 1 D 5 0 1 1 0 D 6 0 1 1 1 D 7 1 0 0 0 D 8 1 0 0 1 D 9 1 0 1 0 D 10 1 0 1 1 D 11 1 1 0 0 D 12 1 1 0 1 D 13 1 1 1 0 D 14 1 1 1 1 D 15

Example 3: 4-to-16 Decoder A 0 A 1 2x4 Decoder D 0 D 1 D 2 D 3 A 0 A 1 2x4 Decoder D 4 D 5 D 6 D 7 A 2 A 3 2x4 Decoder A 0 A 1 2x4 Decoder D 8 D 9 D 10 D 11 A 0 A 1 2x4 Decoder D 12 D 13 D 14 D 15

Example 4: The larger of 2 numbers Problem: Given two 4-bit unsigned numbers, design a circuit such that the output is the larger of the two numbers Solution: We will use a magnitude comparator and a Quad 2x1 MUX. How?

Example 4: The larger of 2 numbers B 0 B 1 A 0 A 1 A 2 A 3 B 0 B 1 4-bit Magnitude Comparator A>B A<B A=B GT LT EQ B 2 Y 0 QUAD B 3 A 0 A 1 A 2 2X1 MUX Y 1 Y 2 Y 3 B 2 B 3 A 3 S 0 For So=1, A is selected, For So=0, B is selected

Example 5: Excess-3 Code Converter Problem: Design an excess-3 code converter that takes as input a BCD number, and generates an excess-3 output. Solution: Use decoders and encoders W X Y Z A B C D 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 0

Example 5: Excess-3 Code Converter Z Y X W 4-to-16 line Decoder D0 D1 D2 D3 O0 O1 O2 O3 O4 O5 O6 O7 O8 O9 O10 O11 O12 O13 O14 O15 16-to-4 line Encoder I0 I1 I2 I3 I4 I5 I6 I7 I8 I9 I10 I11 I12 I13 I14 I15 D0 D1 D2 D3???? What will be the output?

Example 5: Excess-3 Code Converter A decoder can be used with the inputs being W,X,Y,Z It will be a 4x16 decoder, with only a single output bit equal to 1 for any input combination An encoder (16x4) will take as input the 16 bit output from the decoder, and will generate the appropriate output in excess-3 format For this to function correctly, the output from the decoder must be displaced 3 places while being connected to the encoder input It may be noted that outputs 10,11,12,13,14,15 of the decoder are not used since we are dealing with BCD

Summary Design = Different possibilities Better designer = more practice More design examples in the textbook