Representation of real numbers

Slides:



Advertisements
Similar presentations
Floating Point Numbers
Advertisements

Booth’s Algorithm.
Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
Floating Point Numbers
Representing Real Numbers Using Floating Point Notation Lecture 6 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Binary Number Systems.
The Binary Number System
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Factional Values What is 0.75 in binary?. How could we represent fractions? In decimal: – As fractions : 1/5.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Binary Fractions. Fractions A radix separates the integer part from the fraction part of a number Columns to the right of the radix have negative.
Unit 2 Mid Unit Test Review
Algebra Standard 1.0 Recognize and Use Scientific Notation.
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
Fractions in Binary.
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
Floating Point in Binary 1.Place Value Chart:
Floating Point Binary A2 Computing OCR Module 2509.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
R EPRESENTATION OF REAL NUMBER Presented by: Pawan yadav Puneet vinayak.
Software Design and Development Storing Data Computing Science.
Chapter 9 Computer Arithmetic
Floating Point Numbers
Introduction to Numerical Analysis I
Nat 4/5 Computing Science Lesson 1: Binary
Floating Point Representations
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Presented by Leo Pleše ScienceUp.org
Objectives Today: P4 Data Types – Floating Points P4 Variable Quiz P3 Iteration and Selection Practical Are you logged on? Then come around the table Unit.
Binary Fractions.
Dr.Faisal Alzyoud 2/20/2018 Binary Arithmetic.
Computer Science 210 Computer Organization
Convert scientific notation to standard notation
A brief comparison of integer and double representation
Introduction To Computer Science
Computer Architecture & Operations I
Recap Add these numbers together in binary
Floating Point Math & Representation
Scientific Notation Mrs. Rauch 11/6/15.
Scientific Notation.
William Stallings Computer Organization and Architecture 7th Edition
Scientific Notation.
Luddy Harrison CS433G Spring 2007
Scientific Notation.
CSCI206 - Computer Organization & Programming
Floating Point Representation
Scientific Notation.
Scientific Notation.
Recognize and use scientific notation.
Recognize and use scientific notation.
Storing Negative Integers
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Scientific Notation.
Starter Using the fingers on only one hand, what is the highest number you can count to? Rules: You must start at 1 You must count sequentially (i.e.
Chapter 8 Computer Arithmetic
Recognize and use scientific notation.
Normalised Floating Point Numbers
A short-hand way of writing large numbers without
COMS 161 Introduction to Computing
Recognize and use scientific notation.
Scientific Notation Mrs. Rauch 11/6/15.
SCIENTIFIC NOTATION ... a way to express very small or very large numbers that is often used in "scientific" calculations where the analysis must be very.
Chapter3 Fixed Point Representation
Numbers with fractions Could be done in pure binary
1.6) Storing Integer: 1.7) storing fraction:
Presentation transcript:

Representation of real numbers

What are Real Numbers? π Real Numbers include: Whole Numbers (like 1,2,3,4, etc) Rational Numbers (like 3/4, 0.125, 0.333..., 1.1, etc ) Irrational Numbers (like π, √3, etc ) Real Numbers can also be positive, negative or zero In Computing, real numbers are also known as floating point numbers 14.75 3148 22.9 99/100 15 π 100.159 2/7 -27 0.000123 4/5 √3 340.1155

Standard Form Standard form is a scientific notation of representing numbers as a base number and an exponent. Using this notation: The decimal number 8674.26 can be represented as 8.67426 x 103, with mantissa = 8.67426, base = 10 and exponent = 3 The decimal number 753.34 can be represented as 7.5334 x 102, with mantissa = 7.5334, base = 10 and exponent = 2 The decimal number 0.000634 can be represented as 6.34 x 10-3, with mantissa = 6.34, base = 10 and exponent = -3 Any number can be represented in any number base in the form m x be

Floating Point Notation In floating point notation, the real number is stored as 2 separate bits of data A storage location called the mantissa holds the complete number without the point. A storage location called the exponent holds the number of places that the point must be moved in the original number to place it at the left hand side.

Floating Point Notation What is the exponent of 10110.110? The exponent is 5, because the decimal point has to be moved 5 places to get it to the left hand side. The exponent would be represented as 0101 in binary

Floating Point Notation How would 10110.110 be stored using 8 bits for the mantissa and 4 bits for the exponent? We have already calculated that the exponent is 5 or 0101. 10110.110 = 10110110 x 25 = 10110110 x 20101 It is not necessary to store the ‘x’ sign or the base because it is always 2. Mantissa Exponent

Floating Point Notation How would 24.5 be stored using 8 bits for the mantissa and 4 bits for the exponent? In binary, the numbers after the decimal point have the following place values: 1/2 1/4 1/8 1/16 1/32 1/64 1/128 24 has the binary value 11000 0.5 (or 1/2) has the binary value .1 24.5 = 0011000.1

Floating Point Notation How would 0011000.1 be stored using 8 bits for the mantissa and 4 bits for the exponent?

Floating Point Notation How would 0011000.1 be stored using 8 bits for the mantissa and 4 bits for the exponent? The exponent is 7 because decimal point has to move 7 places to the left 0011000.1 = 00110001 x 27 = 00110001 x 20111 Mantissa Exponent

Accuracy Store 110.0011001 in floating point representation, using 8 bits for the mantissa and 4 bits for the exponent. Mantissa Exponent The mantissa only holds 8 bits and so cannot store the last two bits These two bits cannot be stored in the system, and so they are forgotten. The number stored in the system is 110.00110 which is less accurate that its initial value.

Accuracy If the size of the mantissa is increased then the accuracy of the number held is increased. Mantissa (10 bits) Exponent

Range If increasing the size of the mantissa increases the accuracy of the number held, what will be the effect of increasing the size of the exponent? Using two bits for the exponent, the exponent can have the value 0-3 Mantissa Exponent (2 bits) This means the number stored can be in the range .00000000 (0) to 111.11111 (7.96875)

Range Increasing the exponent to three bits, it can now store the values 0-7 Mantissa Exponent (3 bits) This means the number stored can be in the range .00000000 (0) to 1111111.1 (127.5) If the size of the exponent is increased then the range of the number s which can be stored is increased.