CENG 241 Digital Design 1 Lecture 6 Amirali Baniasadi

Slides:



Advertisements
Similar presentations
ADDER, HALF ADDER & FULL ADDER
Advertisements

CENG 241 Digital Design 1 Lecture 4
Conversion and Coding (12)10.
Combinational Circuits
CENG 241 Digital Design 1 Lecture 11
CENG 241 Digital Design 1 Lecture 1 Amirali Baniasadi
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices XOR, Parity Circuits, Comparators.
Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
Lecture #9 EGR 277 – Digital Logic
ECE 331 – Digital System Design
CSE-221 Digital Logic Design (DLD)
Binary & Decimal numbers = 3* * *10 + 5*1 = 3* * * *10 0 Decimal system: Ten digits: 0,1,2,3,…,9 Example:
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
DIGITAL SYSTEMS TCE OTHER COMBINATIONAL LOGIC CIRCUITS WEEK 7 AND WEEK 8 (LECTURE 1 OF 3) COMPARATORS CODE CONVERTERS.
Digital Circuits. Analog and Digital Signals Noise margins in Logic Circuits VMVM.
Digital Logic Design Lecture 19. Announcements Homework 6 due Thursday 11/6 Recitation quiz on Monday, 11/10 – Will cover material from lectures 18,19,20.
Number Systems and Codes In PLC
CS 105 Digital Logic Design
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
1.6 Signed Binary Numbers.
CENG 241 Digital Design 1 Lecture 5
Introduction to Digital Works. The Digital Works Window.
Chapter 2 Number Systems + Codes. Overview Objective: To use positional number systems To convert decimals to binary integers To convert binary integers.
Conversion and Coding (12) 10. Conversion and Coding (12) Conversion.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
Arithmetic Circuits. Half Adder ABSumCarry
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
Number Systems and Circuits for Addition Lecture 5 Section 1.5 Thu, Jan 26, 2006.
Universal college of engineering & technology. .By Harsh Patel)
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
Combinational Circuits
Digital Logic Design (CSNB163)
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Number Systems and Circuits for Addition – Binary Adders Lecture 6 Section 1.5 Fri, Jan 26, 2007.
CEC 220 Digital Circuit Design
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.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
More on Digital Logic Devices and Circuits Trac D. Tran ECE Department The Johns Hopkins University Baltimore, MD
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Lecture 4: Digital Systems & Binary Numbers (4)
Presented by A. Maleki Fall Semester, 2010
COMPUTER ARITHMETIC Arithmetic with Signed-2's Complement Numbers
Number Systems Write the decimal value of the binary number
Combinational Logic Design&Analysis.
Digital Systems and Binary Numbers
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Dept. of Electrical and Computer Eng., NCTU
Combinational Circuits
Reference: Moris Mano 4th Edition Chapter 4
Combinational Circuits
King Fahd University of Petroleum and Minerals
Number Systems and Circuits for Addition
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
Chapter 5 -Part 3.
Digital System Design Combinational Logic
DIGITAL ELECTRONICS B.SC FY
2’s Complement form 1’s complement form 2’s complement form
74LS283 4-Bit Binary Adder with Fast Carry
XOR Function Logic Symbol  Description  Truth Table 
ECE 331 – Digital System Design
Arithmetic Circuits.
Presentation transcript:

CENG 241 Digital Design 1 Lecture 6 Amirali Baniasadi

2 Decimal adder zWhen dealing with decimal numbers BCD code is used. zA decimal adders requires at least 9 inputs and 5 outputs. zBCD adder: each input does not exceed 9, the output can not exceed 19 zHow are decimal numbers presented in BCD? zDecimal Binary BCD z z (0001)(1001) z 1 9

3 Decimal Adder zDecimal numbers should be represented in binary code number. zExample: BCD adder zSuppose we apply two BCD numbers to a binary adder then: zThe result will be in binary and ranges from 0 through 19. zBinary sum: K(carry) Z8 Z4 Z2 Z1 zBCD sum : C(carry) S8 S4 S2 S1 zFor numbers equal or less than 1001 binary and BCD are identical. zFor numbers more than 1001, we should add 6(0110) to binary to get BCD. zexample: 10011(binary) = 11001(BCD) =19 zADD 6 to correct.

4 BCD adder Decides to add 6? Adds 6 Numbers that need correction (add 6) are: (10) (11) (12) (13) (14) (15) (16) (17) (18) (19)

5 BCD adder Numbers that need correction (add 6) are: K Z8 Z4 Z2 Z (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) C = K + Z8Z4 +Z8Z2

6 Magnitude Comparators zCompares two numbers, determines their relative magnitude. zWe look at a 4-bit magnitude comparator; zA=A3A2A1A0, B=B3B2B1B0 zTwo numbers are equal if all bits are equal. zA=B if A3=B3 AND A2=B2 AND A1=B1 AND A0=B0 zXi= AiBi + Ai’Bi’ ; Ai=Bi Xi=1 (remember exclusive NOR?)

7 Magnitude Comparators zHow do we know if A>B? z1.Compare bits starting from the most significant pair of digits z2.If the two are equal, compare the next lower significant bits z3.Continue until a pair of unequal digits are reached z4.Once the unequal digits are reached, A>B if Ai=1 and Bi=0, A<B if Ai=0 and Bi = 1 zA>B = A3B3’+X3A2B2’+X3X2A1B1’+X3X2X1A0B0’ zA<B = A3’B3+X3A2’B2+X3X2A1’B1+X3X2X1A0’B0 zXi=1 if Ai=Bi

8 Magnitude Comparators A3=B3 ? X3A2’B2

9 Decoders zA decoder converts binary information from n input lines to a maximum of 2 n output lines zAlso known as n-to-m line decoders where m< 2 n zExample 3-to-8 decoders.

10 Decoders: Truth Table zX Y Z D0 D1 D2 D3 D4 D5 D6 D7 z z z z z z z z

11 Decoders: AND implementation

12 2-to-4 Decoder: NAND implementation Decoder is enabled when E=0

13 How to build bigger decoders? We can combine two 3-to-8 decoders to build a 4-to-16 decoder. Generates from 0000 to 0111 Generates from 1000 to 1111

14 zA decoder provides the 2n minterms of n input variables. zAny function is can be expressed in sum of minterms. zUse a decoder to make the minterms and an external OR gate to make the sum. zExample: consider a full adder. zS(x,y,z) = Σ(1,2,4,7) zC(x,y,z) = Σ (3,5,6,7) Combinational Logic implementation

15 Combinational Logic implementation

16 Encoders zEncoders perform the inverse operation of a decoder: zEncoders have 2 n input lines and n output line. zOutput lines generate the binary code corresponding to the input value.

17 Encoders: Truth Table z Outputs Inputs zX Y Z D0 D1 D2 D3 D4 D5 D6 D7 z z z z z z z z zz=D1+D3+D5+D7 y=D2+D3+D6+D7 x=D4+D5+D6+D7

18 Priority Encoders zEncoder limitations: zIf two inputs are active, the output is undefined. zSolution: we need to take into account priority. zWhat if all inputs are 0? zSolution: we need a valid bit z Input Output zD0 D1 D2 D3 x y v z X X 0 z zX zX X zX X X

19 Priority Encoders: Map

20 Priority Encoders: Circuit

21 Multiplexers zMultiplexer: selects one binary input from many selections zexample: 2-to-1 MUX

22 4-to-1 MUX Directs 1 of the 4 inputs to the output

23 Multi-bit selection logic zMultiplexers can be combined with common selection inputs to support multi-bit selection logic

24 Implementing Boolean functions w/ MUX zGeneral rules for implementing any Boolean function with n variables: zUse a multiplexer with n-1 selection inputs and 2 n-1 data inputs zList the truth tabel zApply the first n-1 variables to the selection inputs of multiplexer zFor each combination evaluate the output as a function of the last variable. zThe function can be 0, 1 the variable or the complement of the variable.

25 Implementing Boolean functions w/ MUX

26 Implementing Boolean functions w/ MUX

27 Summary zReading up to page 154