Datorsystem 1 och Datorarkitektur 1 – föreläsning 8 fredag 9 november 2007.

Slides:



Advertisements
Similar presentations
The MIPS 32 1)Project 1 Discussion? 1)HW 2 Discussion? 2)We want to get some feel for programming in an assembly language - MIPS 32 We want to fully understand.
Advertisements

CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
Chapter Three.
Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
Chapter 3 Arithmetic for Computers. Exam 1 CSCE
CSCE 212 Chapter 3: Arithmetic for Computers Instructor: Jason D. Bakos.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Chapter 2 Representing and Manipulating Information Prof. Qi Tian CS 3843 Fall
Datorteknik FloatingPoint bild 1 Floating point Number system corresponding to the decimal notation 1,837 * 10 significand exponent a great number of corresponding.
Floating Point Numbers
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
L11 – Floating Point 1 Comp 411 – Fall /21/2009 Floating-Point Arithmetic Reading: Study Chapter 3.5 Skim if ((A + A) - A == A) { SelfDestruct()
Major Numeric Data Types Unsigned Integers Signed Integer Alphanumeric Data – ASCII & UNICODE Floating Point Numbers.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Floating Point Numbers
ECEN 248 Integer Multiplication, Number Format Adopted from Copyright 2002 David H. Albonesi and the University of Rochester.
CPS Computer Architecture Assignment 4: Multiplication, Division, Floating Point.
February 26, 2003MIPS floating-point arithmetic1 Question  Which of the following are represented by the hexadecimal number 0x ? —the integer.
Simple Data Type Representation and conversion of numbers
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?)
Data Representation – Binary Numbers
Computer Organization and Design Floating-Point Arithmetic
Computer Architecture Lecture 3: Logical circuits, computer arithmetics Piotr Bilski.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 22, 2004 Lecture Number: 24.
Computing Systems Basic arithmetic for computers.
ECE232: Hardware Organization and Design
S. Rawat I.I.T. Kanpur. Floating-point representation IEEE numbers are stored using a kind of scientific notation. ± mantissa * 2 exponent We can represent.
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?)
Integer Conversion Between Decimal and Binary Bases Conversion of decimal to binary more complicated Task accomplished by –Repeated division of decimal.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Floating-Point Representation We can store integers and characters easily in binary, but what about fractions? ¼ =.25 = 2.5 * *
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Chapter 3 Arithmetic for Computers. Chapter 3 — Arithmetic for Computers — 2 Arithmetic for Computers Operations on integers Addition and subtraction.
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
Integer Operations Computer Organization and Assembly Language: Module 5.
By Wannarat Computer System Design Lecture 3 Wannarat Suntiamorntut.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
Floating Point Representations
Fundamentals of Computer Science
Computer System Design Lecture 3
Morgan Kaufmann Publishers Arithmetic for Computers
Chapter 4 Operations on Bits.
CSCI206 - Computer Organization & Programming
Floating-Point Arithmetic
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
Floating-Point Arithmetic
CS/COE0447 Computer Organization & Assembly Language
Floating Point.
Luddy Harrison CS433G Spring 2007
Integers in 2’s compliment Floating point
CS201 - Lecture 5 Floating Point
Arithmetic Logical Unit
Introduction to Java, and DrJava part 1
How to represent real numbers
ECEG-3202 Computer Architecture and Organization
October 24 Programming problems? Read Section 6.1 for November 5
Digital System Design II 数字系统设计2
Introduction to Java, and DrJava
Introduction to Java, and DrJava part 1
Presentation transcript:

Datorsystem 1 och Datorarkitektur 1 – föreläsning 8 fredag 9 november 2007

0x heltal sträng “987” flyttal instruktion xor $24, $9, 0x3700 All interpretations are valid. You have to explicitly tell the machine which interpretation you want. Use an integer load (lw) to interpret them as an int Use a floating point load (l.s) to interpret them as a float Use a branch or a jump (bne or j) to interpret them as an instruction

Eight Conditions for Signed- Magnitude Addition/Subtraction Operation ADD Magnitudes SUBTRACT Magnitudes A > BA < BA = B (+A) + (+B)+ (A + B) (+A) + (-B)+ (A – B )- (B – A )+ (A – B ) (-A) + (+B)- (A – B )+ (B – A )+ (A – B ) (-A) + (-B)- ( A + B) (+A) - (+B)+ (A – B )- (B – A )+ (A – B ) (+A) - (-B)+ (A + B) (-A) - (+B)- ( A + B) (-A) - (-B)- (A – B )+ (B – A )+ (A – B )

Liten Demo

multiplicand multiplier partial product array double precision product n 2n n can be formed in parallel and added in parallel for faster multiplication

Multiplicand = 2 Multiplier = 5 partial product array Product = n bits 4 bits Add Multiplicand to product Don’t Add Multiplicand to product Add Multiplicand to product Don’t Add Multiplicand to product 2*5 = 10

Optimera.... multiplicand multiplier partial product array double precision product 2n can be formed in parallel and added in parallel for faster multiplication n n 1378 * 32 kompilator Aha! Multiplicera med 32 = << 5 (shift left 5)

MIPS (IEEE 754) 1823 signexponentfraction (-1) sign x (1+fraction) x 2 (exponent - 127) exempel = = ½ + ¼ = Normalisera  = x (2 -1 ) (-1) 1 x ( ) x 2 ( )  128

During the Gulf War in 1991, a U.S. Patriot missile failed to intercept an Iraqi Scud missile, and 28 Americans were killed. A later study determined that the problem was caused by the inaccuracy of the binary representation of incremented –The Patriot incremented a counter once every 0.10 seconds. –It multiplied the counter value by 0.10 to compute the actual time. However, the (24-bit) binary representation of 0.10 actually corresponds to , which is off by This doesn’t seem like much, but after 100 hours the time ends up being off by 0.34 seconds—enough time for a Scud to travel 500 meters! = 1/ / / =