COMS 161 Introduction to Computing

Slides:



Advertisements
Similar presentations
Lecture - 2 Number systems and computer data formats
Advertisements

CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
Floating Point Numbers. CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64.
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.
Representing Real Numbers Using Floating Point Notation Lecture 6 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
Computer Science 210 Computer Organization Floating Point Representation.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Lecture 8 Floating point format
Binary Number Systems.
The Binary Number System
Simple Data Type Representation and conversion of numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 22, 2004 Lecture Number: 24.
Fundamental of Computer Architecture By Panyayot Chaikan November 01, 2003.
COMPSCI 210 Semester Tutorial 1
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
Data Representation - Part II. Characters A variable may not be a non-numerical type Character is the most common non- numerical type in a programming.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted.
9.4 FLOATING-POINT REPRESENTATION
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 20, 2004 Lecture Number: 23.
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.
1 Lecture 2  Complement  Floating Point Number  Character Encoding.
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: November 08, 2004 Lecture Number: 30.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Floating Point in Binary 1.Place Value Chart:
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
Lecture 6: Floating Point Number Representation Information Representation: Floating Point Number Representation Lecture # 7.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Chapter 9 Computer Arithmetic
CSCI206 - Computer Organization & Programming
Floating Point Numbers
Introduction to Numerical Analysis I
Nat 4/5 Computing Science Lesson 1: Binary
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Introduction To Computer Science
Computer Architecture & Operations I
Luddy Harrison CS433G Spring 2007
CSCI206 - Computer Organization & Programming
Number Representations
EEL 3705 / 3705L Digital Logic Design
ECEG-3202 Computer Architecture and Organization
COMS 161 Introduction to Computing
COMS 361 Computer Organization
October 17 Chapter 4 – Floating Point Read 5.1 through 5.3 1/16/2019
Number Representation
Numbers representations
Storing Integers and Fractions
Representation of real numbers
Numbers with fractions Could be done in pure binary
Number Representations
Lecture 9: Shift, Mult, Div Fixed & Floating Point
Presentation transcript:

COMS 161 Introduction to Computing Title: Numeric Processing Date: November 03, 2004 Lecture Number: 28

Announcements Research paper proposal 2 due November 8, 2004

Review Integers Big-endian Little-endian Overflow

Outline Real numbers Representation Limitations

Two’s complement 32 bit signed numbers: maxint minint 0000 0000 0000 0000 0000 0000 0000 00002 = 010 0000 0000 0000 0000 0000 0000 0000 00012 = + 110 0000 0000 0000 0000 0000 0000 0000 00102 = + 210 ... 0111 1111 1111 1111 1111 1111 1111 11102 = + 2,147,483,64610 0111 1111 1111 1111 1111 1111 1111 11112 = + 2,147,483,64710 1000 0000 0000 0000 0000 0000 0000 00002 = – 2,147,483,64810 1000 0000 0000 0000 0000 0000 0000 00012 = – 2,147,483,64710 1000 0000 0000 0000 0000 0000 0000 00102 = – 2,147,483,64610 ... 1111 1111 1111 1111 1111 1111 1111 11012 = – 310 1111 1111 1111 1111 1111 1111 1111 11102 = – 210 1111 1111 1111 1111 1111 1111 1111 11112 = – 110 maxint minint

Real Numbers Scientific Notation Normalized scientific notation Number times 10 to a power 123456.0 = 123.456 * 103 Normalized scientific notation Zero to the left of the decimal point 123456.0 = 0.123456 * 106 Advantageous to store real numbers in 32 bits (word size)

Real Numbers 0.1012 = 0 * 20 + 1 * 2-1 + 0 * 2-2 + 1 * 2-3 22 21 20 2 -1 2 -2 2 -3 2 -4 4 2 1 1/2 1/4 1/8 1/16 4 2 1 0.5 0.25 0.125 0.0625 0.1012 = 0 * 20 + 1 * 2-1 + 0 * 2-2 + 1 * 2-3 0.1012 = 0.5 + 0.125 = 0.62510

Real Numbers Decimal to binary conversion algorithm 24 23 22 21 20 16 8 4 2 1 1210 = 0 * 24 + 1 * 23 1210 – 810 = 410 2 1 1 410 = 1 * 22 410 – 410 = 010

Real Numbers 0.87510 = 0.?????2 20 = 1 2 -1 = 0.5 1 0.87510 = 1 * 2 -1 2 -2 = 0.25 0.87510 – 0.5 = 0.37510 2 -3 = 0.125 2 -4 = 0.0625 0.37510 = 1 * 2 -2 1 2 -5 = 0.03125 0.37510 – 0.25 = 0.12510 2 -6 = 0.015625 0.12510 = 1 * 2 -3 1 2 -7 = 0.0078125 0.12510 – 0.125 = 010 2 -8 = 0.00390625 0. 2

Real (Decimal) Number Storage Real numbers are stored in floating point representation IEEE Standard 754 Allows using data on different machines A sign An exponent A mantissa also called a significand (normalized decimal fraction) Single digit to the left of the decimal point