Characters, Strings, and Floats

Similar documents
Octal and Hexadecimal Integers

Floating Point Arithmetic

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Divide: Paper & Pencil

COMP2121: Microprocessors and Interfacing. Number Systems

COMP2611: Computer Organization. Data Representation

Foundations of Computer Systems

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

CS429: Computer Organization and Architecture

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Floating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers.

CS 101: Computer Programming and Utilization

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

Floating Point Arithmetic

CSCI 402: Computer Architectures. Arithmetic for Computers (3) Fengguang Song Department of Computer & Information Science IUPUI.

Chapter 3: Arithmetic for Computers

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

Chapter 2. Data Representation in Computer Systems

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

Floating Point January 24, 2008

Module 2: Computer Arithmetic

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Chapter 2 Float Point Arithmetic. Real Numbers in Decimal Notation. Real Numbers in Decimal Notation

Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !

Floating Point (with contributions from Dr. Bin Ren, William & Mary Computer Science)

Signed umbers. Sign/Magnitude otation

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Systems I. Floating Point. Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties

System Programming CISC 360. Floating Point September 16, 2008

Topic Notes: Bits and Bytes and Numbers

Floating Point Representation in Computers

15213 Recitation 2: Floating Point

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Numeric Encodings Prof. James L. Frankel Harvard University

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

Number Systems CHAPTER Positional Number Systems

Inf2C - Computer Systems Lecture 2 Data Representation

The type of all data used in a C++ program must be specified

Data Representation Floating Point

CHW 261: Logic Design

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

CO212 Lecture 10: Arithmetic & Logical Unit

EE 109 Unit 19. IEEE 754 Floating Point Representation Floating Point Arithmetic

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

ECE232: Hardware Organization and Design

EE 109 Unit 20. IEEE 754 Floating Point Representation Floating Point Arithmetic

Data Representation Floating Point

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Chapter 4. Operations on Data

3.5 Floating Point: Overview

Internal Data Representation

Chapter 2 Bits, Data Types, and Operations

Floating Point. EE 109 Unit 20. Floating Point Representation. Fixed Point

Number Systems and Computer Arithmetic

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

The type of all data used in a C (or C++) program must be specified

Chapter 2 Bits, Data Types, and Operations

Giving credit where credit is due

Number Systems & Encoding

Giving credit where credit is due

Floating-point representations

Floating-point representations

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Floating Point Numbers

Chapter Three. Arithmetic

Computer Systems C S Cynthia Lee

Topic Notes: Bits and Bytes and Numbers

Floating Point. CSE 351 Autumn Instructor: Justin Hsia

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

IEEE Standard for Floating-Point Arithmetic: 754

Data Representation 1

Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

Floating Point Numbers. Lecture 9 CAP

Scientific Computing. Error Analysis

CS101 Lecture 04: Binary Arithmetic

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Number Systems. Both numbers are positive

IEEE Floating Point Numbers Overview

Floating point. Today. IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.

What Every Programmer Should Know About Floating-Point Arithmetic

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

Chapter 2 Bits, Data Types, and Operations

Objectives. Connecting with Computer Science 2

Floating Point : Introduction to Computer Systems 4 th Lecture, May 25, Instructor: Brian Railing. Carnegie Mellon

Floating Point Numbers

Floating Point Numbers

Chapter 4: Data Representations

CHAPTER 5: Representing Numerical Data

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

UNIT 7A Data Representation: Numbers and Text. Digital Data

Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition. Carnegie Mellon

Number Representations

A. Incorrect! To simplify this expression you need to find the product of 7 and 4, not the sum.

Floating Point. CSE 351 Autumn Instructor: Justin Hsia

Representing and Manipulating Floating Points

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Transcription:

Characters, Strings, and Floats CS 350: Computer Organization & Assembler Language Programming 9/6: pp.8,9; 9/28: Activity Q.6 A. Why? We need to represent textual characters in addition to numbers. Floating-point numbers separate the magnitude of a number from its significance. B. Outcomes At the end of today, you should: Know how textual characters are represented. Know why we have floating-point numbers and how they are represented. C. Characters and Strings A character is represented by a bit string. ASCII is one scheme for characters; it uses 8 bits per character. The ASCII representations of The digits 0 9 are hex 30 39 (decimal 48 57). The letters A Z are hex 41 5A (decimal 65 90) The letters a z are hex 61 7A (decimal 97 122) The space character is hex 20 (decimal 32) ASCII C strings are null-terminated: They include an extra 8 bit of zeros. Example 1: "A9z" is represented as the 4-character sequence 'A', '9', 'z', '\0'. (The character '\0' represents 8 zero bits.) As a sequence of hex digits, this is 41 39 7A 00. As a sequence of natural numbers 0 and < 256, we have 65 57 122 0. Unicode is a newer scheme that extends ASCII to use 16 bits per character. Includes symbols from other languages and from math, logic, and other fields. Strings are sequences of characters (null-terminated or length-specified). D. Non-Whole Numbers In decimal, non-whole numbers are represented in various ways Example 2: 3.75 and 3 ¾ and 3 ⁷⁵/₁₀₀ all represent the same number When using a decimal point, positions to the right of the decimal point indicate increasingly negative powers of 10: 10-1, 10-2,. Example 3: 3.75 = 3 10⁰ + 7 10-1 + 5 10-2 Dividing by 10 n shifts the decimal point n digits to the left. Example 4: 0.75 = 75 / 100, so 3.75 = 3 ⁷⁵/₁₀₀ = 3 ¾ In binary, the positions to the right of the binary point indicate negative powers of 2. CS 350: Comp Org & Asm Lang Pgmg 1 James Sasaki, 2017

Example 5: 1.011₂ = 1 2⁰ + 0 2-1 + 1 2-2 + 1 2-3 = 1 + ¹/₄ + ¹/₈ = 1 ³/₈ = 1.375₁₀ Dividing by 2 n shifts the binary point n bits left; multiplying by 2 n shifts right. Example 6: 1.011₂ = (1011/1000)₂ = (¹¹/₈)₁₀ = 1³/₈ To convert a decimal.fraction to binary, you can treat the parts to the left and the right of the binary point separately. We already know how to deal with the part to the left. For the part to the right of the binary point, repeatedly subtract negative powers of 2. Example 7: 1.375 = 1 + 0.375 = 1 + 0 0.5 + 0.375 = 1 + 0 0.5 + 1.25 + 0.125 = 1 + 0 0.5 + 1.25 + 1 0.125 = 1.011₂ A rational number has the form numerator/denominator. It s the ratio of two integers. There are a couple of techniques for converting a decimal rational number to binary. Technique 1: Convert the rational to decimal.fraction form first. Example 8: 1³/₈ = 1.375 = = 1.011₂ Technique 2: If the denominator is a power of 2, say 2 n, then you can convert the numerator to binary and shift the binary point n bits left. Example 9: 1³/₈ = (8+3)/8 = ¹¹/₈ = (1011₂)/2³ = 1.011₂ E. Scientific Notation One standard way to represent real numbers is scientific notation, as in 6.02 10 23 or ±1.1001₂ 2-4. In normalized scientific notation, we keep one (non-zero) digit to the left of the radix point (so 6.02 10 23, not 60.2 10 22 or 0.602 10 24 ). The overall sign, of course, says whether the number is positive or negative (its direction from the origin). The exponent of a scientific notation number specifies its basic magnitude (its distance from the origin). Exponents > 1 are for values greater than the radix (or less than the negative of the radix). Exponents < 1 are for values between 0 and radix (or -radix and 0). The significand or mantissa of a scientific notation number is the digit dot fraction part. To specify a number precisely, we need some number of significant digits (the significand has a required length). Example 10: For 1.011₂ 2-48, we need 4 significant bits. For 1.0110₂ 2-48 or 1.0111₂ 2-48, we need 5 significant bits. F. Floating-Point Numbers In hardware, we use floating-point numbers to represent real numbers using scientific notation where the significand and exponent have fixed maximum sizes. So a floating point number might only be an approximation to an actual real number. CS 350: Comp Org & Asm Lang Pgmg 2 James Sasaki, 2017

Nowadays, people generally use an IEEE representation for floating-point numbers. IEEE = Institute of Electrical & Electronics Engineers. For the IEEE representation, we break up a floating-point number into a sign bit S, an exponent field E, and a fraction field F. If the sign S is 1, the number is negative; if it is 0, the number is non-negative. The IEEE representation differs from normalized scientific notation in two ways: The IEEE fraction part omits the leading 1 dot. It's understood to be there but it's not written. The IEEE exponent is written using a binary offset. Floating-point numbers come in various sizes. For a 32-bit IEEE floating-point number, the exponent is 8 bits long and the fraction is 23 bits long. To get the scientific notation significand, we prepend a 1 dot to the 23-bit IEEE fraction, so we have 24 significant bits of precision. If we read the IEEE exponent field E as an unsigned integer (where 1 E < 255), then the scientific notation exponent is E 127. So we can represent exponents -126 and 127. (The cases E = 0 and 255 are treated specially; see below.) So the 32-bit string S E F represents (-1) S 1.F 2 E 127 where 1.F means 1. prepended to F. Example 12: Let N be the 32 bits 1100 0101 1011 0100 0000 0000 0000 0000. The sign field S is 1, the exponent field E is 1000 1011 = 139₁₀, and the 23-bit fraction F is 011010 (18) where the notation 0 (18) means 18 zero bits. The scientific notation exponent is E 127 = 139 127 = 12. The scientific notation fraction is 1.F, which is 1.011010 (18). So N represents -1.01101 2 12 (or -1.011010 (18) 2 12 if you want to write the trailing zeros). Example 13: In the other direction, if we are asked for the IEEE representation of -1.01101 2 12, we use 1 for the negative sign, drop the 1. and use 011010 (18) for the fraction, and add 127 to the exponent 12 to get 139 which is 1000 1011₂. This gives 1 1000 1011 011010 (18) as the IEEE representation. The IEEE representation has some special cases. If E = 0 and F = 0 (23) we have +0 or -0 depending on the overall sign. If E = 0 and F 0 (23) we have N = (-1) S 0.F 2 126. These are unnormalized scientific notation numbers, since they begin with 0; they re used for numbers that are extremely close to zero. E = 255 is used for +,, and NaN (Not a Number). G. Representation Problems With Floating-Point Numbers Our representation of floating-point numbers may fail in three ways. Two of them are magnitude problems; the third involves the number of significant bits. Overflow: The exponent is too large (i.e, too positive). For 32-bit floating-point numbers, we can have E = 254 (so the actual exponent is 127). Writing 1 (23) to mean twenty-three 1 bits, the furthest we can get from zero is ±1.1 (23) 2 127. Underflow: The exponent is too small (i.e., too negative). CS 350: Comp Org & Asm Lang Pgmg 3 James Sasaki, 2017

For 32-bit floating-point numbers, we can have E = 1 (so the scientific notation exponent is 126), so ± 1.0 (23) 2 126 is as close to zero as we can get using the standard case for IEEE floating-point numbers. Unnormalized numbers (those that begin 0. ) do let us get closer to zero. To get these numbers, we use E = 0 (and a nonzero significand). We get a scientific notation exponent of -126, so the smallest number we can represent has the IEEE representation S 0000 0000 0 (22) 1. In scientific notation, we get ±0.0 (22) 1 2 126, which equals ± 2-149. Loss of Precision: Since we only have so many bits for the fraction, we can only write numerals with a limited number of significant bits. Since we are writing values in scientific notation, magnitude and significance are different. Example 14: 1.01, 10.1, 101., 1010., 10100., and.101,.0101,.00101, all require 3 significant bits because we can write them using the form 1.01 2 N. Limiting the number of significant bits creates a limit to how close two floating-point numbers can be. Example 15: with 32-bit IEEE floating-point numbers, we can t represent any number strictly between 1.0 (22) 0 and 1.0 (22) 1 because we would need > 24 significant bits. (By the way, that these two numbers only differ by 2-23, so they re very close.) Example 16: 2 23 and 2 23 +1 are adjacent (we can t represent any number between them). We have 2 23 = 1.0 (23) 2 23 and 2 23 + 1 = 1.0 (22) 1 2 23. Note these values differ by 1, so they re much further apart than the ones in the previous example. H. Arithmetic Problems With Floating-Point Numbers Because we can only represent certain real numbers with floating-point numbers, arithmetic operations can produce inaccurate results. Overflow: Adding or multiplying two large numbers can yield a result with an exponent that s too large. Example 17: 2 127 2 should = 2 128, which isn t representable using 32-bit floating-point numbers. Underflow: Dividing two numbers can yield an exponent that s too small. Example 18: 2 126 /2 should equal 2 127, which isn t representable using 32-bit floating-point numbers. Loss of Significance: When we do arithmetic with two floating-point numbers, the result might require too many significant bits. Examples of Loss of Significance For examples of how we can lose significant digits, let s look at 5-bit floating-point numbers of the form b.bbbb 2 N (where each b stands for a bit) Example 19: If we add 1.0000 and 0.0001, the result is 1.0001 and no loss of significance has occurred. Note we really had 1.0000 2⁰ and 0.0001 2⁰, so the exponents matched. In general, we may want to add two numbers where the exponents don t match. To make the exponents match, let s raise the smaller exponent to match the larger one. To do this, we shift its bits rightward, introducing 0s on the left and dropping bits on the right. If we drop a 1 bit, we re losing a significant digit. (Shifting out bits that are 0 seems less of a problem.) CS 350: Comp Org & Asm Lang Pgmg 4 James Sasaki, 2017

Example 20: Take 1.0000 2¹ + 1.0000 2-2 First shift 1.0000 2-2 = 0.1000 2-1 = 0.0100 2⁰ = 0.0010 2¹ Note we lost the two rightmost 0 bits. Now add 1.0000 2¹ + 0.0010 2¹ = 1.0010 2¹ Example 21: 1.0000 2¹ + 1.0011 2-2. This time we shift 1.0011 2-2 to 0.0010 2¹, but we lose the two rightmost 1 bits to do it. Then we add 1.0000 2¹ + 0.0010 2¹ = 1.0010 2¹ Note in general, floating-point addition isn t associative because we may lose significance when adding numbers with dissimilar exponents. Similar truncation problems occur with other arithmetic operations. Because each operation can introduce an error, it s tricky to write algorithms that do calculations using floating-point numbers that keep the maximal number of significant digits. CS 350: Comp Org & Asm Lang Pgmg 5 James Sasaki, 2017

Illinois Institute of Technology Activity 4 Characters, Strings, and Floats CS 350: Computer Organization & Assembler Language Programming A. Why? We need to represent textual characters in addition to numbers. We use floating-point numbers to represent non-whole numbers (numbers not evenly divisible by 1). B. Outcomes After this activity, you should Be able to describe the difference between characters and their ASCII representations. Be able to represent floating-point numbers in binary and using the IEEE representation. C. Problems 1. Let '0', '1',, '9' be the ASCII representations of the digits 0 9. (In C, you can get these numbers using (int) '0', etc.) (a) What are the values of '0', '1',, '9'? Which (if any) of the following are true? (b) '2'+'3' = '5' (c) '2'+3 = '5' (d) 2+'3'= '5' (e) 2+3 = '5'. 2. Let N be an integer with 0 N 9. What are the integer values of the following: (a) '0'+ N (b) '0'+'N' (c) 'A'+ N (d) 'a'+ N (e) Which of (a) through (d) represent printable characters? What are those characters? 3. Let X represent one of the capital letters A Z. What are the integer values of: (a) X -'A' (b) X -'A'+'a'? (c) Which of (a) and (b) represent printable characters? What are those characters? 4. What decimal number does 10.011₂ represent? (There are multiple ways to write the answer.) 5. Let X = 6.4375₁₀. (a) What is the binary representation of X? (b) What is its scientific notation representation? (I.e., 1.something 2 raised to some power.) (c) What is its 32-bit IEEE representation? 6. [9/28] Let Y = 19/8 = 10011₂ / 2³ = 10.011₂. (a) What is the scientific notation representation of Y? (b) What is the 32-bit IEEE representation of Y? (c) What is the hex representation of the result from (6b)? Hint: You need 8 hex digits to represent the 32 bits. (d) [9/28] Now do the reverse of steps a c on hex FD5C0000. First rewrite it as a bitstring, then as the three fields of a 32-bit IEEE floating point number, then as a binary number in scientific notation, then as a binary number with a binary point but no power of 2, and finally as a fraction of two decimal numbers. 7. On average, the Moon is D = 238,000 miles from the Earth. (Note: 2 17 < D < 2 18.) CS 350: Comp Org & Asm Lang Pgmg 6 James Sasaki, 2017

Illinois Institute of Technology Activity 4 (a) If we represent D using the IEEE 32-bit format, what is the largest error you could expect when trying to represent distances in miles? (b) If you were launching a lunar probe, would you want to use 32-bit floating-point numbers in your navigation system? 8. Let s assume that we re doing addition using 5 significant bits and that if we need to lose precision, we truncate the offending bits drop the rightmost bits. [9/6] (a) If we add 1.1111 + 0.1110 using 5 significant digits, does truncation (of nonzero bits) occur before the addition? After the addition? (b) Repeat, for 1.1001 +.11101 (by.11101 I mean 1.1101 2 ¹). * (c) Repeat, for 1.1101 +.01100. 9. In general, is floating-point addition associative? * If we have n significant bits and n bits to the right of the binary point, we can put the binary point inside the bitstring. CS 350: Comp Org & Asm Lang Pgmg 7 James Sasaki, 2017

Illinois Institute of Technology Activity 4 Activity 4 Solution 1a. '0' = 48, '1'= 49, '9'= 57. 1b. '2'+'3' = 50 + 51 = 101 is 53 = '5' 1c. '2'+3 = 50 + 3 = 53 is = '5' 1d. 2+'3' = 2 + 53 = 55 is = '5' 1e. 2+3 = 5 is 53 = '5'. 2. Given N is an integer, 0 N 9, we have 2a. '0'+ N = 48 + N = the ASCII representation of N 2b. '0'+'N' = 48 + 78 = 126 (which happens not to = '~' ). Note: You're not expected to know 'N' = 78 or '~' = 126 for the tests. 2c. 'A'+ N is the representation of the N + 1st capital letter of the alphabet, (If N = 0 then 'A'+ N = 'A', if N = 1, then 'A'+ N = 'B', etc.) 2d. 'a'+ N is the representation of the N + 1st lowercase letter of the alphabet. (If N = 0 then 'a'+ N = 'a', if N = 1, then 'a'+ N = 'b', etc.) 2e. (See answers above.) 3a. If X is the nth letter of the uppercase alphabet (1 n 26) then X = 'A' + n 1, so X 'A' = n 1. (If X = 'A', then X 'A' = 0; if X = 'B', then X 'A' = 1; ; if X = 'Z', then X 'A' = 25.) 3b. (X -'A') +'a' = n 1 + 'a'. This sum is the lowercase version of the uppercase X. 4. 10.011₂ = 2 +.011₂ = 2 + (11₂/100₂) = 2 ³/₈. Also, 2 +.011₂ = 2 +.25 +.125 = 2.375 (which = 2 ³/₈, of course). 5a. 6.4375₁₀ = 6 + 0.25 +.125 +.0625 = 110.0111₂. 5b. 110.0111₂ = 1.100111₂ 2² 5c. We need a sign of 0 (for 0), an exponent field of 127 + actual exponent = 127 + 2 = 129 = 1000 0001, and a fraction of 1.100111 less the leading 1 bit. The result is 0 1000 0001 100111 0 (17) where 0 (17) means 17 zeros. 6a. 10.011₂ = 1.0011₂ 2¹. 6b. We need a sign of 0, exponent field = 127 + 1 = 128 = 1000 0000, and a fraction field of 0011 plus 19 zeros: 0 1000 0000 0011 0 (19). 6c. The hex representation of this is 0100 0000 0001 1000 0 (16) = 4018 0000₁₆. 6d. Hex FD5C0000 = bitstring 1111 1101 0101 1100 0000 0000 0000 0000 = 1 1111 1010 101110^(18) Repackaging into 1-bit, 8-bit, and 23-bit fields = Sign = 1, exponent field = 1111 1010₂ = 124₁₀, fraction field = 101110 = negative 1.101110 2 to power (124-127) Add 1. to fraction, offset exponent by 127 = -1.101110 2 ³ In binary scientific notation = -0.001101110 In binary (no power of 2) = -110111₂ / 2⁸ Binary integer divided by power of 2 = -55 / 256 Decimal fraction CS 350: Comp Org & Asm Lang Pgmg 8 James Sasaki, 2017

Illinois Institute of Technology Activity 4 7a. Since 2 17 < D < 2 18, we need 18 significant bits to represent D. Since the 32-bit representation has 24 significant bits, we have 6 bits left to specify parts of a mile. The maximum error would be half of (1 mile / 2⁶) = about 41 feet. 7b. Could be problematic: If we issue a command like Fire the retro-rockets when you re X miles away from the Earth, we might fire the rockets 41 feet too high (or too low). 8a. We don t need to drop any bits to align the binary points of 1.1111 and 0.1110 (so no truncation), but we have to convert the result 10.1101 10.110 because we only have 5 significant digits, so we truncate the rightmost bit, a 1. [9/6] 8b. 1.1001 +.11101 = 1.1001 2⁰ + 1.1101 2-1 = 1.1001 2⁰ + 0.1110 2⁰ (we lost a 1 bit) = 10.0111 2⁰ = 1.0011 2¹ (no truncation). 8c. [9/6]: First we take 1.1101 +.01100 and align the binary points. We want 1.1101 2⁰ + 0.01100 2⁰, but we have to drop the rightmost bit of 0.01100 (i.e., a 0) to get 5 bits, so we have 1.1101 + 0.0110. Adding the two values together, we want 10.0011 as the sum but again we must drop the rightmost bit to get 5 bits. This time the rightmost bit is a 1, so we lose information and get 10.001, (= 1.0001 2¹ in scientific notation). 9. No, in general floating-point addition (and arithmetic in general) isn t associative. (Given a choice, it s better to add two numbers of the same magnitude than two numbers with wildly different magnitudes.) CS 350: Comp Org & Asm Lang Pgmg 9 James Sasaki, 2017