Floating Point Numbers


 Brandon Carroll
 1 years ago
 Views:
Transcription
1 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 by ADB
2 Positional representation of fractional numbers In base Multiplier Number Position Decimal point CMPE Summer 8 Slides by ADB Positional representation of fractional numbers In base Multiplier Number Position Binary point CMPE Summer 8 Slides by ADB
3 Fractional numbers fixed point Fixedpoint representation How much information is necessary to store? How do you choose a format for the bits? Fixedpoint operations Addition Align binary points, and add straight down Multiplication??? CMPE Summer 8 Slides by ADB Decimal to binary conversion Convert A =. to base CMPE Summer 8 Slides by ADB
4 Fixedpoint number density CMPE Summer 8 Slides by ADB 7 Scientific notation In base Example:. 8 In base Example:. (= 8. ) The general form r = Sign significand base Exponent CMPE Summer 8 Slides by ADB 8
5 Singleprecision IEEE 7 floatingpoint numbers e x p o n e n t Sign significand Onebit sign Eightbit exponent bit significand That s the fractional part CMPE Summer 8 Slides by ADB 9 Singleprecision IEEE 7 floatingpoint numbers Normalized numbers: only one nonzero bit to the left of the binary point Adjust the exponent as needed r = ( ) S F E Implicit leading in the significand (the hidden bit ) r = ( ) S ( + F) E Bias notation to represent the exponent With the bias B = 7 r = ( ) S ( + F) EB CMPE Summer 8 Slides by ADB
6 How to convert a base number into IEEE 7 singleprecision floating point Convert the number to binary The big part And the fractional part Normalize Isolate the hidden one Remove the significand s hidden one Add bias to the exponent Represent the number CMPE Summer 8 Slides by ADB Example: Sign Convert to binary Normalize Remove hidden one Add bias to exponent The end significand CMPE Summer 8 Slides by ADB
7 Doubleprecision IEEE 7 floatingpoint numbers e x p o n e n t Sign significand significand, continued Onebit sign Elevenbit exponent bit significand That s the fractional part CMPE Summer 8 Slides by ADB Summary of IEEE 7 formats Precision Parameter Single Single Ext. Double Double Ext. Bits for F Bits for E 8 E max E min 8 Total bits 79 For every precision, there are reserved exponents, used for special quantities: E min (i.e., E=) is used for zero and denorms E max + (i.e., E= or E=7, with bias) is used for NaN and infinity CMPE Summer 8 Slides by ADB 7
8 Special quantities: Infinity This special quantity avoids halt on overflow Much safer than returning the largest possible number Representation: E = E max + E = in single precision with bias E = 7 in double precision with bias F = Sign (+ or ) Sign significand CMPE Summer 8 Slides by ADB Special quantities: Infinity Examples of operations that return ±Inf Operation / / Inf Sqrt (+Inf) / Inf Result CMPE Summer 8 Slides by ADB 8
9 Special quantities: NaN (Not a Number) This special quantity avoids halt on invalid operations Representation: E = E max + E = in single precision with bias E = 7 in double precision with bias F Sign significand CMPE Summer 8 Slides by ADB 7 Special quantities: NaN (Not a Number) Examples of operations that return NaN Operation Result +/ / /+ / / Inf log(+) log( ) CMPE Summer 8 Slides by ADB 8 9
10 Special quantities: Zero Representation: E = E min (i.e., E = ) F = Sign: + or Sign significand CMPE Summer 8 Slides by ADB 9 Special quantities: Zero Examples of operations that involve ± Operation + / Sqrt NaN produced by CMPE Summer 8 Slides by ADB
11 Floating point numbers range What is the largest number we can represent in IEEE 7 singleprecision floating point? What is the smallest number? Sign significand CMPE Summer 8 Slides by ADB Floating point numbers range What is the largest number we can represent in IEEE 7 doubleprecision floating point? What is the smallest number? CMPE Summer 8 Slides by ADB
12 Floating point numbers: density Fact : Floats are not reals E.g., / Fact : Floats are not decimals E.g.,. (base ) =. (base ) Fact : Not even all the integers in the range are represented E.g.,,, (base ) = (base ) CMPE Summer 8 Slides by ADB Floating point numbers: density Close to : high density Far from : low density CMPE Summer 8 Slides by ADB
13 Special quantities: Denormals These are numbers smaller than ^(E min ) Fill the gap between ^(E min ) and (gradual underflow) Representation: E = E min (i.e., E = ) F The number represented is.f  f  f  ^(E min ) Sign significand CMPE Summer 8 Slides by ADB Special quantities: Denormals From to ^(E min ) CMPE Summer 8 Slides by ADB
14 Summary of IEEE 7 numbers Single precision Exponent Significand Double precision Exponent Significand Object anything anything 7 7 CMPE Summer 8 Slides by ADB 7 Floating point operations: addition Addition: C = A + B Step : Align the significands Are the exponents different? Shift the smaller number to the right and adjust the exponent Step : Add the significands Don t forget the sign Step : Normalize the sum Check for overflow or underflow CMPE Summer 8 Slides by ADB 8
15 Floating point operations: addition A =. (base ) B =. (base ) Step : Align the significands Step : Add the significands Step : Normalize the sum CMPE Summer 8 Slides by ADB 9 Floating point operations: multiplication C = A B Step : Add the exponents Step : Multiply the significands Without the sign Step : Normalize the product Step : Set the sign of the product Both positive? Result is positive Both negative? Result is positive Different signs? Result is negative CMPE Summer 8 Slides by ADB
16 Floating point operations: multiplication A =. (base ) B =. (base ) Step : Add the exponents Step : Multiply the significands Step : Normalize the product Step : Set the sign of the product CMPE Summer 8 Slides by ADB Rounding What is rounding, and when do we need to round? Numbers that we can represent, and numbers that we can not represent: What is fair? CMPE Summer 8 Slides by ADB
17 Rounding modes IEEE 7 defines four rounding modes Towards +Inf Towards Inf Towards To nearest CMPE Summer 8 Slides by ADB Rounding modes We need some extra bits In IEEE7, the internal representation uses at least more bits in the significand Guard Round Sticky CMPE Summer 8 Slides by ADB 7
18 Rounding modes CMPE Summer 8 Slides by ADB Recommended exercises Ex. A: Represent the binary number A =. in IEEE 7 singleprecision and doubleprecision. Ex. B: Give the IEEE 7 singleprecision representation of the number (thirtyfour million and one). Give its rounded representation using all four rounding modes, and for each one, give the decimal value of the number actually represented. CMPE Summer 8 Slides by ADB 8
Floating 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Arithmetic
Floating Point Arithmetic 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 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 informationNumeric Encodings Prof. James L. Frankel Harvard University
Numeric Encodings Prof. James L. Frankel Harvard University Version of 10:19 PM 12Sep2017 Copyright 2017, 2016 James L. Frankel. All rights reserved. Representation of Positive & Negative Integral and
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 informationEE 109 Unit 19. IEEE 754 Floating Point Representation Floating Point Arithmetic
1 EE 109 Unit 19 IEEE 754 Floating Point Representation Floating Point Arithmetic 2 Floating Point Used to represent very small numbers (fractions) and very large numbers Avogadro s Number: +6.0247 * 10
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 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 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 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 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 informationNumber Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:
N Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as: a n a a a The value of this number is given by: = a n Ka a a a a a
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 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 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 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 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 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 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 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 informationArithmetic for Computers. Hwansoo Han
Arithmetic for Computers Hwansoo Han Arithmetic for Computers Operations on integers Addition and subtraction Multiplication and division Dealing with overflow Floatingpoint real numbers Representation
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 informationCS61c Midterm Review (fa06) Number representation and Floating points From your friendly reader
CS61c Midterm Review (fa06) Number representation and Floating points From your friendly reader Number representation (See: Lecture 2, Lab 1, HW#1) KNOW: Kibi (2 10 ), Mebi(2 20 ), Gibi(2 30 ), Tebi(2
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 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 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 informationComputer Arithmetic Ch 8
Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic FloatingPoint Representation FloatingPoint Arithmetic 1 Arithmetic Logical Unit (ALU) (2) (aritmeettislooginen yksikkö) Does all
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 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 informationComputer arithmetics: integers, binary floatingpoint, and decimal floatingpoint
n!= 0 && n == n z+1 == z Computer arithmetics: integers, binary floatingpoint, and decimal floatingpoint v+ww!= v x+1 < x Peter Sestoft 20100216 y!= y p == n && 1/p!= 1/n 1 Computer arithmetics Computer
More informationThe ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.
CS 320 Ch 10 Computer Arithmetic The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop. Signed integers are typically represented in signmagnitude
More informationFloating Point Arithmetic
Floating Point Arithmetic Clark N. Taylor Department of Electrical and Computer Engineering Brigham Young University clark.taylor@byu.edu 1 Introduction Numerical operations are something at which digital
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 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 informationUp next. Midterm. Today s lecture. To follow
Up next Midterm Next Friday in class Exams page on web site has info + practice problems Excited for you to rock the exams like you have been the assignments! Today s lecture Back to numbers, bits, data
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 informationChapter 2 Data Representations
Computer Engineering Chapter 2 Data Representations Hiroaki Kobayashi 4/21/2008 4/21/2008 1 Agenda in Chapter 2 Translation between binary numbers and decimal numbers Data Representations for Integers
More informationDescription Hex M E V smallest value > largest denormalized negative infinity number with hex representation 3BB0 
CSE2421 HOMEWORK #2 DUE DATE: MONDAY 11/5 11:59pm PROBLEM 2.84 Given a floatingpoint format with a kbit exponent and an nbit fraction, write formulas for the exponent E, significand M, the fraction
More informationData Representations & Arithmetic Operations
Data Representations & Arithmetic Operations Hiroaki Kobayashi 7/13/2011 7/13/2011 Computer Science 1 Agenda Translation between binary numbers and decimal numbers Data Representations for Integers Negative
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 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 informationNumber Systems. Both numbers are positive
Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of
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 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 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 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 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 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 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 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 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 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 informationDr. Chuck Cartledge. 3 June 2015
Miscellanea 8224 Revisited Break 1.5 1.6 Conclusion References Backup slides CSC205 Computer Organization Lecture #002 Section 1.5 Dr. Chuck Cartledge 3 June 2015 1/30 Table of contents I 5 1.6 1 Miscellanea
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 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 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 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 informationunused unused unused unused unused unused
BCD numbers. In some applications, such as in the financial industry, the errors that can creep in due to converting numbers back and forth between decimal and binary is unacceptable. For these applications
More informationComputer arithmetics: integers, binary floatingpoint, and decimal floatingpoint
z+1 == z Computer arithmetics: integers, binary floatingpoint, and decimal floatingpoint Peter Sestoft 20130218** x+1 < x p == n && 1/p!= 1/n 1 Computer arithmetics Computer numbers are cleverly designed,
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 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 informationData Representation and Introduction to Visualization
Data Representation and Introduction to Visualization Massimo Ricotti ricotti@astro.umd.edu University of Maryland Data Representation and Introduction to Visualization p.1/18 VISUALIZATION Visualization
More informationFLOATING POINT NUMBERS
FLOATING POINT NUMBERS Robert P. Webber, Longwood University We have seen how decimal fractions can be converted to binary. For instance, we can write 6.25 10 as 4 + 2 + ¼ = 2 2 + 2 1 + 22 = 1*2 2 + 1*2
More information18642: Floating Point Blues
18642: Floating Point Blues 10/23/2017 1 Floating Point Math AntiPatterns: Not accounting for roundoff errors Tests for floating point equality Not handling special values Float used if integer does
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 informationLecture Notes: FloatingPoint Numbers
Lecture Notes: FloatingPoint Numbers CS227Scientific Computing September 8, 2010 What this Lecture is About How computers represent numbers How this affects the accuracy of computation Positional Number
More informationNatural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further
Natural Numbers and Integers Big Ideas in Numerical Methods MEI Conference 2011 Natural numbers can be in the range [0, 2 32 1]. These are known in computing as unsigned int. Numbers in the range [ (2
More informationCS 101: Computer Programming and Utilization
CS 101: Computer Programming and Utilization JulNov 2017 Umesh Bellur (cs101@cse.iitb.ac.in) Lecture 3: Number Representa.ons Representing Numbers Digital Circuits can store and manipulate 0 s and 1 s.
More information±M R ±E, S M CHARACTERISTIC MANTISSA 1 k j
ENEE 350 c C. B. Silio, Jan., 2010 FLOATING POINT REPRESENTATIONS It is assumed that the student is familiar with the discussion in Appendix B of the text by A. Tanenbaum, Structured Computer Organization,
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 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 informationProgramming Using C Homework 4
Programming Using C Homewk 4 1. In Homewk 3 you computed the histogram of an array, in which each entry represents one value of the array. We can generalize the histogram so that each entry, called a bin,
More informationComputational Methods CMSC/AMSC/MAPL 460. Representing numbers in floating point and associated issues. Ramani Duraiswami, Dept. of Computer Science
Computational Methods CMSC/AMSC/MAPL 460 Representing numbers in floating point and associated issues Ramani Duraiswami, Dept. of Computer Science Class Outline Computations should be as accurate and as
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 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 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 informationChapter 2. Data Representation in Computer Systems
Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting
More informationA complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation
Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers
More informationCalculations with Sig Figs
Calculations with Sig Figs When you make calculations using data with a specific level of uncertainty, it is important that you also report your answer with the appropriate level of uncertainty (i.e.,
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 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 informationLecture 10. Floating point arithmetic GPUs in perspective
Lecture 10 Floating point arithmetic GPUs in perspective Announcements Interactive use on Forge Trestles accounts? A4 2012 Scott B. Baden /CSE 260/ Winter 2012 2 Today s lecture Floating point arithmetic
More informationFloatingPoint Numbers in Digital Computers
POLYTECHNIC UNIVERSITY Department of Computer and Information Science FloatingPoint Numbers in Digital Computers K. Ming Leung Abstract: We explain how floatingpoint numbers are represented and stored
More informationREMEMBER TO REGISTER FOR THE EXAM.
REMEMBER TO REGISTER FOR THE EXAM http://tenta.angstrom.uu.se/tenta/ Floating point representation How are numbers actually stored? Some performance consequences and tricks Encoding Byte Values Byte =
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 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 information