The content stored in the computer's storage unit can be data and instructions. A storage unit is a collection of multiple storage units. It should generally have the function of storing data and instruction data, and reading and writing data. An 8-bit binary is used as a storage unit, which is a byte.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
What is stored in a computer storage unit?
The content stored in the computer's storage unit can be data and instructions.
Storage unit: a collection of multiple storage units
Generally should have the function of storing data and instructions, reading and writing data, using 8-bit binary as a storage unit, that is, a byte. Each unit has an address, which is an integer encoding and can be represented as a binary integer. Variables in the program correspond to storage locations in main memory. The name of the variable corresponds to the address of the storage unit, and the content of the variable corresponds to the data stored in the unit. Storage addresses are generally represented by hexadecimal numbers, and each memory address stores a set of binary (or hexadecimal) numbers, which are usually called the contents of the address.
Storage unit
The smallest unit of information in a computer is bit, which is a binary bit. 8 bits make up a Byte, which is a byte. One storage unit can store one byte, which is 8 binary bits. The memory capacity of a computer is calculated in bytes as the smallest unit. For a memory with 128 storage units, it can be said that its capacity is 128 bytes. If there is a 1KB memory, it has 1024 storage units, which are numbered from 0-1023. The memory is divided into several storage units, and each storage unit is numbered sequentially starting from 0. For example, if a memory has 128 storage units, its number is from 0-127.
Storage addresses are generally represented by hexadecimal numbers, and each memory address stores a set of binary (or hexadecimal) numbers, which are usually called the contents of the address. It is worth noting that the address of the storage unit and the content in the address are different. The former is the number of the storage unit, which represents a location in the memory, while the latter represents the data stored in this location. Just like one is the room number and the other is the person living in the room.
The storage unit that stores a machine word is usually called a word storage unit, and the corresponding unit address is called a word address. The unit that stores one byte is called a byte storage unit, and the corresponding address is called a byte address. If the smallest addressable unit in a computer is a word memory unit, the computer is called a word-addressable computer. If the smallest addressable unit in a computer is a byte, the computer is called a byte-addressable computer. If the machine word length is equal to the number of bits in the memory unit, a machine word can contain several bytes, so a memory unit can also contain several byte addresses that can be individually addressed. For example, a 16-bit binary word storage unit can store two bytes and can be addressed by word address or byte address. When addressing with byte addresses, the 16-bit storage unit occupies two byte addresses.
If you want to read more related articles, please visitPHP Chinese website! !
The above is the detailed content of What is stored in a computer's memory unit?. For more information, please follow other related articles on the PHP Chinese website!