Chapter 8 Representing Information Digitally.

Slides:



Advertisements
Similar presentations
2009 Spring Errors & Source of Errors SpringBIL108E Errors in Computing Several causes for malfunction in computer systems. –Hardware fails –Critical.
Advertisements

CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
What is Rounding Error? AiS Challenge STI 2003 Richard Allen.
Chapter 2 Representing and Manipulating Information Prof. Qi Tian CS 3843 Fall
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: November 10, 2004 Lecture Number: 31.
Chapter 3 Data Representation.
Chapter 3 Data Representation. Chapter goals Describe numbering systems and their use in data representation Compare and contrast various data representation.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Representation and Conversion of Numeric Types 4 We have seen multiple data types that C provides for numbers: int and double 4 What differences are there.
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 12 Data.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Chapter 5 Data representation.
Scientific Computing Algorithm Convergence and Root Finding Methods.
February 26, 2003MIPS floating-point arithmetic1 Question  Which of the following are represented by the hexadecimal number 0x ? —the integer.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
2.2 Errors. Why Study Errors First? Nearly all our modeling is done on digital computers (aside: what would a non-digital analog computer look like?)
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Computing Higher - Unit 1… Computer Systems 1 Higher Computing Unit 1 – Topic 1 Data Representation.
Bits & Bytes: How Computers Represent Data
Computers Organization & Assembly Language
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
Computer Science 111 Fundamentals of Programming I Number Systems.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 22, 2004 Lecture Number: 24.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
Binary Arithmetic & Data representation
Data Representation.
COMPSCI 210 Semester Tutorial 1
Number Systems Spring Semester 2013Programming and Data Structure1.
Numeric Processing Chapter 6, Exploring the Digital Domain.
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.
5.2 Errrors. Why Study Errors First? Nearly all our modeling is done on digital computers (aside: what would a non-digital analog computer look like?)
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Round-off Errors and Computer Arithmetic. The arithmetic performed by a calculator or computer is different from the arithmetic in algebra and calculus.
1 Lecture 2  Complement  Floating Point Number  Character Encoding.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
Data Representation, Number Systems and Base Conversions
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Data Representation.
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,
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
1.4 Representation of data in computer systems Character.
Floating Point Numbers
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Programming and Data Structure
Binary Numbers and ASCII and EDCDIC
Number Representation
CSCI 198: Lecture 4: Data Representation
Chapter 3 Data Storage.
CSCI 161: Lecture 4: Data Representation
Floating Point.
COMS 161 Introduction to Computing
Storing Negative Integers
How Computers Store Data
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Computer Organization
Learning Intention I will learn how computers store text.
Computer Organization COMP 210
Presentation transcript:

Chapter 8 Representing Information Digitally

analog information is continuous, e.g., wave

computers process discrete or digital data

the process of converting information to a binary form is called digitization both discrete and analog forms of information may be digitized

Example: Digitizing Images The two step process for digitizing images: sampling the continuous tone image for pixels quantizing pixels image is sampled by pixel resolution pixels samples are averaged

Example: Digitizing Images The two step process for digitizing images: sampling the continuous tone image for pixels quantizing pixels pixels are converted to numeric form

binary numbering system is a base-2 positional numbering system binary digits are called “bits” bits are organized into groups, e.g., 8 = “byte”

Decimal 14 Converted to Binary Decimal 176 Converted to Binary

Real Numbers – Decimal Component Decimal – Negative Powers of 10  = 1/10  = 1/100  = 1/ = 7 X X = 7/10 +5/10 Binary = = ½ 2 -2 = ¼ 2 -3 = 1/8 1 X 1/2 + 1 X 1/4 = ¾ =.11 (binary) Binary =

Easier Way = x x Stop when we get to zero x x x

Floating Point Problem: .1 = ……..  Run out of memory for storage  Same problem with 1/3 = ……  Real numbers represented in Floating Point  Decimal number in floating point:  we normalize the decimal point  Same principal in binary

Real (Decimal) Number Storage Real numbers are stored in floating point representation – a sign – an exponent (indicate how many positions you moved the decimal point) – a mantissa (normalized decimal fraction) no digits to the left of the decimal first digit to the right of the decimal is nonzero Limited precision because most real numbers have an infinite decimal expansion (this holds no matter what number base is used in the representation) Real ValueFloating Point * * * *10 3

Real Number Storage Limited Range and Precision There are three categories of numbers left out when floating point representation is used – numbers out of range because their absolute value is too large – numbers out of range because their absolute value is too small (numbers too near zero to be stored given the precision available) – numbers whose binary representations require either an infinite number of binary digits or more binary digits than the bits available

Limited Range and Precision Some Consequences Limited range will invalidate certain calculations Limited precision for real numbers is very pervasive – Assume that most decimal calculations could, in fact, be in error! – Evaluate and use computer calculations with this in mind

Risks in Numerical Computing Almost all computer calculations involve roundoff error (limited precision error) If not monitored and planned for carefully, such errors can lead to unexpected and catastrophic results – Ariane 5 Rocket Failure Ariane 5 Rocket Failure – Patriot Missile Failure during Gulf War Patriot Missile Failure during Gulf War

The Explosion of the Ariane 5 On June 4, 1996 an unmanned Ariane 5 rocket launched by the European Space Agency exploded just forty seconds after its lift-off. The rocket was on its first voyage, after a decade of development costing $7 billion. The destroyed rocket and its cargo were valued at $500 million. It turned out that the cause of the failure was a software error in the inertial reference system. Specifically a 64 bit floating point number relating to the horizontal velocity of the rocket with respect to the platform was converted to a 16 bit signed integer. The number was larger than 32,767, the largest integer storeable in a 16 bit signed integer, and thus the conversion failed. Back

Patriot Missile Failure during Gulf War During the Gulf War, an American Patriot Missile battery in Saudi Arabia, failed to track and intercept an incoming Iraqi Scud missile. The Scud struck an American Army barracks, killing 28 soldiers and injuring around 100 other people. The General Accounting office reported on the cause of the failure. It turns out that the cause was an inaccurate calculation due to computer arithmetic errors. The time in tenths of second as measured by the system's internal clock was multiplied by 1/10 to produce the time in seconds. The value 1/10, which has a non-terminating binary expansion, was chopped at 24 bits. The small chopping error, when multiplied by the large number giving the time in tenths of a second, led to a significant error. Indeed, the Patriot battery had been up around 100 hours, and an easy calculation shows that the resulting time error due to the magnified chopping error was about 0.34 seconds. (The number 1/10 equals 1/2 4 +1/2 5 +1/2 8 +1/2 9 +1/ / A Scud travels at about 1,676 meters per second, and so travels more than half a kilometer in this time. This was far enough that the incoming Scud was outside the "range gate" that the Patriot tracked. Back

Digital Representation - Text Text (letters punctuation, invisible formatting characters) HTML (already discussed need for visual deign)

Text - One Byte per Character Suffices

ASCII and the English Character Set ASCII = American Standard Code for Information Interchange. Allows for 256 unique characters All uppercase and lowercase letters Punctuation symbols like !., ? : ; “ ‘ etc. Digits 0, …, 9 Arithmetic symbols + = - / Assorted special symbols like $ % ^ & * ( ) { } [ ] etc. Invisible formatting characters

Unicode ASCII not enough characters for international use Unicode – represent every character in every language including Asian ideograms Uses 16 bits per character Can represent 2 16 or more than 65,000 characters compared to 256 for ASCII Gaining in popularity

Using ASCII