COE 202: Digital Logic Design Combinational Circuits Part 4

Slides:



Advertisements
Similar presentations
Logic Circuits Design presented by Amr Al-Awamry
Advertisements

Combinational Circuits
Functions and Functional Blocks
COE 202: Digital Logic Design Combinational Circuits Part 1
Comparators Combinational Design.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices XOR, Parity Circuits, Comparators.
EELE 367 – Logic Design Module 4 – Combinational Logic Design with VHDL Agenda 1.Decoders/Encoders 2.Multiplexers/Demultiplexers 3.Tri-State Buffers 4.Comparators.
COE 202: Digital Logic Design Combinational Circuits Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 2 –
DIGITAL SYSTEMS TCE OTHER COMBINATIONAL LOGIC CIRCUITS WEEK 7 AND WEEK 8 (LECTURE 1 OF 3) COMPARATORS CODE CONVERTERS.
COE 202: Digital Logic Design Combinational Circuits Part 1
EE2174: Digital Logic and Lab
Chapter 3 Combinational Logic Design
Combinational Logic Design
CS 105 Digital Logic Design
Combinational Circuits
Combinational Circuits
9/15/09 - L15 Decoders, Multiplexers Copyright Joanne DeGroat, ECE, OSU1 Decoders and Multiplexers.
CS 151: Digital Design Chapter 3 3-8: Encoding. CS 151 Encoding Encoding - the opposite of decoding - the conversion of a maximum of 2 n input code to.
Combinational Logic Design
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Sahar Mosleh PageCalifornia State University San Marcos 1 Multiplexer, Decoder and Circuit Designing.
Decoders.
Dr. Ahmed El-Bialy, Dr. Sahar Fawzy Combinational Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Combinational Circuit – Arithmetic Circuit
Combinational Circuits
COE 202: Digital Logic Design Combinational Circuits Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
CS2100 Computer Organisation MSI Components (AY2015/6 Semester 1)
Functions of Combinational Logic
Digital Logic Design Review Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM 2010.
COE 202: Digital Logic Design Combinational Circuits Part 4
DLD Lecture 15 Magnitude Comparators and Multiplexers
Morgan Kaufmann Publishers
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
ES 244: Digital Logic Design Chapter 4 Chapter 4: Combinational Logic Uchechukwu Ofoegbu Temple University.
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
COE 202: Digital Logic Design Combinational Circuits Part 3
Combinational Circuits
CS221: Digital Logic Design Combinational Circuits
CS 105 DIGITAL LOGIC DESIGN Chapter 4 Combinational Logic 1.
CS151 Introduction to Digital Design
Chapter Four Combinational Logic 1. Discrete quantities of information are represented in digital systems by binary codes. A binary code of n bits is.
EEL-3705 TPS QUIZZES Chapter 4. Quiz 4-1 Using the 2x4 Decoder shown below and two-input OR gates, design a logic circuit which implements.
Magnitude Comparator A magnitude comparator is a combinational circuit that compares two numbers, A and B, and then determines their relative magnitudes.
1 CS 151: Digital Design Chapter 3: Combinational Logic Design 3-1Design Procedure CS 151: Digital Design.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
1 Fundamentals of Computer Science Combinational Circuits.
Chapter Four Combinational Logic 1. C OMBINATIONAL C IRCUITS It consists of input variables, logic gates and output variables. Output is function of input.
Combinational Circuit Design. Digital Circuits Combinational CircuitsSequential Circuits Output is determined by current values of inputs only. Output.
Chapter 3: Combinational Functions and Circuits 3-5 to 3-7: Decoders
DIGITAL LOGIC DESIGN & COMPUTER ARCHTECTURE
Module 11.  In Module 9, we have been introduced to the concept of combinational logic circuits through the examples of binary adders.  Meanwhile, in.
Lecture # 10 University of Tehran
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapter 4 -Part 1.
1 DLD Lecture 16 More Multiplexers, Encoders and Decoders.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
Dr. Nermin Hamza. Agenda Signed Numbers Properties of Switching Algebra.
1 Combinational Logic Design.  A process with 5 steps Specification Formulation Optimization Technology mapping Verification  1 st three steps and last.
Decoders A decoder is a logic circuit that detects the presence of a specific combination of bits at its input. Two simple decoders that detect the presence.
MSI Circuits.
CS221: Digital Logic Design Combinational Circuits 3
Combinational Circuits
FUNCTION OF COMBINATIONAL LOGIC CIRCUIT
Magnitude Comparator A magnitude comparator is a combinational circuit that compares two numbers, A and B, and then determines their relative magnitudes.
Chapter 6 Functions of Combinational Logic
King Fahd University of Petroleum and Minerals
COE 202: Digital Logic Design Combinational Circuits Part 3
Arithmetic Circuits.
Presentation transcript:

COE 202: Digital Logic Design Combinational Circuits Part 4 Courtesy of Dr. Ahmad Almulhem KFUPM

Objectives Magnitude comparator Design Examples using MSI components 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 KFUPM

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: 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 n-bit input n-bit magnitude comparator GT A EQ n-bit input B LT KFUPM

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 magnitude comparator GT A EQ 4-bit input B LE KFUPM

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 = A3A2A1A0 , and Let B = B3B2B1B0 Inputs have 28 (256) possible combinations (size of truth table and K-map?) Not easy to design using conventional techniques 4-bit input 4-bit magnitude comparator GT A EQ 4-bit input B LE The circuit possesses certain amount of regularity ⇒ can be designed algorithmically. KFUPM

Example 1: Magnitude Comparator (4-bit) Designing EQ: Define Xi = Ai xnor Bi = Ai Bi + Ai’ Bi’  Xi = 1 IFF Ai = Bi ∀ i =0, 1, 2 and 3  Xi = 0 IFF Ai ≠ Bi Therefore the condition for A = B or EQ=1 IFF A3= B3 → (X3 = 1), and A2= B2 → (X2 = 1), and A1= B1 → (X1 = 1), and A0= B0 → (X0 = 1). Thus, EQ=1 IFF X3 X2 X1 X0 = 1. In other words, EQ = X3 X2 X1 X0 KFUPM

Example 1: Magnitude Comparator (4-bit) Designing GT and LT: GT = 1 if A > B: If A3 > B3  A3 = 1 and B3 = 0 If A3 = B3 and A2 > B2 If A3 = B3 and A2 = B2 and A1 > A1 If A3 = B3 and A2 = B2 and A1 = B1 and A0 > B0 Therefore, GT = A3B3‘ + X3 A2 B2‘ + X3 X2 A1 B1‘ + X3 X2 X1A0 B0‘ Similarly, LT = A3’B3 + X3 A2‘B2 + X3 X2 A1’B1 + X3 X2 X1A0’ B0 KFUPM

Example 1: Magnitude Comparator (4-bit) EQ = X3 X2 X1 X0 GT = A3B3’ + X3A2B2’ + X3X2A1B1’ + X3X2X1A0B0’ LT = B3A3’ + X3B2A2’ + X3X2B1A1’ + X3X2X1B0A0’ 4-bit magnitude comparator KFUPM

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 magnitude comparator GT A EQ EQ 4-bit input B LT KFUPM

Example 2: Adding three 4-bit numbers Problem: Add three 4-bit numbers using standard MSI combinational components Solution: Let the numbers be X3X2X1X0, Y3Y2Y1Y0, Z3Z2Z1Z0 , X3X2X1X0 + Y3Y2Y1Y0 ------------------- C4 S3S2S1S0 S3S2S1S0 + Z3Z2Z1Z0 ------------------- D4 F3F2F1F0 Note: C4 and D4 is generated in position 4. They must be added to generate the most significant bits of the result KFUPM

Example 2: Adding three 4-bit numbers Problem: Add three 4-bit numbers using standard MSI combinational components Solution: Let the numbers be X3X2X1X0, Y3Y2Y1Y0, Z3Z2Z1Z0 , X3X2X1X0 + Y3Y2Y1Y0 ------------------- C4 S3S2S1S0 S3S2S1S0 + Z3Z2Z1Z0 ------------------- D4 F3F2F1F0 Note: C4 and D4 is generated in position 4. They must be added to generate the most significant bits of the result KFUPM

Example 2: Adding three 4-bit numbers KFUPM

Example 3: 4-to-16 Decoder A3 A2 A1 A0 Output D0 1 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 Problem: Design a 4x16 Decoder using 2x4 Decoders Solution: Each group combination holds a unique value for A3A2 - One Decoder can be therefore used with inputs: A3A2 - Four more decoders are needed for representing each individual color combination A3A2 = 00 A3A2 = 01 A3A2 = 10 A3A2 = 11 KFUPM

Example 3: 4-to-16 Decoder A0 A1 2x4 Decoder A0 A1 2x4 Decoder A2 A3 D0 D1 D2 D3 A0 A1 2x4 Decoder D4 D5 D6 D7 A0 A1 A2 A3 2x4 Decoder 2x4 Decoder D8 D9 D10 D11 A0 A1 2x4 Decoder D12 D13 D14 D15 A0 A1 KFUPM

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? KFUPM

Example 4: The larger of 2 numbers Y0 Y1 Y2 Y3 A0 A1 A2 A3 QUAD 2X1 MUX A>B 4-bit Magnitude Comparator GT LT EQ A0 A1 A2 A3 A<B B0 B1 B2 B3 A=B For So=1, A is selected, For So=0, B is selected S0 KFUPM

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 1 KFUPM

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

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 KFUPM

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