Floating Point Binary A2 Computing OCR Module 2509.

Slides:



Advertisements
Similar presentations
COMP2130 Winter 2015 Storing signed numbers in memory.
Advertisements

©Brooks/Cole, 2003 Chapter 3 Number Representation.
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer?
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
Floating Point Numbers
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
Lecture 3 Number Representation 2 This week – Recap Addition – Addition circuitry – Subtraction of integers in binary – Representing numbers with fractional.
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.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Signed Numbers.
Floating Point Numbers
Floating Point Numbers
Complements: different approaches for representing negative numbers
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
CS1104-2aNumber Systems Supplementary Notes 1 Lecture 2: Number Systems Supplementary Notes  Complements Complements  Floating-point Numbers Floating-point.
The Binary Number System
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
1 Week 3: Data Representation: Negative Numbers READING: Chapter 3.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
Review CAS CS210 Ying Ye Boston University. Logical expressions Truth table input: A, B, Coutput: D ABCD (~A)(~B)(~C)
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Dale & Lewis Chapter 3 Data Representation. Data and computers Everything inside a computer is stored as patterns of 0s and 1s Numbers, text, audio, video,
COMPSCI 210 Semester Tutorial 1
CSE 111 Representing Numeric Data in a Computer Slides adapted from Dr. Kris Schindler.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
The Teacher CP4 Binary and all that… CP4 Revision.
Fractions in Binary.
Department of Management School of Business, Economics and Informatics Binary Numbers 2 Eva Szatmari
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Floating Point in Binary 1.Place Value Chart:
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Floating Point Numbers
CS 160 Lecture 4 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
Two’s and one’s complement arithmetic CLOCK ARITHMETIC.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
CS2100 Number Systems Supplementary Notes 1 NUMBER SYSTEMS SUPPLEMENTARY NOTES  Complements  Floating-point Numbers.
R EPRESENTATION OF REAL NUMBER Presented by: Pawan yadav Puneet vinayak.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Computer Organization 1 Data Representation Negative Integers.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Learning Objectives 3.3.1f - Describe the nature and uses of floating point form 3.3.1h - Convert a real number to floating point form Learn how to normalise.
Software Design and Development Storing Data Computing Science.
Starter Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard Using two’s.
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
OCR Computing OGAT Data Types. What OCR need you to know… Data Types a) Primitive data types, integer, real/floating point, character,
FLOATING-POINT NUMBER REPRESENTATION
Floating Point Numbers
Data Representation Covering… Binary addition / subtraction
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.
Introduction To Computer Science
Numbers in a Computer Unsigned integers Signed magnitude
CSCI206 - Computer Organization & Programming
How are negative and rational numbers represented on the computer?
Computer Organization
Storing Integers and Fractions
Representation of real numbers
Normalised Floating Point Numbers
39 32 Exponent Sign 31 Mantissa 30 Operations are perfomred with an implied binary point between bits 31 and 30. When the implied most significant.
Presentation transcript:

Floating Point Binary A2 Computing OCR Module 2509

Negative Binary Numbers 410 = 00000100 310 = 00000011 210 = 00000010 110 = 00000001 010 = 00000000 -110 = ? Imagine a milometer… 9 9 9 9 9 9 9 9 1 4 3 2

Negative Binary Numbers 410 = 00000100 310 = 00000011 210 = 00000010 110 = 00000001 010 = 00000000 -110 = 11111111 -210 = 11111110 -310 = 11111101 -410 = 11111100 Imagine a milometer… 9 9 9 9 9 9 9 6 8 7 9 Two’s complement

Negative Binary Numbers: The Easy Method Starting from the right, leave the digits alone up to the first 1 Change all the other digits from 1 to 0 or 0 to 1 8810 = 1 1 1 1 Flip Leave sign (0 ≡ positive; 1 ≡ negative) - 8810 = 1 1 Two’s complement

Floating Point Binary 110100000 000011 0.1101 x 23 ≡ 110.1 ≡ 6.510 Imagine a 2 byte, 16 bit, number… 110100000 000011 mantissa exponent sign The sign tells us it is a positive number (0 ≡ positive, 1 ≡ negative) The mantissa and exponent tell us that that the number is 0.1101 x 23 0.1101 x 23 ≡ 110.1 ≡ 6.510

Floating Point Binary: Negative Exponent If the leading bit of the exponent is 1, the exponent is negative… 110100000 111110 mantissa exponent sign N.B. If the exponent is negative, it will be written in two’s complement Therefore, first convert the exponent from two complement to base 10: 111110 = -000010 = -2 Number is therefore 0.1101 x 2-2 0.1101 x 2-2 ≡ 0.001101 ≡ 1/8+1/16+1/64 ≡ 0.203125

Normalisation of Floating Point Binary Numbers In base 10: 234,567,000 ≈ 0.002346 x 1011 234,567,000 = 0.234567 x 109 This has lost some accuracy and precision This number is normalised: it uses the mantissa to give the most accurate representation of the number by making sure the first digit after the decimal place is significant (i.e. not a zero)

Normalisation of Floating Point Binary Numbers Normalise the floating point binary number 0 000110101 000010 What do we know? It is a positive number It has a positive exponent The number, as it stands, is 0.000110101 x 22 = 0.0110101 Normalised: = 0.110101 x 2-1 We need the binary equivalent of -1 to represent the exponent N.B. The exponent is negative so will need to be two’s complement Two’s complement of -1 is 111111 So, the normalised version of 0 000110101 000010 is: 0.110101000 111111 The sign bit is a 0 The leftmost bit of the exponent is also 0