Floating Point Arithmetic


 Lawrence Andrews
 8 months ago
 Views:
Transcription
1 Floating Point Arithmetic Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong
2 Arithmetic for Computers: An Overview Operations on integers Textbook: P&H Addition and subtraction Multiplication and division Dealing with overflow Floatingpoint real numbers Textbook: P&H 3.5 (for both 4 th and 5 th Editions) Representation and operations EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 2
3 Floating Point Number Encoding (IEEE 754 Standard) EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong
4 Floating Point Representation for nonintegral numbers Including very small and very large numbers Like scientific notation In binary ±1.xxxxxxx 2 2 yyyy Types float and double in C normalized not normalized EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 4
5 Floating Point Standard Defined by IEEE Std Developed in response to divergence of representations Portability issues for scientific code Now almost universally adopted Two representations Single precision (32bit) Double precision (64bit) EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 5
6 IEEE FloatingPoint Format single: 8 bits double: 11 bits single: 23 bits double: 52 bits S Exponent Fraction x = (1) S (1+ Fraction) 2 (Exponent Bias) S: sign bit (0 Þ nonnegative, 1 Þ negative) Normalize significand: 1.0 significand < 2.0 Always has a leading prebinarypoint 1 bit, so no need to represent it explicitly (hidden bit) Significand is Fraction with the 1. restored Exponent: excess representation: actual exponent + Bias Ensures exponent is unsigned Single: Bias = 127; Double: Bias = 1023 EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 6
7 SinglePrecision Range Exponents and reserved Smallest value Exponent: Þ actual exponent = = 126 Fraction: Þ significand = 1.0 ± ± Largest value Exponent: Þ actual exponent = = +127 Fraction: Þ significand 2.0 ± ± EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 7
8 DoublePrecision Range Exponents and reserved Smallest value Exponent: Þ actual exponent = = 1022 Fraction: Þ significand = 1.0 ± ± Largest value Exponent: Þ actual exponent = = Fraction: Þ significand 2.0 ± ± EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 8
9 FloatingPoint Precision Relative precision all fraction bits are significant Single: approx 2 23 Equivalent to 23 log decimal digits of precision Double: approx 2 52 Equivalent to 52 log decimal digits of precision EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 9
10 FloatingPoint Example Represent = ( 1) S = 1 Fraction = Exponent = 1 + Bias Single: = 126 = Double: = 1022 = Single: Double: EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 10
11 FloatingPoint Example What number is represented by the singleprecision float S = 1 Fraction = Fxponent = = 129 x = ( 1) 1 ( ) 2 = ( 1) = 5.0 ( ) EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 11
12 Denormal Numbers Exponent = Þ hidden bit is 0 x = ( 1) S (0+Fraction) 2 1 Bias Smaller than normal numbers allow for gradual underflow, with diminishing precision Denormal with fraction = x = ( 1) S (0+0) 2 1 Bias = ±0.0 Two representations of 0.0! EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 12
13 Infinities and NaNs Exponent = , Fraction = ±Infinity Can be used in subsequent calculations, avoiding need for overflow check Exponent = , Fraction NotaNumber (NaN) Indicates illegal or undefined result e.g., 0.0 / 0.0 Can be used in subsequent calculations EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 13
14 A Summary of IEEE 754 FP Standard Encoding Single Precision Double Precision Object Represented E (8) F (23) E (11) F (52) true zero (0) nonzero nonzero to +127,126 anything to +1023,1022 anything ± denormalized number ± floating point number ± infinity nonzero nonzero not a number (NaN) EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 14
15 Floating Point Arithmetic EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong
16 FloatingPoint Addition Consider a 4digit decimal example Align decimal points Shift number with smaller exponent Add significands = Normalize result & check for over/underflow Round and renormalize if necessary EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 16
17 FloatingPoint Addition Now consider a 4digit binary example ( ) 1. Align binary points Shift number with smaller exponent Add significands = Normalize result & check for over/underflow , with no over/underflow 4. Round and renormalize if necessary (no change) = EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 17
18 FP Adder Hardware Much more complex than integer adder Doing it in one clock cycle would take too long Much longer than integer operations Slower clock would penalize all instructions FP adder usually takes several cycles Can be pipelined EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 18
19 FP Adder Hardware Step 1 Step 2 Step 3 Step 4 EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 19
20 FloatingPoint Multiplication Consider a 4digit decimal example Add exponents For biased exponents, subtract bias from sum New exponent = = 5 2. Multiply significands = Þ Normalize result & check for over/underflow Round and renormalize if necessary Determine sign of result from signs of operands EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 20
21 FloatingPoint Multiplication Now consider a 4digit binary example ( ) 1. Add exponents Unbiased: = 3 Biased: ( ) + ( ) = = Multiply significands = Þ Normalize result & check for over/underflow (no change) with no over/underflow 4. Round and renormalize if necessary (no change) 5. Determine sign: +ve ve Þ ve = EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 21
22 FP Arithmetic Hardware FP multiplier is of similar complexity to FP adder But uses a multiplier for significands instead of an adder FP arithmetic hardware usually does Addition, subtraction, multiplication, division, reciprocal, squareroot FP «integer conversion Operations usually takes several cycles Can be pipelined EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 22
23 FP Instructions in MIPS FP hardware is coprocessor 1 Adjunct processor that extends the ISA Separate FP registers 32 singleprecision: $f0, $f1, $f31 Paired for doubleprecision: $f0/$f1, $f2/$f3, Release 2 of MIPS ISA supports bit FP reg s FP instructions operate only on FP registers Programs generally don t do integer ops on FP data, or vice versa More registers with minimal codesize impact FP load and store instructions lwc1, ldc1, swc1, sdc1 e.g., ldc1 $f8, 32($sp) EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 23
24 FP Instructions in MIPS Singleprecision arithmetic add.s, sub.s, mul.s, div.s e.g., add.s $f0, $f1, $f6 Doubleprecision arithmetic add.d, sub.d, mul.d, div.d e.g., mul.d $f4, $f4, $f6 Single and doubleprecision comparison c.xx.s, c.xx.d (xx is eq, neq,lt, le, gt, ge) Sets or clears FP conditioncode bit e.g. c.lt.s $f3, $f4 Branch on FP condition code true or false bc1t, bc1f e.g., bc1t TargetLabel EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 24
25 FP Example: F to C C code: float f2c (float fahr) { return ((5.0/9.0)*(fahr )); } fahr in $f12, result in $f0, literals in global memory space Compiled MIPS code: f2c: lwc1 $f16, const5($gp) lwc2 $f18, const9($gp) div.s $f16, $f16, $f18 lwc1 $f18, const32($gp) sub.s $f18, $f12, $f18 mul.s $f0, $f16, $f18 jr $ra EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 25
26 Accurate Arithmetic IEEE Std 754 specifies additional rounding control Extra bits of precision (guard, round, sticky) Choice of rounding modes Allows programmer to finetune numerical behavior of a computation Not all FP units implement all options Most programming languages and FP libraries just use defaults Tradeoff between hardware complexity, performance, and market requirements EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 26
27 Associativity Parallel programs may interleave operations in unexpected orders Assumptions of associativity may fail (x+y)+z x 1.50E+38 y 1.50E E+00 z E+00 x+(y+z) 1.50E E E+00 Need to validate parallel programs under varying degrees of parallelism EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 27
28 Concluding Remarks ISAs support arithmetic Signed and unsigned integers Floatingpoint approximation to reals Bounded range and precision Operations can overflow and underflow MIPS ISA Core instructions: 54 most frequently used 100% of SPECINT, 97% of SPECFP Other instructions: less frequent EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong 28
CSCI 402: Computer Architectures. Arithmetic for Computers (4) Fengguang Song Department of Computer & Information Science IUPUI.
CSCI 402: Computer Architectures Arithmetic for Computers (4) Fengguang Song Department of Computer & Information Science IUPUI Homework 4 Assigned on Feb 22, Thursday Due Time: 11:59pm, March 5 on Monday
More informationChapter 3 Arithmetic for Computers (Part 2)
Department of Electr rical Eng ineering, Chapter 3 Arithmetic for Computers (Part 2) 王振傑 (ChenChieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Depar rtment of Electr rical Eng ineering, FengChia Unive
More information3.5 Floating Point: Overview
3.5 Floating Point: Overview Floating point (FP) numbers Scientific notation Decimal scientific notation Binary scientific notation IEEE 754 FP Standard Floating point representation inside a computer
More informationFloating Point COE 308. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals
Floating Point COE 38 Computer Architecture Prof. Muhamed Mudawar Computer Engineering Department King Fahd University of Petroleum and Minerals Presentation Outline FloatingPoint Numbers IEEE 754 FloatingPoint
More informationComputer Architecture. Chapter 3: Arithmetic for Computers
182.092 Computer Architecture Chapter 3: Arithmetic for Computers Adapted from Computer Organization and Design, 4 th Edition, Patterson & Hennessy, 2008, Morgan Kaufmann Publishers and Mary Jane Irwin
More informationFloatingpoint Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.
Floatingpoint Arithmetic Reading: pp. 312328 FloatingPoint Representation Nonscientific floating point numbers: A noninteger can be represented as: 2 4 2 3 2 2 2 1 2 0.21 22 23 24 where you sum
More informationChapter 3 Arithmetic for Computers
Chapter 3 Arithmetic for Computers 1 Arithmetic for Computers Operations on integers Addition and subtraction Multiplication and division Dealing with overflow Floatingpoint real numbers Representation
More informationFloating Point Numbers
Floating Point Numbers Summer 8 Fractional numbers Fractional numbers fixed point Floating point numbers the IEEE 7 floating point standard Floating point operations Rounding modes CMPE Summer 8 Slides
More informationCOMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 3 Arithmetic for Computers Arithmetic for Computers Operations on integers Addition and subtraction Multiplication
More informationCOMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 3 Arithmetic for Computers Arithmetic for Computers Operations on integers Addition and subtraction Multiplication
More informationArithmetic. Chapter 3 Computer Organization and Design
Arithmetic Chapter 3 Computer Organization and Design Addition Addition is similar to decimals 0000 0111 + 0000 0101 = 0000 1100 Subtraction (negate) 0000 0111 + 1111 1011 = 0000 0010 Over(under)flow For
More informationFloating Point. The World is Not Just Integers. Programming languages support numbers with fraction
1 Floating Point The World is Not Just Integers Programming languages support numbers with fraction Called floatingpoint numbers Examples: 3.14159265 (π) 2.71828 (e) 0.000000001 or 1.0 10 9 (seconds in
More informationCO Computer Architecture and Programming Languages CAPL. Lecture 15
CO20320241 Computer Architecture and Programming Languages CAPL Lecture 15 Dr. Kinga Lipskoch Fall 2017 How to Compute a Binary Float Decimal fraction: 8.703125 Integral part: 8 1000 Fraction part: 0.703125
More informationFloatingPoint Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3
FloatingPoint Data Representation and Manipulation 198:231 Introduction to Computer Organization Instructor: Nicole Hynes nicole.hynes@rutgers.edu 1 Fixed Point Numbers Fixed point number: integer part
More informationIEEE Standard for FloatingPoint Arithmetic: 754
IEEE Standard for FloatingPoint Arithmetic: 754 G.E. Antoniou G.E. Antoniou () IEEE Standard for FloatingPoint Arithmetic: 754 1 / 34 Floating Point Standard: IEEE 754 1985/2008 Established in 1985 (2008)
More informationFloating Point Numbers. Lecture 9 CAP
Floating Point Numbers Lecture 9 CAP 3103 06162014 Review of Numbers Computers are made to deal with numbers What can we represent in N bits? 2 N things, and no more! They could be Unsigned integers:
More informationComputer Architecture Review. Jo, Heeseung
Computer Architecture Review Jo, Heeseung Computer Abstractions and Technology Jo, Heeseung Below Your Program Application software Written in highlevel language System software Compiler: translates HLL
More informationFloating Point Arithmetic
Floating Point Arithmetic CS 365 FloatingPoint What can be represented in N bits? Unsigned 0 to 2 N 2s Complement 2 N1 to 2 N11 But, what about? very large numbers? 9,349,398,989,787,762,244,859,087,678
More informationFloatingPoint Arithmetic
FloatingPoint Arithmetic if ((A + A)  A == A) { SelfDestruct() } L11 Floating Point 1 What is the problem? Many numeric applications require numbers over a VERY large range. (e.g. nanoseconds to centuries)
More informationThe Sign consists of a single bit. If this bit is '1', then the number is negative. If this bit is '0', then the number is positive.
IEEE 754 Standard  Overview Frozen Content Modified by on 13Sep2017 Before discussing the actual WB_FPU  Wishbone Floating Point Unit peripheral in detail, it is worth spending some time to look at
More informationChapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers
Chapter 03: Computer Arithmetic Lesson 09: Arithmetic using floating point numbers Objective To understand arithmetic operations in case of floating point numbers 2 Multiplication of Floating Point Numbers
More informationIntegers and Floating Point
CMPE12 More about Numbers Integers and Floating Point (Rest of Textbook Chapter 2 plus more)" Review: Unsigned Integer A string of 0s and 1s that represent a positive integer." String is X n1, X n2,
More informationFloating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !
Floating point Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties Next time! The machine model Chris Riesbeck, Fall 2011 Checkpoint IEEE Floating point Floating
More informationFloatingPoint Arithmetic
FloatingPoint Arithmetic if ((A + A)  A == A) { SelfDestruct() } Reading: Study Chapter 4. L12 Multiplication 1 Why Floating Point? Aren t Integers enough? Many applications require numbers with a VERY
More informationPrecision and Accuracy
inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 16 Floating Point II 20100226 TA Michael Greenbaum www.cs.berkeley.edu/~cs61ctf Research without Google would be like life
More informationC NUMERIC FORMATS. Overview. IEEE SinglePrecision Floatingpoint Data Format. Figure C0. Table C0. Listing C0.
C NUMERIC FORMATS Figure C. Table C. Listing C. Overview The DSP supports the 32bit singleprecision floatingpoint data format defined in the IEEE Standard 754/854. In addition, the DSP supports an
More informationChapter 2 Float Point Arithmetic. Real Numbers in Decimal Notation. Real Numbers in Decimal Notation
Chapter 2 Float Point Arithmetic Topics IEEE Floating Point Standard Fractional Binary Numbers Rounding Floating Point Operations Mathematical properties Real Numbers in Decimal Notation Representation
More informationFloating point. Today. IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.
Floating point Today IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time The machine model Fabián E. Bustamante, Spring 2010 IEEE Floating point Floating point
More informationThe Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University
The Processor (1) Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong (jinkyu@skku.edu)
More informationData Representation Floating Point
Data Representation Floating Point CSCI 2400 / ECE 3217: Computer Architecture Instructor: David Ferry Slides adapted from Bryant & O Hallaron s slides via Jason Fritts Today: Floating Point Background:
More informationSystems I. Floating Point. Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties
Systems I Floating Point Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties IEEE Floating Point IEEE Standard 754 Established in 1985 as uniform standard for
More informationRepresenting and Manipulating Floating Points
Representing and Manipulating Floating Points JinSoo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu The Problem How to represent fractional values with
More information15213 Recitation 2: Floating Point
15213 Recitation 2: Floating Point 1 Introduction This handout will introduce and test your knowledge of the floating point representation of real numbers, as defined by the IEEE standard. This information
More informationSystem Programming CISC 360. Floating Point September 16, 2008
System Programming CISC 360 Floating Point September 16, 2008 Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Powerpoint Lecture Notes for Computer Systems:
More informationFloating Point Numbers
Floating Point Floating Point Numbers Mathematical background: tional binary numbers Representation on computers: IEEE floating point standard Rounding, addition, multiplication Kai Shen 1 2 Fractional
More informationCS429: Computer Organization and Architecture
CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: September 18, 2017 at 12:48 CS429 Slideset 4: 1 Topics of this Slideset
More informationModule 2: Computer Arithmetic
Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N
More informationFloating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers.
class04.ppt 15213 The course that gives CMU its Zip! Topics Floating Point Jan 22, 2004 IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Floating Point Puzzles For
More informationNumber Systems and Computer Arithmetic
Number Systems and Computer Arithmetic Counting to four billion two fingers at a time What do all those bits mean now? bits (011011011100010...01) instruction Rformat Iformat... integer data number text
More informationGiving credit where credit is due
CSCE 230J Computer Organization Floating Point Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due Most of slides for this lecture are based
More informationInf2C  Computer Systems Lecture 2 Data Representation
Inf2C  Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack
More informationComputer Arithmetic Ch 8
Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic FloatingPoint Representation FloatingPoint Arithmetic 1 Arithmetic Logical Unit (ALU) (2) Does all work in CPU (aritmeettislooginen
More informationIT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1
IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose
More informationFloating Point Representation. CS Summer 2008 Jonathan Kaldor
Floating Point Representation CS3220  Summer 2008 Jonathan Kaldor Floating Point Numbers Infinite supply of real numbers Requires infinite space to represent certain numbers We need to be able to represent
More informationFloating Point Representation in Computers
Floating Point Representation in Computers Floating Point Numbers  What are they? Floating Point Representation Floating Point Operations Where Things can go wrong What are Floating Point Numbers? Any
More informationCS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.
CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. 1 Part 1: Data Representation Our goal: revisit and reestablish fundamental of mathematics for the computer architecture course Overview: what are bits
More information1.2 Roundoff Errors and Computer Arithmetic
1.2 Roundoff Errors and Computer Arithmetic 1 In a computer model, a memory storage unit word is used to store a number. A word has only a finite number of bits. These facts imply: 1. Only a small set
More informationCS101 Introduction to computing Floating Point Numbers
CS101 Introduction to computing Floating Point Numbers A. Sahu and S. V.Rao Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1 Outline Need to floating point number Number representation
More informationCourse Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation
Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11 Sep 14 Introduction W2 Sep 18 Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25 Sep
More informationFP_IEEE_DENORM_GET_ Procedure
FP_IEEE_DENORM_GET_ Procedure FP_IEEE_DENORM_GET_ Procedure The FP_IEEE_DENORM_GET_ procedure reads the IEEE floatingpoint denormalization mode. fp_ieee_denorm FP_IEEE_DENORM_GET_ (void); DeNorm The denormalization
More informationGPU Floating Point Features
CSE 591: GPU Programming Floating Point Considerations Klaus Mueller Computer Science Department Stony Brook University Objective To understand the fundamentals of floatingpoint representation To know
More informationFloatingPoint Arithmetic
FloatingPoint Arithmetic if ((A + A)  A == A) { SelfDestruct() } Reading: Study Chapter 3. L12 Multiplication 1 Approximating Real Numbers on Computers Thus far, we ve entirely ignored one of the most
More informationIEEE754 floatingpoint
IEEE754 floatingpoint Real and floatingpoint numbers Real numbers R form a continuum  Rational numbers are a subset of the reals  Some numbers are irrational, e.g. π Floatingpoint numbers are an
More informationecture 25 Floating Point Friedland and Weaver Computer Science 61C Spring 2017 March 17th, 2017
ecture 25 Computer Science 61C Spring 2017 March 17th, 2017 Floating Point 1 NewSchool Machine Structures (It s a bit more complicated!) Software Hardware Parallel Requests Assigned to computer e.g.,
More informationCO Computer Architecture and Programming Languages CAPL. Lecture 13 & 14
CO20320241 Computer Architecture and Programming Languages CAPL Lecture 13 & 14 Dr. Kinga Lipskoch Fall 2017 Frame Pointer (1) The stack is also used to store variables that are local to function, but
More informationNumber Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example
Appendix F Number Systems Binary Numbers Decimal notation represents numbers as powers of 10, for example 1729 1 103 7 102 2 101 9 100 decimal = + + + There is no particular reason for the choice of 10,
More informationFloatingpoint representation
Lecture 34: Floatingpoint representation and arithmetic Floatingpoint representation The notion of real numbers in mathematics is convenient for hand computations and formula manipulations. However,
More informationLogiCORE IP FloatingPoint Operator v6.2
LogiCORE IP FloatingPoint Operator v6.2 Product Guide Table of Contents SECTION I: SUMMARY IP Facts Chapter 1: Overview Unsupported Features..............................................................
More informationThe Perils of Floating Point
The Perils of Floating Point by Bruce M. Bush Copyright (c) 1996 Lahey Computer Systems, Inc. Permission to copy is granted with acknowledgement of the source. Many great engineering and scientific advances
More informationTable : IEEE Single Format ± a a 2 a 3 :::a 8 b b 2 b 3 :::b 23 If exponent bitstring a :::a 8 is Then numerical value represented is ( ) 2 = (
Floating Point Numbers in Java by Michael L. Overton Virtually all modern computers follow the IEEE 2 floating point standard in their representation of floating point numbers. The Java programming language
More informationSigned umbers. Sign/Magnitude otation
Signed umbers So far we have discussed unsigned number representations. In particular, we have looked at the binary number system and shorthand methods in representing binary codes. With m binary digits,
More informationmith College Computer Science Fixed & Floating Point Formats CSC231 Fall 2017 Week #15 Dominique Thiébaut
mith College Computer Science Fixed & Floating Point CSC231 Fall 2017 Week #15 Formats Dominique Thiébaut dthiebaut@smith.edu Trick Question for ( double d = 0; d!= 0.3; d += 0.1 ) System.out.println(
More informationFloating Point Arithmetic
Floating Point Arithmetic Floating point numbers are frequently used in many applications. Implementation of arithmetic units such as adder, multiplier, etc for Floating point numbers are more complex
More informationDouble Precision FloatingPoint Arithmetic on FPGAs
MITSUBISHI ELECTRIC ITE VILab Title: Double Precision FloatingPoint Arithmetic on FPGAs Internal Reference: Publication Date: VIL04D098 Author: S. Paschalakis, P. Lee Rev. A Dec. 2003 Reference: Paschalakis,
More information2 Computation with FloatingPoint Numbers
2 Computation with FloatingPoint Numbers 2.1 FloatingPoint Representation The notion of real numbers in mathematics is convenient for hand computations and formula manipulations. However, real numbers
More informationChapter 4: Data Representations
Chapter 4: Data Representations Integer Representations o unsigned o signmagnitude o one's complement o two's complement o bias o comparison o sign extension o overflow Character Representations Floating
More information10.1. Unit 10. Signed Representation Systems Binary Arithmetic
0. Unit 0 Signed Representation Systems Binary Arithmetic 0.2 BINARY REPRESENTATION SYSTEMS REVIEW 0.3 Interpreting Binary Strings Given a string of s and 0 s, you need to know the representation system
More informationLecture 5. Computer Arithmetic. Ch 9 [Stal10] Integer arithmetic Floatingpoint arithmetic
Lecture 5 Computer Arithmetic Ch 9 [Stal10] Integer arithmetic Floatingpoint arithmetic ALU ALU = Arithmetic Logic Unit (aritmeettislooginen yksikkö) Actually performs operations on data Integer and
More informationIEEE Floating Point Numbers Overview
COMP 40: Machine Structure and Assembly Language Programming (Fall 2015) IEEE Floating Point Numbers Overview Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah
More informationComputer Architecture and Organization
31 Chapter 3  Arithmetic Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 3 Arithmetic 32 Chapter 3  Arithmetic Chapter Contents 3.1 Fixed Point Addition and Subtraction
More informationCharacters, Strings, and Floats
Characters, Strings, and Floats CS 350: Computer Organization & Assembler Language Programming 9/6: pp.8,9; 9/28: Activity Q.6 A. Why? We need to represent textual characters in addition to numbers. Floatingpoint
More informationFPSim: A Floating Point Arithmetic Demonstration Applet
FPSim: A Floating Point Arithmetic Demonstration Applet Jeffrey Ward Departmen t of Computer Science St. Cloud State University waje9901@stclouds ta te.edu Abstract An understan ding of IEEE 754 standar
More informationAdvanced issues in pipelining
Advanced issues in pipelining 1 Outline Handling exceptions Supporting multicycle operations Pipeline evolution Examples of real pipelines 2 Handling exceptions 3 Exceptions In pipelined execution, one
More informationIEEE Standard 754 Floating Point Numbers
IEEE Standard 754 Floating Point Numbers Steve Hollasch / Last update 2005Feb24 IEEE Standard 754 floating point is the most common representation today for real numbers on computers, including Intelbased
More informationClasses of Real Numbers 1/2. The Real Line
Classes of Real Numbers All real numbers can be represented by a line: 1/2 π 1 0 1 2 3 4 real numbers The Real Line { integers rational numbers nonintegral fractions irrational numbers Rational numbers
More informationComputer Organization CS 206 T Lec# 2: Instruction Sets
Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode
More informationFloating Point Considerations
Chapter 6 Floating Point Considerations In the early days of computing, floating point arithmetic capability was found only in mainframes and supercomputers. Although many microprocessors designed in the
More informationFloating Point. What can be represented in N bits? 0 to 2N1. 9,349,398,989,787,762,244,859,087, x 1067
MIPS Floating Point Operations Cptr280 Dr Curtis Nelson Floating Point What can be represented in N bits? Unsigned 2 s Complement 0 to 2N12N1 to 2N11 But, what about Very large numbers? 9,349,398,989,787,762,244,859,087,678
More informationUNIT IV: DATA PATH DESIGN
UNIT IV: DATA PATH DESIGN Agenda Introduc/on Fixed Point Arithme/c Addi/on Subtrac/on Mul/plica/on & Serial mul/plier Division & Serial Divider Two s Complement (Addi/on, Subtrac/on) Booth s algorithm
More information8/30/2016. In Binary, We Have A Binary Point. ECE 120: Introduction to Computing. FixedPoint Representations Support Fractions
University of Illinois at UrbanaChampaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Fixed and FloatingPoint Representations In Binary, We Have A Binary Point Let
More informationChapter 10  Computer Arithmetic
Chapter 10  Computer Arithmetic Luis Tarrataca luis.tarrataca@gmail.com CEFETRJ L. Tarrataca Chapter 10  Computer Arithmetic 1 / 126 1 Motivation 2 Arithmetic and Logic Unit 3 Integer representation
More informationScientific Computing. Error Analysis
ECE257 Numerical Methods and Scientific Computing Error Analysis Today s s class: Introduction to error analysis Approximations RoundOff Errors Introduction Error is the difference between the exact solution
More informationComputer Systems C S Cynthia Lee
Computer Systems C S 1 0 7 Cynthia Lee 2 Today s Topics LECTURE: Floating point! Real Numbers and Approximation MATH TIME! Some preliminary observations on approximation We know that some noninteger numbers
More informationEC2303COMPUTER ARCHITECTURE AND ORGANIZATION
EC2303COMPUTER ARCHITECTURE AND ORGANIZATION QUESTION BANK UNITII 1. What are the disadvantages in using a ripple carry adder? (NOV/DEC 2006) The main disadvantage using ripple carry adder is time delay.
More informationArchitecture and Design of Generic IEEE754 Based Floating Point Adder, Subtractor and Multiplier
Architecture and Design of Generic IEEE754 Based Floating Point Adder, Subtractor and Multiplier Sahdev D. Kanjariya VLSI & Embedded Systems Design Gujarat Technological University PG School Ahmedabad,
More informationObjects and Types. COMS W1007 Introduction to Computer Science. Christopher Conway 29 May 2003
Objects and Types COMS W1007 Introduction to Computer Science Christopher Conway 29 May 2003 Java Programs A Java program contains at least one class definition. public class Hello { public static void
More information1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM
1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number
More informationLecture 4  Number Representations, DSK Hardware, Assembly Programming
Lecture 4  Number Representations, DSK Hardware, Assembly Programming James Barnes (James.Barnes@colostate.edu) Spring 2014 Colorado State University Dept of Electrical and Computer Engineering ECE423
More informationBinary Addition & Subtraction. Unsigned and Sign & Magnitude numbers
Binary Addition & Subtraction Unsigned and Sign & Magnitude numbers Addition and subtraction of unsigned or sign & magnitude binary numbers by hand proceeds exactly as with decimal numbers. (In fact this
More informationVHDL IMPLEMENTATION OF IEEE 754 FLOATING POINT UNIT
VHDL IMPLEMENTATION OF IEEE 754 FLOATING POINT UNIT Ms. Anjana Sasidharan Student, Vivekanandha College of Engineering for Women, Namakkal, Tamilnadu, India. Abstract IEEE754 specifies interchange and
More informationUNIT  I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS
UNIT  I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS (09 periods) Computer Arithmetic: Data Representation, Fixed Point Representation, Floating Point Representation, Addition and
More informationFloatingPoint Arithmetic
FloatingPoint Arithmetic ECS30 Winter 207 January 27, 207 Floating point numbers Floatingpoint representation of numbers (scientific notation) has four components, for example, 3.46 0 sign significand
More informationLogic, Words, and Integers
Computer Science 52 Logic, Words, and Integers 1 Words and Data The basic unit of information in a computer is the bit; it is simply a quantity that takes one of two values, 0 or 1. A sequence of k bits
More informationFloating Point. EE 109 Unit 20. Floating Point Representation. Fixed Point
2.1 Floating Point 2.2 EE 19 Unit 2 IEEE 754 Floating Point Representation Floating Point Arithmetic Used to represent very numbers (fractions) and very numbers Avogadro s Number: +6.247 * 1 23 Planck
More informationFloatingpoint numbers. Phys 420/580 Lecture 6
Floatingpoint numbers Phys 420/580 Lecture 6 Random walk CA Activate a single cell at site i = 0 For all subsequent times steps, let the active site wander to i := i ± 1 with equal probability Random
More informationHomework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit
Announcements Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit Quiz 2 Monday on Number System Conversions
More information4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning
4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.
More informationInstruction Set Architecture of. MIPS Processor. MIPS Processor. MIPS Registers (continued) MIPS Registers
CSE 675.02: Introduction to Computer Architecture MIPS Processor Memory Instruction Set Architecture of MIPS Processor CPU Arithmetic Logic unit Registers $0 $31 Multiply divide Coprocessor 1 (FPU) Registers
More informationMost nonzero floatingpoint numbers are normalized. This means they can be expressed as. x = ±(1 + f) 2 e. 0 f < 1
FloatingPoint Arithmetic Numerical Analysis uses floatingpoint arithmetic, but it is just one tool in numerical computation. There is an impression that floating point arithmetic is unpredictable and
More information