How Computers Work Lecture 4 Page 1 How Computers Work Lecture 4 Computer Arithmetic.

Slides:



Advertisements
Similar presentations
Lecture 19: Hardware for Arithmetic Today’s topic –Designing an ALU –Carry Look-Ahead Adder 1.
Advertisements

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.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
SYEN 3330 Digital SystemsJung H. Kim Chapter5-1 1 SYEN 3330 Digital Systems Chapter 5 – Part 1.
Lecture 20: Hardware for Arithmetic Today’s topic –Carry Look-Ahead Adder 1.
Fast Adders See: P&H Chapter 3.1-3, C Goals: serial to parallel conversion time vs. space tradeoffs design choices.
Fast Adders See: P&H Chapter 3.1-3, C Goals: serial to parallel conversion time vs. space tradeoffs design choices.
ECE 331 – Digital System Design
EECS Components and Design Techniques for Digital Systems Lec 18 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Introduction to CMOS VLSI Design Lecture 11: Adders
Fall 2008EE VLSI Design I - © Kia Bazargan 1 EE 5323 – VLSI Design I Kia Bazargan University of Minnesota Adders.
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,
Adders, subtractors, ALUs
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Constructing a Computer Creating a general purpose computing device.
Adders and Multipliers Review. ARITHMETIC CIRCUITS Is a combinational circuit that performs arithmetic operations, e.g. –Addition –Subtraction –Multiplication.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
IKI a-Combinatorial Components Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Chapter 6-1 ALU, Adder and Subtractor
Arithmetic Building Blocks
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Advanced VLSI Design Unit 05: Datapath Units. Slide 2 Outline  Adders  Comparators  Shifters  Multi-input Adders  Multipliers.
Csci 136 Computer Architecture II – Constructing An Arithmetic Logic Unit Xiuzhen Cheng
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
EECS Components and Design Techniques for Digital Systems Lec 16 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
1 CPSC3850 Adders and Simple ALUs Simple Adders Figures 10.1/10.2 Binary half-adder (HA) and full-adder (FA). Digit-set interpretation: {0, 1}
CSE115: Digital Design Lecture 20: Comparators, Adders and Subtractors Faculty of Engineering.
How Computers Work Lecture 5 Page 1 How Computers Work Lecture 5 Memory Implementation.
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.
Computer Architecture, The Arithmetic/Logic UnitSlide 1 Part III The Arithmetic/Logic Unit.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
CHAPTER 4 Combinational Logic Design- Arithmetic Operation (Section 4.6&4.9)
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices X-OR gates and Parity circuits Comparators Adders, subtractors,
Spring C:160/55:132 Page 1 Lecture 19 - Computer Arithmetic March 30, 2004 Sukumar Ghosh.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
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.
Computer Architecture Lecture 16 Fasih ur Rehman.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
EKT 221 : Digital 2 Serial Transfers & Microoperations Date : Lecture : 2 hr.
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.
How Computers Work Lecture 3 Page 1 How Computers Work Lecture 3 A Direct Execution RISC Processor: The Unpipelined BETA.
CPEN Digital System Design
Addition, Subtraction, Logic Operations and ALU Design
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
CSE 311 Foundations of Computing I Lecture 25 Circuits for FSMs, Carry-Look-Ahead Adders Autumn 2011 CSE 3111.
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. 2 Figure 10.1 Truth table and schematic diagram for a binary half-adder Simple Adders Half-adder.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
Grade School Again: A Parallel Perspective CS Lecture 7.
EE204 L03-ALUHina Anwar Khan EE204 Computer Architecture Lecture 03- ALU.
EE141 Arithmetic Circuits 1 Chapter 14 Arithmetic Circuits Rev /12/2003 Rev /05/2003.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Digital Circuits Design Chin-Sung Lin Eleanor Roosevelt High School.
Somet things you should know about digital arithmetic:
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
Homework Reading Machine Projects Labs
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 14 Logistics Last lecture Today
Homework Reading Machine Projects Labs
Part III The Arithmetic/Logic Unit
Lecture 14 Logistics Last lecture Today
Presentation transcript:

How Computers Work Lecture 4 Page 1 How Computers Work Lecture 4 Computer Arithmetic

How Computers Work Lecture 4 Page 2 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta Operate class: Rc op

How Computers Work Lecture 4 Page 3 What are we going to learn today? How to build the Arithmetic/Logical Unit –Integer adder and multiplier architectures –Time/Space/Cost Trade-offs

How Computers Work Lecture 4 Page 4 The ALU

How Computers Work Lecture 4 Page 5 A Wild and Crazy Idea: Arithmetic / Logic Unit is describable by a table: –ergo, we can implement it with a memory: Bad Idea, because: 2 ~70 is a large number of rows! A B ALUFN 32 A few 32

How Computers Work Lecture 4 Page 6 A 1 Bit Full Adder Ci Ci A A B B S S Co Co FA AB CoCo CiCi S Generates 1 sum bit, carry Can be cascaded to N bits

How Computers Work Lecture 4 Page 7 FA Ripple-carry N-bit adder: Problem: It’s Slow!

How Computers Work Lecture 4 Page 8 What is Co as a function of Ci, A, B ? Ci Ci A A B B S S Co Co

How Computers Work Lecture 4 Page 9 But What is Co really ? Ci Ci A A B B S S Co Co Co = 1 if 2 or more inputs are 1 !

How Computers Work Lecture 4 Page 10 How can we build simplified logic? Example: Full Adder : K-Map A B CiCi Ci Ci A A B B S S Co Co A B CiCi S: Co:Co:

How Computers Work Lecture 4 Page 11 The Karnaugh Map Characteristics: 1: Unit-Distance Input Labels 2: Wrap-Around

How Computers Work Lecture 4 Page 12 AND A B A B Q Q

How Computers Work Lecture 4 Page 13 OR A B A B Q Q

How Computers Work Lecture 4 Page 14 XOR A B A B Q Q

How Computers Work Lecture 4 Page 15 Q: What is Cout? A B CiCi

How Computers Work Lecture 4 Page 16 Q: What is Cout? A B CiCi A: (A and Ci) or (A and B) or (B and Ci) A: (A Ci) + (A B) + (B Ci) A: A Ci + A B + B Ci

How Computers Work Lecture 4 Page 17 How about S ? Ci Ci A A B B S S A B CiCi

How Computers Work Lecture 4 Page 18 Parity A B Ci S

How Computers Work Lecture 4 Page 19 Tree Structure N-input TREE has O(log(n)) levels... Signal propagation takes O(log(n)) gate delays. O(n) gates. A 2 A 1 A 4 A 3 A N

How Computers Work Lecture 4 Page 20 An Idea ! Speed things up by doing as much work as possible on A & B Inputs before the carry arrives: ? ?

How Computers Work Lecture 4 Page 21 Generate and Propagate G P CiCi G P CiCi S: Co:Co: A B A B G: P: (35) (36)

How Computers Work Lecture 4 Page 22 Implementation of C o G = A B P = A xor B AB GP CoutCin Cout = G + P Cin

How Computers Work Lecture 4 Page 23 Implementation of S G = A B P = A xor B GP S Cin S = P xor Cin

How Computers Work Lecture 4 Page 24 Yet Another Idea ! Carry Look-Ahead

How Computers Work Lecture 4 Page 25 The ALU

How Computers Work Lecture 4 Page 26 How Fast Can an Adder Get ? Input Sensitivity Analysis: Ultimately, some bits of the answer are dependent on all bits of the inputs. Given an infinite number of bounded fan- in gates, what is the minimum growth of t pd vs. the number of inputs (n)? –Answer: O(log(n))

How Computers Work Lecture 4 Page 27 Any more tricks to go faster? What about changing the Encoding of the inputs (i.e. base 4 !!!!!!!) –O(log(n)) limitation still there, but converting to a higher radix, doing the computation, then going back to binary CAN be faster than doing it naively in binary. How about analog computing? –Works, but watch out for noise. How about parallel computing? –Works, but watch out for cost. How about pipelined computing? –Q: What’s a pipelined computer? A: You’re going to find out real soon.

How Computers Work Lecture 4 Page 28 Summary Today’s Lecture: –How to build the Arithmetic/Logical Unit –Time/Space/Cost Trade-offs Recitation –K-maps and sum-of-products form –Multipliers