Summary: Built-in type of machine implementation, Word/byte/bit, memory
First, the concept
The computer stores data in a bit sequence, with each bit not 0 or 1, such as: 00011011011100010110010000111011 ...
Second, the computer to block to handle memory
- The computer handles memory as a block with a power of 2 whole number of bits
- Bytes: The smallest addressable memory block, for most machines, a byte is made up of 8 bits (that is, the addressable memory block has 8 bits)
- Word: The basic unit of storage, for most machines, a word consisting of 4 bytes
Third, the search (memory) address
The Computer Associates each byte in memory with a number , which is what we call an "address."
For example, on a machine with a byte of 8 bits and a word of 32 bits, we can see the memory area of a word as follows:
byte Address in memory |
bytes (min memory block) |
736424 |
0 0 1 1 1 0 1 1 |
736425 |
0 0 0 1 1 0 1 1 |
736426 |
0 1 1 1 0 0 0 1 |
736427 |
0 1 1 0 0 1 0 0< /td> |
Iv. the importance of data types for addresses
We can use an address to represent a different size string starting at this address, for example, we might say the word in address 736424 or the byte of address 73647.
In order to give a clear meaning to an address in memory, you must first know the type of data stored at that address. The type determines the number of bits that the data occupies and how the content of those bits is interpreted.
How C + + built-in types are stored in computer memory