Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:cs:chapter_3_11 [2026/02/08 17:33] – [Integers] ktokarzen:multiasm:cs:chapter_3_11 [2026/03/29 18:24] (current) – [Endianness] ktokarz
Line 3: Line 3:
  
 ===== 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 range starts with zero. In such a case, it contains all bits equal to zero. While it contains all bits equal to one, the value can be calculated with the expression  +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 range starts with zero. In such a case, 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?100 |}}, +{{:en:multiasm:cs:equation_binary.png?100 |}},\\ \\ 
 where n is the number of bits in a number.  where n is the number of bits in a number. 
  
Line 26: Line 26:
   * Exponent (E)   * Exponent (E)
   * Mantissa (M)   * Mantissa (M)
-fulfilling the equation +fulfilling the equation\\ 
-{{ :en:multiasm:cs:equation_floating.png?200 |}}+{{:en:multiasm:cs:equation_floating.png?100 |}}.\\
  
 There are two main types of real numbers, called floating-point values. Single precision is a number which is encoded in 32 bits. A double-precision floating-point number is encoded with 64 bits. They are presented in Fig{{ref>realtypes}}. There are two main types of real numbers, called floating-point values. Single precision is a number which is encoded in 32 bits. A double-precision floating-point number is encoded with 64 bits. They are presented in Fig{{ref>realtypes}}.
  
 <figure realtypes> <figure realtypes>
-{{ :en:multiasm:cs:floating_numbers.png?600 |Illustration of a single and double precision real numbers}}+{{:en:multiasm:cs:floating_numbers.png?600 |Illustration of a single and double precision real numbers}}
 <caption>Illustration of a single and double precision real numbers </caption> <caption>Illustration of a single and double precision real numbers </caption>
 </figure> </figure>
Line 40: Line 40:
 <table realnumbers> <table realnumbers>
 <caption> Floating point numbers</caption> <caption> Floating point numbers</caption>
-^ Precision        ^ Exponent  ^ Mantissa  ^ The smallest                             ^ The largest                              +^ Precision        ^ Exponent  ^ Mantissa  ^ The smallest                            ^ The largest                             
-| Single (32 bit)  | 8 bits    | 23 bits   | {{ :en:multiasm:cs:min_fp_32.png?105 }}  | {{ :en:multiasm:cs:max_fp_32.png?100 }}  | +| Single (32 bit)  | 8 bits    | 23 bits   | {{ :en:multiasm:cs:min_fp_32.png?50 }}  | {{ :en:multiasm:cs:max_fp_32.png?50 }}  | 
-| Double (64 bit)  | 11 bits   | 52 bits   | {{ :en:multiasm:cs:min_fp_64.png?120 }}  | {{ :en:multiasm:cs:max_fp_64.png?100 }}  |+| Double (64 bit)  | 11 bits   | 52 bits   | {{ :en:multiasm:cs:min_fp_64.png?60 }}  | {{ :en:multiasm:cs:max_fp_64.png?50 }}  |
 </table> </table>
  
Line 67: Line 67:
 <caption>Illustration of Little and Big Endian data placement in the memory</caption> <caption>Illustration of Little and Big Endian data placement in the memory</caption>
 </figure> </figure>
 +
 +Big-endian is mainly used in network protocols, where the most significant bytes are sent first. In modern processors, the dominant order of data placement in memory is little-endian, although some processors (including ARM) can support both modes. Big endian is more human intuitive, but little endian makes it possible to access the same data with different sizes at the same address. It is important for fast data type casting (for example, treating a 32-bit integer as a 16-bit integer) because the starting address doesn't change. Some processors support conversion between little- and big-endianness with special instructions.
en/multiasm/cs/chapter_3_11.1770564787.txt.gz · Last modified: by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0