1 Ó1998 Morgan Kaufmann Publishers Chapter 4 計算機算數.

Slides:



Advertisements
Similar presentations
Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
Advertisements

Chapter Three.
Computer Organization CS224 Fall 2012 Lesson 19. Floating-Point Example  What number is represented by the single-precision float …00 
Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
CSCE 212 Chapter 3: Arithmetic for Computers Instructor: Jason D. Bakos.
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Computer Arithmetic : Floating- point CS 3339 Lecture 5 Apan Qasem Texas State University Spring 2015 *some slides adopted from P&H.
Microprocessors The MIPS Architecture (Floating Point Instruction Set) Mar 26th, 2002.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
Chapter 3 Arithmetic for Computers. Multiplication More complicated than addition accomplished via shifting and addition More time and more area Let's.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 9 - Floating.
L11 – Floating Point 1 Comp 411 – Fall /21/2009 Floating-Point Arithmetic Reading: Study Chapter 3.5 Skim if ((A + A) - A == A) { SelfDestruct()
1  2004 Morgan Kaufmann Publishers Chapter Three.
ECE Computer Organization Floating Point Feb 2005 Reading: HW Due Monday 3/28: 3.7,3.9, 3.10, , 3.35, 3.37, 3.38, 3.40, 3.44 EXAM.
Computer Systems Organization: Lecture 3
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Chapter Four Arithmetic and Logic Unit
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
ECE 232 L9.Mult.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 9 Computer Arithmetic.
Systems Architecture Lecture 14: Floating Point Arithmetic
Computer Architecture ALU Design : Division and Floating Point
Computer Arithmetic 國立清華大學資訊工程學系 黃婷婷教授. Outline  Addition and subtraction (Sec. 3.2)  Constructing an arithmetic logic unit (Appendix C) Building ALU.
Ellen Spertus MCS 111 October 11, 2001 Floating Point Arithmetic.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif Department of Computer Science York University Handout # 5 Unsigned integer and floating point.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /14/2013 Lecture 16: Floating Point Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
1 ECE369 Sections 3.5, 3.6 and ECE369 Number Systems Fixed Point: Binary point of a real number in a certain position –Can treat real numbers as.
Lecture 9: Floating Point
Floating Point Representation for non-integral numbers – Including very small and very large numbers Like scientific notation – –2.34 × –
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
FLOATING POINT ARITHMETIC P&H Slides ECE 411 – Spring 2005.
CS4100: 計算機結構 Computer Arithmetic 國立清華大學資訊工程學系 九十三學年度第一學期 Adapted from class notes of D. Patterson and W. Dally Copyright 1998, 2000 UCB.
CHAPTER 3 Floating Point.
1 Ó1998 Morgan Kaufmann Publishers Chapter 4 計算機算數.
CDA 3101 Fall 2013 Introduction to Computer Organization
1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.
MIPS mul div, and MIPS floating point instructions.
Floating Point Numbers Opening Discussion zWhat did we talk about last class? zHave you seen anything interesting in the news?
CSE 340 Simulation Modeling | MUSHFIQUR ROUF CSE340:
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Computer Organization & Design 计算机组成与设计 Weidong Wang ( 王维东 ) College of Information Science & Electronic Engineering 信息与通信工程研究所 Zhejiang.
Computer System Design Lecture 3
Array multiplier TU/e Processor Design 5Z032.
Morgan Kaufmann Publishers Arithmetic for Computers
Computer Architecture & Operations I
Arithmetic for Computers
Chapter Three : Arithmetic for Computers
Floating-Point Arithmetic
Floating-Point Arithmetic
CS/COE0447 Computer Organization & Assembly Language
Computer Organization & Design 计算机组成与设计
Floating Point Arithmetics
Arithmetic for Computers
Lecture 10: Floating Point, Digital Design
Systems Architecture I
Computer Arithmetic Multiplication, Floating Point
Addition & Subtraction
October 17 Chapter 4 – Floating Point Read 5.1 through 5.3 1/16/2019
Digital System Design II 数字系统设计2
Chapter 3 Arithmetic for Computers
Morgan Kaufmann Publishers Arithmetic for Computers
Chapter 4 計算機算數.
Chapter 3 Arithmetic for Computers
CDA 3101 Spring 2016 Introduction to Computer Organization
Presentation transcript:

1 Ó1998 Morgan Kaufmann Publishers Chapter 4 計算機算數

2 Ó1998 Morgan Kaufmann Publishers Outline

3 Ó1998 Morgan Kaufmann Publishers Problem: Designing MIPS ALU

4 Ó1998 Morgan Kaufmann Publishers Functional Specification

5 Ó1998 Morgan Kaufmann Publishers A Bit-slice ALU

6 Ó1998 Morgan Kaufmann Publishers A 1-bit ALU

7 Ó1998 Morgan Kaufmann Publishers A 4-bit ALU

8 Ó1998 Morgan Kaufmann Publishers How about Subtraction?

9 Ó1998 Morgan Kaufmann Publishers Revised Diagram

10 Ó1998 Morgan Kaufmann Publishers Overflow

11 Ó1998 Morgan Kaufmann Publishers Overflow Detection

12 Ó1998 Morgan Kaufmann Publishers Overflow Detection Logic

13 Ó1998 Morgan Kaufmann Publishers Zero Detection Logic

14 Ó1998 Morgan Kaufmann Publishers Putting It Altogether (I)

15 Ó1998 Morgan Kaufmann Publishers Putting It Altogether (II)

16 Ó1998 Morgan Kaufmann Publishers

17 Ó1998 Morgan Kaufmann Publishers Problems with Ripple Carry Adder

18 Ó1998 Morgan Kaufmann Publishers Carry Lookahead: Theory (I)

19 Ó1998 Morgan Kaufmann Publishers Carry Lookahead: Theory (II)

20 Ó1998 Morgan Kaufmann Publishers Cascaded Carry Lookahead

21 Ó1998 Morgan Kaufmann Publishers

22 Ó1998 Morgan Kaufmann Publishers Carry-select Adder

23 Ó1998 Morgan Kaufmann Publishers Add XOR to ALU

24 Ó1998 Morgan Kaufmann Publishers Shifters

25 Ó1998 Morgan Kaufmann Publishers Combinational Shifter What comes in the MSBs? how many levels for 32-bit shifter? what if we use 4-1 Muxes ?

26 Ó1998 Morgan Kaufmann Publishers Outline

27 Ó1998 Morgan Kaufmann Publishers Multiplication in MIPS

28 Ó1998 Morgan Kaufmann Publishers Division in MIPS

29 Ó1998 Morgan Kaufmann Publishers MIPS Multiply/Divide Summary

30 Ó1998 Morgan Kaufmann Publishers Unsigned Multiply

31 Ó1998 Morgan Kaufmann Publishers Unisigned Multiplier (Ver. 1)

32 Ó1998 Morgan Kaufmann Publishers

33 Ó1998 Morgan Kaufmann Publishers Observations: Multiply Ver. 1

34 Ó1998 Morgan Kaufmann Publishers Unisigned Multiplier (Ver. 2)

35 Ó1998 Morgan Kaufmann Publishers

36 Ó1998 Morgan Kaufmann Publishers Unisigned Multiplier (Ver. 3)

37 Ó1998 Morgan Kaufmann Publishers

38 Ó1998 Morgan Kaufmann Publishers Observations: Multiply Ver. 3

39 Ó1998 Morgan Kaufmann Publishers Booth’s Algorithm: Motivation

40 Ó1998 Morgan Kaufmann Publishers Booth’s Algorithm: Rationale

41 Ó1998 Morgan Kaufmann Publishers Booth’s Algorithm

42 Ó1998 Morgan Kaufmann Publishers Booths Example (2 x 7)

43 Ó1998 Morgan Kaufmann Publishers Booths Example (2 x -3)

44 Ó1998 Morgan Kaufmann Publishers Combinational Multiplier

45 Ó1998 Morgan Kaufmann Publishers How Does It Work?

46 Ó1998 Morgan Kaufmann Publishers Outline

47 Ó1998 Morgan Kaufmann Publishers Divide: Paper & Pencil

48 Ó1998 Morgan Kaufmann Publishers Divide Hardware (Version 1)

49 Ó1998 Morgan Kaufmann Publishers

50 Ó1998 Morgan Kaufmann Publishers Observations: Divide Version 1

51 Ó1998 Morgan Kaufmann Publishers Divide Hardware (Version 2)

52 Ó1998 Morgan Kaufmann Publishers

53 Ó1998 Morgan Kaufmann Publishers Observations: Divide Version 2

54 Ó1998 Morgan Kaufmann Publishers Divide Hardware (Version 3)

55 Ó1998 Morgan Kaufmann Publishers

56 Ó1998 Morgan Kaufmann Publishers Observations: Divide Version 3

57 Ó1998 Morgan Kaufmann Publishers Outline

58 Ó1998 Morgan Kaufmann Publishers Floating-Point: Motivation

59 Ó1998 Morgan Kaufmann Publishers Scientific Notation: Binary

60 Ó1998 Morgan Kaufmann Publishers FP Representation

61 Ó1998 Morgan Kaufmann Publishers Double Precision Representation

62 Ó1998 Morgan Kaufmann Publishers IEEE 754 Standard (1/4)

63 Ó1998 Morgan Kaufmann Publishers IEEE 754 Standard (2/4)

64 Ó1998 Morgan Kaufmann Publishers IEEE 754 Standard (3/4)

65 Ó1998 Morgan Kaufmann Publishers IEEE 754 Standard (4/4)

66 Ó1998 Morgan Kaufmann Publishers Example: FP to Decimal

67 Ó1998 Morgan Kaufmann Publishers Continuing Example: Binary to ???

68 Ó1998 Morgan Kaufmann Publishers Big Idea: Type Not Associated with Data

69 Ó1998 Morgan Kaufmann Publishers Example: Decimal to FP

70 Ó1998 Morgan Kaufmann Publishers Representation for 0

71 Ó1998 Morgan Kaufmann Publishers Special Numbers

72 Ó1998 Morgan Kaufmann Publishers Representation for +/- Infinity

73 Ó1998 Morgan Kaufmann Publishers Representation for Not a Number

74 Ó1998 Morgan Kaufmann Publishers Special Numbers (cont’d)

75 Ó1998 Morgan Kaufmann Publishers Floating-Point Addition

76 Ó1998 Morgan Kaufmann Publishers

77 Ó1998 Morgan Kaufmann Publishers Floating-Point Multiplication (4) set the sign of product

78 Ó1998 Morgan Kaufmann Publishers MIPS Floating Point

79 Ó1998 Morgan Kaufmann Publishers MIPS Floating Point Instructions Organized as a coprocessor –Separate registers $f0-$f31 –Separate operations –Separate data transfer (to same memory) Basic operations –add.s - single add.d - double –sub.s - single sub.d - double –mul.s - single mul.d - double –div.s - single div.d - double

80 Ó1998 Morgan Kaufmann Publishers MIPS Floating Point Instructions (cont’d) Data transfer –lwc1, swcl (l.s, s.s) - load/store float to fp reg –l.d, s.d - load/store double to fp reg pair Testing / branching –c.lt.s, c.lt.d, c.eq.s, c.eq.d, … compare and set condition bit if true –bclt - branch if condition true –bclf - branch if condition false

81 Ó1998 Morgan Kaufmann Publishers Rounding

82 Ó1998 Morgan Kaufmann Publishers Round to Even

83 Ó1998 Morgan Kaufmann Publishers Floating Point Fallacy

84 Ó1998 Morgan Kaufmann Publishers Summary