본문 바로가기
독서/Book

[CS APP] Computer Systems: a programmer’s perspective 3/E (2)

by 멜랑멀리 2025. 1. 31.
반응형
SMALL

2025.01.31 - [독서/Book] - [CS APP] Computer Systems: a programmer’s perspective 3/E

2025.01.31 - [독서/Book] - [CS APP] Computer Systems: a programmer’s perspective 3/E (1)

 

< Floating Point >

 

 

Fixed point 로도 사용됨. (표현의제약존재)

 

 

FP32에서

Exp field 는 Exp (8bit 정보) - Bias(127) 한게 E로 사용됨. E가 13이면, Exp field 는 140.

Frac field는 1.xxxx(x가 frac) 를 M으로 사용함. (-1 한값이 frac filed에 사용됨.) 

 

normalized encoding에서는 bias(127) 와 2^13의 13값이 더해진 140 값이 exp값이 됨. 

 

exp 이

all 0 이면 0.xxx 가됨.

                 frac = all 0 : zero

                 frac != all 0 : 0.0에 가까운수.

all 1일경우, frac= all 0 : +무한대 , - 무한대.

                  , frac != all 0 : NaN(Not-a-Number)

 

 

 

FP8

 

 

 

 

6bit 예시 ) 

 

 

 

FP곱은

Sign 은 exclusive-or 

M(frac)은 곱셈

Exp는 덧셈.

 

 

 

 

반응형
SMALL