Home> Common Problem> body text

Where are programs and data stored?

青灯夜游
Release: 2023-01-13 00:39:05
Original
11769 people have browsed it

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.

Where are programs and data stored?

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 theFAQcolumn!

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!