In-depth understanding of computer systems - represents the processing of information

  1. Basic concepts
    1. Although only represents an integer of encoding a relatively small range of values, but this representation is exact; While the float may encode a large range of values, but this represents only approximate.
    2. Due to the limited accuracy of the representation of floating-point operations are not binding.
  2. Information storage
    1. Byte is the smallest addressable unit of memory. Memory can be regarded as a very large array of bytes, each byte of memory from the unique identification numbers (addresses). It is a collection of virtual address space of all possible addresses.
    2. c language pointer and put each type of information linked together, the value of the pointer indicates the position of an object, and its type represents the type of store that position on the subject.
    3. Word length determines the maximum size of the virtual space, a machine for the word length of w bits, the virtual address range is $ 0 ~ 2 ^ w-1 $, up to $ 2 ^ w $ accessed bytes. Word length is the nominal size of the pointer to the data.
    4. Multi-byte object is stored as a consecutive sequence of bytes, the address of the object with the smallest address byte.
    5. Big endian and little-endian
      1. In memory to store the most significant byte order from little-endian object called the least significant byte.
      2. In memory is called big endian byte from most significant to least significant byte stored data.
      3. E.g. ox100 located int-type variable x, the data storage is 0x01234567, the address byte order ox100 ~ ox103 depends on the type of machine
      4. image
    6. c language shift operation
      1. Arithmetic left shift and logical shift left as the left x k bits, k bits are discarded highest, lowest complement 0. k bits from left to right shift operation may be combined. x << j << k is equivalent to (x << j) << k.
      2. At the highest logical shift of k bits 0 complement, the complement arithmetic right shift of k is the highest at the highest bit symbol.
      3. Almost all compilers, combinations of the machines with a number of symbols arithmetic right shift, for unsigned number, it must be the right logic.
      4. When k is larger than the length of the shift data, such as for integer variables x (4 bytes 32). x >> k, if k is larger than 32, the actual displacement amount k mod 32.
  3. Integer
    1. Complement encoding
      1. image

Guess you like

Origin www.cnblogs.com/cyj1258/p/12576939.html