درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Advertisements

1 ECE 4436ECE 5367 Computer Arithmetic I-II. 2 ECE 4436ECE 5367 Addition concepts 1 bit adder –2 inputs for the operands. –Third input – carry in from.
Chapter 4 -- Modular Combinational Logic. Decoders.
Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
1 Lecture 12: Hardware for Arithmetic Today’s topics:  Designing an ALU  Carry-lookahead adder Reminder: Assignment 5 will be posted in a couple of days.
Comparator.
Datorteknik ArithmeticCircuits bild 1 Computer arithmetic Somet things you should know about digital arithmetic: Principles Architecture Design.
Lecture Adders Half adder.
DPSD This PPT Credits to : Ms. Elakya - AP / ECE.
Henry Hexmoor1 Chapter 5 Arithmetic Functions Arithmetic functions –Operate on binary vectors –Use the same subfunction in each bit position Can design.
ECE 331 – Digital System Design
Contemporary Logic Design Multi-Level Logic © R.H. Katz Transparency No Chapter # 3: Multi-Level Combinational Logic 3.3 and Time Response.
EECS Components and Design Techniques for Digital Systems Lec 17 – Addition, Subtraction, and Negative Numbers David Culler Electrical Engineering.
CSE-221 Digital Logic Design (DLD)
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
Lecture 8 Arithmetic Logic Circuits
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
CS 105 Digital Logic Design
EECS Components and Design Techniques for Digital Systems Lec 15 – Addition, Subtraction, and Negative Numbers David Culler Electrical Engineering.
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
Digital Arithmetic and Arithmetic Circuits
ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
5-1 Programmable and Steering Logic Chapter # 5: Arithmetic Circuits.
Csci 136 Computer Architecture II – Constructing An Arithmetic Logic Unit Xiuzhen Cheng
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
Computing Systems Designing a basic ALU.
Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
CHAPTER 4 Combinational Logic Design- Arithmetic Operation (Section 4.6&4.9)
DIGITAL CIRCUITS David Kauchak CS52 – Fall 2015.
COE 202: Digital Logic Design Combinational Circuits Part 2 KFUPM Courtesy of Dr. Ahmad Almulhem.
1 Lecture 12 Time/space trade offs Adders. 2 Time vs. speed: Linear chain 8-input OR function with 2-input gates Gates: 7 Max delay: 7.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
Combinational Circuits
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
1 Carry Lookahead Logic Carry Generate Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate Pi = Ai xor Bi carry in will equal carry out here.
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Addition and multiplication Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
1 Arithmetic Building Blocks Today: Signed ArithmeticFirst Hour: Signed Arithmetic –Section 5.1 of Katz’s Textbook –In-class Activity #1 Second Hour: Adder.
Computer Arthmetic Chapter Four P&H.
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
Lecture Adders Half adder.
Reference: Moris Mano 4th Edition Chapter 4
Combinational Circuits
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 14 Logistics Last lecture Today
Arithmetic Circuits (Part I) Randy H
Instructor: Mozafar Bag-Mohammadi University of Ilam
Lecture 14 Logistics Last lecture Today
74LS283 4-Bit Binary Adder with Fast Carry
Arithmetic Circuits.
Lecture 2 Adders Half adder.
Presentation transcript:

درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه امیرکبیر

Adder and Subtractor

3 Half Adder (HA)  Add single bits Ai Bi Sum Carry Ai Bi Sum = Ai Bi + Ai Bi Ai  Bi = Ai  Bi Ai Bi Carry = Ai. Bi

4 Full Adder (FA)  For adding multiple bits, we need three inputs

5 Full Adder (FA) S = CI xor A xor B CO = B CI + A CI + A B = CI (A + B) + A B A B CI S CO A B CI A B CI S CO

6 Full Adder Using 2 Half Adders  A full adder can also be realized with two half adders and an OR gate, since C i+1 can also be expressed as:  C i+1 = A i B i + (Ai  B i )C i and S i = (A i  B i )  C i AiAiAiAi BiBiBiBi CiCiCiCi C i+1 SiSiSiSi

7 Example: 4-bit Ripple Carry Adder

8 Adder/Subtractor A - B = A + (-B) = A + B’ + 1

9 4-bit Binary Adder/Subtractor (cont.) S=0 0 B0B0 S=0 selects addition B1B1 B2B2 B3B3

10 4-bit Binary Adder/Subtractor (cont.) S=1 1 B0’B0’ S=1 selects subtraction B1’B1’B2’B2’B3’B3’

11 Overflow Detection  Overflow can occur ONLY when both numbers have the same sign.  This condition can be detected when the carry out (C n ) is different than the carry at the previous position (C n-1 ).

12 Overflow Detection n-bit Adder/Subtractor V C CnCn C n-1 C =1 indicates overflow condition when adding/subtr. unsigned numbers. V=1 indicates overflow condition when adding/subtr. signed-2’s complement numbers

13 Delay Analysis of Ripple Adder  Carry out of a single stage can be implemented in 2 gate delays after CI is ready.  For a 16 bit adder, the 16th bit carry is generated after about 16 * 2 = 32 gate delays.  The sum bit takes one additional gate delay to generate the sum of the 16th bit after 15th bit carry ~ 15 * = 31 gate delays  Takes too long - need to investigate FASTER adders!

14 Delay Analysis of Ripple Adder A A B B @N+2 late arriving signal two gate delays to compute CO 4 stage adder A 0 B 0 C 0 S C 0 A 1 B 1 S C 1 A 2 B 2 S C 2 A 3 B 3 S C 3 A B @N+1

15 Carry Lookahead Adder Carry Generate  Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate  Pi = Ai xor Bi carry-in will equal carry-out here Sum and Carry can be reexpressed in terms of generate/propagate: Si = Ai xor Bi xor Ci = Pi xor Ci Ci+1 = Ai Bi + Ai Ci + Bi Ci = Ai Bi + Ci (Ai + Bi) = Ai Bi + Ci (Ai xor Bi) = Gi + Ci Pi

16 Carry Lookahead Adder C1 = G0 + P0 C0 C2 = G1 + P1 C1 = G1 + P1 G0 + P1 P0 C0 C3 = G2 + P2 C2 = G2 + P2 G1 + P2 P1 G0 + P2 P1 P0 C0 C4 = G3 + P3 C3 = G3 + P3 G2 + P3 P2 G1 + P3 P2 P1 G0 + P3 P2 P1 P0 C0  Each of the carry equations can be implemented in a two-level logic network  Variables are the adder inputs.

17 CLA  Increasingly complex logic Pi Ci Si Bi Ai Gi C0 P0 G0 C1 C0 P0 G0 P1 G1 C2 C0 P0 G0 P1 G1 P2 G2 C3 C0 P0 G0 P1 G1 P2 G2 P3 @1

18 Delay Analysis of CLA  Ci’s are generated independent of N 4 stage adder final sum and carry A 3 B 3 S C 3 A 0 B 0 C 0 S C 0 A 1 B 1 S C 1 A 2 B 2 S C 2  NOTE HOWEVER THIS ASSUMES ALL GATE DELAYS ARE SAME  Not true, delays depand on fan-ins and fan-out

19 BCD Addition Addition: 5 = = = 8 5 = = = 13! Problem when digit sum exceeds 9 Solution: add 6 (0110) if sum exceeds 9! 5 = = = = 1 3 in BCD 9 = = = 16 in binary 6 = = 1 6 in BCD

20 BCD Adder Add 0110 to sum whenever it exceeds 1001 (11XX or 1X1X) FAFAFAFA FAFA Cin A 3 A 2 A 1 A 0 B 3 B 2 B 1 B 0 CoutS 3 S 2 S 1 S 0 0 COCI S COCI S COCI S COCI S COCI S COCI S 11XX A1 A2 1X1X

21 Multiplier

22 4-variable K-map for each of the 4 output functions A2A1B2B1P8P4P2P x2-bit Multiplier P1 P2 P4 P8 A1 A2 B1 B2

23 K-map for P8 K-map for P4 K-map for P2 K-map for P1 2x2-bit Multiplier (cont’d) B1 A A1 B B1 A A1 B B1 A A1 B B1 A A1 B2 P8 = A2A1B2B1 P4= A2B2B1' + A2A1'B2 P2= A2'A1B2 + A1B2B1' + A2B2'B1 + A2A1'B1 P1= A1B1

24 Y0 Multiplier X0 Y0 X0 Y0 X1 Y1 X1 Y0 X0 Y1 X2 Y2 X2 Y0 X1 Y1 X0 Y2 X3 Y3 X2 Y0 X2 Y1 X1 Y2 X0 Y3 X3 Y1 X2 Y2 X1 Y3 X3 Y2 X2 Y3 X3 Y3 Z6 Z5 Z4 Z3Z2 Z1Z0 Z7

25 4-Bit ALU TTL ALU  Arithmetic-Logic Unit

26 4-Bit ALU