본문 바로가기
독서/Book

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

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

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

 

< Bits, Bytes, and Integers >

char: 1B 

short: 2B

int: 4B

long: 4B / 8B

float: 4B / 4B

double: 8B / 8B

pointer: 4B / 8B

 

 

 

unsigned integer (short) : 0 ~ 65535 

signed integer (short) : -32768 ~32767

int 형은 signed 가 default. (선언안하면)

unsigned int로 쓰고 싶으면, unsigned int c ; 선언필요.

 

signed는 expanding할때, sign정보가 extention 됨.

- 면, 1이 확장시 붙고, + 면, 0이 확장시 붙음.

 

이론적 덧셈.

4bit unsigned 는 overflow 발생. 

 

 

signed 는 neg-over , pos-over 발생.

 

 

1 word = 32b (4B) = 32bit system (up to 4GB)

            = 64b (8B) = 64bit system (up to 2^64= 16EB)

 

 

 

big endian =  Least significant byte has highest address

little endian = Least significant byte has lowest address

 

 

 

반응형
SMALL