Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |
| en:multiasm:cs:chapter_3_11 [2025/05/14 08:48] – [Integers] ktokarz | en:multiasm:cs:chapter_3_11 [2025/05/15 06:20] (current) – [Integers] ktokarz |
|---|
| |
| ===== Integers ===== | ===== Integers ===== |
| Integer data types can be 8, 16, 32 or 64 bits long. If the encoded number is unsigned, it is stored in binary representation, while if the value is signed, the representation is two's complement. A natural binary number starts with aero if it contains all bits equal to zero. While it contains all bits equal to one, the value can be calculated with the expression {{ :en:multiasm:cs:equation_floating.png?200 |}}, where n is the number of bits in a number. | Integer data types can be 8, 16, 32 or 64 bits long. If the encoded number is unsigned, it is stored in binary representation, while if the value is signed, the representation is two's complement. A natural binary number starts with aero if it contains all bits equal to zero. While it contains all bits equal to one, the value can be calculated with the expression {{ :en:multiasm:cs:equation_binary.png?200 |}}, where n is the number of bits in a number. |
| |
| In two's complement representation, the most significant bit (MSB) represents the sign of the number. Zero means a non-negative number, one represents a negative value. The table {{ref>binarynumbers}} shows the integer data types with their ranges. | In two's complement representation, the most significant bit (MSB) represents the sign of the number. Zero means a non-negative number, one represents a negative value. The table {{ref>binarynumbers}} shows the integer data types with their ranges. |