CSE 140: Discussion #4 Nima Mousavi.

Slides:



Advertisements
Similar presentations
Modular Combinational Logic
Advertisements

Decoders/DeMUXs CS370 – Spring Decoder: single data input, n control inputs, 2 outputs control inputs (called select S) represent Binary index of.
Combinational Logic Circuits Is the logic circuit where the output always depends on the inputs irrespective of the previous state with out the feed back.
1 Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO.
Multiplexer as a Universal Function Generator
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
Multiplexer MUX. 2 Multiplexer Multiplexer (Selector)  2 n data inputs,  n control inputs,  1 output  Used to connect 2 n points to a single point.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Combinational Logic Design
Logic Design with MSI Circuits
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
Computer Organization & Programming Chapter4 Combinatorial Components.
Combinational Logic By Taweesak Reungpeerakul
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
WEEK #9 FUNCTIONS OF COMBINATIONAL LOGIC (DECODERS & MUX EXPANSION)
Combinational Design, Part 3: Functional Blocks
Kuliah Rangkaian Digital Kuliah 6: Blok Pembangun Logika Kombinasional Teknik Komputer Universitas Gunadarma.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
ES 244: Digital Logic Design Chapter 4 Chapter 4: Combinational Logic Uchechukwu Ofoegbu Temple University.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
1 CSE370, Lecture 10 Lecture 10 u Logistics n HW3 due Friday (cover materials up to this lecture) n Lab3 going on this week n Midterm 1: a week from today.
CS 105 DIGITAL LOGIC DESIGN Chapter 4 Combinational Logic 1.
BR 8/991 Combinational Building Blocks 2/1 Multiplexor (MUX) I0 I1 Y S if S = 0, then Y = I0 if S = 1, then Y = I1 Y = I0 S’ + I1 S I0 I1 Y S A[3:0] B[3:0]
Magnitude Comparator A magnitude comparator is a combinational circuit that compares two numbers, A and B, and then determines their relative magnitudes.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
ECE 320 Homework #4 1. Using 8 data input selector logic (MUX), implement the following two functions: a) F(A,B,C)=S 0 S 2 S 3 S 5 b) F(A,B,C,D)=P 0 +P.
A. Yaicharoen 1 1/2551 Logic Design with MSI Circuits วัตถุประสงค์ของบทเรียน  รู้จักวงจรประเภท MSI  เข้าใจการทำงานของวงจร MSI ที่มีใช้ อยู่ทั่วไป  สามารถประยุกต์ใช้วงจร.
Combinational Circuit Design. Digital Circuits Combinational CircuitsSequential Circuits Output is determined by current values of inputs only. Output.
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
Chapter 3 Digital Logic Structures
Appendix B: Digital Logic
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.
Mu.com.lec 11.  Used not only to perform addition but also to perform subtraction, multiplication and division  The most basic of the adders is the.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Combinational Circuits
ECE 3130 Digital Electronics and Design
Lecture 4 Logistics Last lecture --- Boolean algebra Today’s lecture
ECE 3130 Digital Electronics and Design
Homework Reading Machine Projects Labs
Lecture 9 Logistics Last lecture Today HW3 due Wednesday
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.
EEL 3705 / 3705L Digital Logic Design
Basics Combinational Circuits Sequential Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Chapter 6 Functions of Combinational Logic
CSE 311 Foundations of Computing I
CSE Winter 2001 – Arithmetic Unit - 1
HALF ADDER FULL ADDER Half Subtractor.
ELL100: INTRODUCTION TO ELECTRICAL ENGG.
CSE 370 – Winter 2002 – Comb. Logic building blocks - 1
Week 7: Gates and Circuits: PART II
Programmable Configurations
Lecture 10 Logistics Last lecture Today
CSE 140L Discussion 3 CK Cheng and Thomas Weng
Homework Reading Machine Projects Labs
COMS 361 Computer Organization
Logic Circuits I Lecture 3.
Combinational Circuits
Special Gates Combinational Logic Gates
Overview Last lecture Timing; Hazards/glitches
XOR Function Logic Symbol  Description  Truth Table 
Half & Full Subtractor Half Subtractor Full Subtractor.
Half & Full Subtractor Half Subtractor Full Subtractor.
Lecture 3 Combinational units. Adders
Presentation transcript:

CSE 140: Discussion #4 Nima Mousavi

Content Questions about midterm Encoder/Decoder Multiplexers Adder/Subtractor ALU

Any questions about midterm?

Decoder Review Why do we use decoder? Dont forget to label your decoders!! (enumerating the inputs/outputs) A decoder implements all the minterm, so if we have the SOP canonical of a function we can easily implement that with an OR gate and the decoder.

Decoder Review If En = 1, I0 = 0 , I1=1 and I2 = 0, which of the outputs is one? If En = 1, I0 = 0 , I1=1 and I2 =1, which of the outputs is one? If En = 0, I0 = 1 , I1=0 and I2 =1, which of the outputs is one?

Implementing with 4:16 Decoder & OR gates Starting from Canonical SOP forms Y1 = ∑m(3,5,6,7,9) + D(10,11,12,13,14,15) Y0 = ∑m(1,2,4,7,8) + D(10,11,12,13,14,15)

Implementing with 4:16 Decoder & OR gates Y1 = ∑m(3,5,6,7,9) + D(10,11,12,13,14,15) Y0 = ∑m(1,2,4,7,8) + D(10,11,12,13,14,15) I3:msb We can use one decoder to implement multiple outputs No need for logic minimization Some outputs can be left unused We can reuse the ouputs Y1 a3 I3 I2 I1 I0 a2 a1 a0 Y0 What about the dont cares?

Implementing with 4:16 Decoder & OR gates I3:msb LABELS!! Y1 a3 I3 I2 I1 I0 a2 a1 a0 Y0

Tree of decoders Implementing a function with n inputs using n to 2^n decoder is straightforward, but can we use smaller decoders? We need to know how to build big decoders from smaller ones. 4:16 decoder from 3:8 ones. 4:16 decoder from 2:4 ones ….

4:16 decoders form 3:8 ones 1 ? ? a2 a1 a0 ? I2: msb a3 ? ? a2 a1 a0 ?

4:16 decoders form 3:8 ones The OR gates will not change a3’ a3’a2’a1’a0’ a3’a2’a1’a0 a2 I2 I1 I0 a1 a0 y3 y5 Y1 y6 a3’a2a1a0 y7 y9 I2: msb a3 a3a2’a1’a0’ a3a2’a1’a0 a2 I2 I1 I0 y1 a1 y2 Y0 a0 y4 y7 y8 a3a2a1a0

4:16 decoders form 2:4 ones

Multiplexer Based on the value of the selectors, one of the inputs are selected and connected to the output. One output N selectors 2^N inputs

Example If (X0,X1,X2,X3)= (1,0,1,0) and (S1,S0)=(1,0) then Y = ? If (X0,X1,X2,X3)= (1,0,1,0) and (S1,S0)=(0,1) then Y = ? If (X0,X1,X2,X3)= (1,0,1,0) and (S1,S0)=(1,1) then Y = ? 1 1 S1 is the msb

Example What is function Y? Y = ? 1 a a’ 1 b c

Example What is function Y? 1 Y = b’c’ + b’c + bc’ + bc If b=0 and c =0 , X0 will be selected which is equal to a. So a will appear at the output y only if b’c’ is true -> ab’c’ 1 a a’ 1 b c

Example What is function Y? 1 Y = a b’c’ + a’ b’c + 1 bc’ + 0 bc b c

Example 1 1 d y1 1 f a’ 1 d’ y2 b c What is function f? We need to find y1 and y2. 1 d 1 1 y1 f a’ ? ? ? ? 1 d’ y2 b c

Example y1 = a’ + a ? ? 1 d 1 y1 1 f a’ 1 d’ y2 b c

Example d 1 1 d 1 1 y1 ? ? f a’ 1 d’ y2 b c y1 = a’ + a = da’ + a 1 d’ y2 b c

Example d 1 1 1 d y1 1 f a’ 1 d’ y2 b c y1 = a’ + a = da’ + a y2= a’ + a = a’d’ Now we can get the expression for f. d 1 1 d 1 1 y1 d’ f a’ 1 d’ y2 b c

Example 1 1 d y1 1 f a’ 1 d’ y2 b c y1 = da’ + a y2= a’d’ f= b’c’+ b’c + bc’ + bc 1 d 1 1 y1 f a’ 1 d’ y2 b c

Example y1 = da’ + a 1 y2= a’d’ f= b’c’+ b’c + bc’ + bc 1 d = (da’+a) b’c’ + a’b’c + a’d’bc 1 d 1 1 y1 y1 a’ y2 f a’ 1 d’ y2 b c

Implement with 8:1 mux S2 is msb a b c Y 1 x 1 a=0,b=0,c=0 1 1 x 1 a=0,b=0,c=0 1 a=0,b=0,c=1 a=0,b=1,c=0

Implement with 4:1 mux a b c Y 1 x 1 ?

Implement with 4:1 mux a b c Y 1 x c ?

Implement with 4:1 mux a b c Y 1 x 1 c ?

Implement with 4:1 mux a b c Y 1 x 1 c 1 ?

Implement with 4:1 mux a b c Y 1 x 1 c 1 c’

Implement with 2:1 muxes a b c Y 1 x If a = 0, then D(b=0,c=0) =0 1 x If a = 0, then D(b=0,c=0) =0 D(b=0,c=1) =1 D(b=1,c=0) =0 D(b=1,c=1) =0 1 D? We define another function D in which “a” is constant. D depends on b,c. We want to find the expression for D!

Implement with 2:1 muxes a b c Y 1 x If a = 0, then D(b=0,c=0) =0 1 x If a = 0, then D(b=0,c=0) =0 D(b=0,c=1) =1 D(b=1,c=0) =0 D(b=1,c=1) =0 1 D b\c c=0 c=1 b=0 1 b=1 But we dont have an AND gate! D=b’c

Implement with 2:1 muxes 1 D=b’c D(b=0, c) =c D(b=1, c) =0 c a b c Y 1 1 x b’c 1 b This mux implements b’c. b’c + 0b = b’c

Implement with 2:1 muxes 1 c a b c Y 1 x b’c 1 b H? If a = 0, then 1 x b’c 1 b H? If a = 0, then H(b=0,c=0) =1 H(b=0,c=1) =X H(b=1,c=0) =1 H(b=1,c=1) =0 b\c c=0 c=1 b=0 1 X b=1 H=c’

Implement with 2:1 muxes 1 c a b c Y 1 x b’c 1 b c’ If a = 0, then 1 x b’c 1 b c’ If a = 0, then H(b=0,c=0) =1 H(b=0,c=1) =X H(b=1,c=0) =1 H(b=1,c=1) =0 b\c c=0 c=1 b=0 1 X b=1 H=c’

Implement with 2:1 muxes 1 c a b c Y 1 x b’c 1 b c’

Half Adder A B S C 1

Full Adder A B Cin S Co 1

Ripple Carry Adder Disadvantage: Slow Similar to last slide, you can replace FA with 2 HA, logic gates, etc.

ALU Design ALU with two 4 bit inputs A, B and 2 control inputs X, Z. X Y Operation A 1 -A A xor B A nand B

Design Circuit for A and -A F = A when Z = 0 F = -A when Z=1 ( -A is 2’s complement of A)

ALU Design