Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| en:multiasm:cs:chapter_3_11 [2025/01/08 18:29] – [Floating point] 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 the value is signed the representation is two's complement. 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. | 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. |
| <table binarynumbers> | <table binarynumbers> |
| <caption> Integer binary numbers</caption> | <caption> Integer binary numbers</caption> |