K Fractional Binary Numbers

Representable Numbers
Limitation 1
- Can only exactly represent numbers of the form x / 2^k
- 다른 숫자들은 무한 소수가 된다
Limitation 2
- Just one setting of binary point within the w bits
- 소수점을 왼쪽으로 옮기면 큰 수를 나타낼 수 없고, 오른쪽으로 옮기면 소수점 자리를 자세하게 나타내지 못한다
Floating Point Representation

Precision Options

Normalized Values
- When : exp != 0000...0 and exp != 1111...1


Normalized Encoding Example

Denormalized Values
- Condition : exp = 0000...0
- Exponent Value : E = 1 - Bias
- Significand coded with implied leading 0 : M = 0.xxx...xx (2)

Special Values
- Condition : exp = 1111...1

Visualization : Floating Point Encodings

s, exp, frac 값으로 E와 Value 계산해보기

Distribution of Values


Floating Point Operations : Basic idea
Basic Idea
- First compute exact result
- Make it fit into desired precision
Rounding modes


Rounding Binary Numbers

FP Multiplication

Floating Point Addition

Mathematical Properties of FP Add

Mathematical Properties of FP Mult

Floating Point Puzzles

1. NO – not enough frac bit
2. YES
3. YES
4. NO – not enough frac bit
5. YES
6. NO – 2/3은 0이다
7. YES – overflow 되더라도 negative infinity쪽으로
8. YES
9. YES
10. NO – lack of associative
'Computer Science Lectures > Introduction to Computer Systems - CMU' 카테고리의 다른 글
Lecture 06: Machine-Level Programming 2: Control (0) | 2022.10.24 |
---|---|
Lecture 05: Machine-Level Programming 1: Basics (0) | 2022.10.19 |
Lecture 03: Bits, Bytes, and Integers (cont.) (0) | 2022.10.11 |
Lecture 02: Bits, Bytes, and Integers (0) | 2022.10.10 |
Lecture 01: Course Overview (0) | 2022.10.09 |