Home >Common Problem >Where are programs and data stored?
The place used to store programs and data is the "storage unit". There are a large number of storage cells in the memory, which are divided into groups according to the same bits. All storage cells in the group are read or written at the same time. Such a group of storage cells is called a storage unit; a storage unit usually One byte can be stored; the storage unit is the basic unit for the CPU to access memory.
The operating environment of this tutorial: Windows 10 system, Dell G3 computer.
The place used to store programs and data is the "storage unit".
Storage unit: A collection of multiple storage units, which is the basic unit for the CPU to access memory.
There are a large number of storage elements in the memory. They are divided into groups according to the same bits. All the storage elements in the group are read or written at the same time. Such a group of storage elements is called a storage unit.
The storage unit should generally have the functions of storing data and reading and writing data.
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, and its numbers are 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.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of Where are programs and data stored?. For more information, please follow other related articles on the PHP Chinese website!