Anyone who has ever thought about becoming an IT professional or system administrator, or simply associating fate with computer technology, knowing how numbers are represented in computer memory is absolutely necessary. Indeed, this is where low-level programming languages such as Assembler are based. Therefore, today we will consider the representation of numbers in a computer and their placement in memory cells.
Number system
If you are reading this article, then most likely you already know about it, but it’s worth repeating. All data in a personal computer is stored in a binary number system. This means that any number must be represented in the appropriate form, that is, consisting of zeros and ones.
, , . .
, , 2. (0 1). 2 . , 0 1. , .
. , .
, 1 . , . , – 1 0.
. 8 . , 1 .
. , , .
, . – . , 0 11111111. .
= 1 × 27 + 1 × 26 + 1 × 25 + 1 × 24 + 1 × 23 + 1 × 22 + 1 × 21 + 1 × 20 = 1 × 28 - 1 = 255.
, 0 255. . , -.
, , . , , , 16 . 15 , ( ) .
, "1", , "0". : , 1, , (0).
15 . , . , .
2 , . , , = 32766, . , "0" .
. , . , , .
, .
- . , .
- . .
- "1" . .
. = - 131. ||= 131. 16 . = 0000000010000011. =1111111101111100. "1" =1111111101111101. 16- = - (215) = - 32767.
, . . , , 4 , 32 .
. , .
=2 147 483 647.
min=- 2 147 483 648.
, .
. , , . , , , . .
, . , .
= m * . m – , – – .
, 1/ 1.
666,66. . = 0,66666 * 103. = 10 = 3.
4 8 (32 64 ). , – .
4 , , 1 (8 ) , 3 (24 ) , . , .
= 11111112 = 12710. , , . =2127. . 223 – 1 ≥ 223 = 2(10 × 2,3) ≥ 10002,3 = 10(3 × 2,3) ≥ 107. , .
, , 4 . = 1,701411 * 1038. , .
, . 11 , 53 .
= 11111111112 = 102310.
= 252 -1 = 2(10*5.2) = 10005.2 = 1015.6. = 21023 "".
, , , , , .