Computer Data Storage and Computer Data Storage
Applications generally run in computer memory to operate various data.
Data Storage
The storage space of a computer can be divided into two parts: memory and external storage.
For computer storage units, both memory and external storage are composed of countless electronic switches. These electronic switches are enabled and disabled. The status is 1 and 0.
A bit represents a basic unit of binary and a basic unit of computer storage.
Memory Unit
Daily files are generally stored in hard disks and other external storage. When a file or application is executed, it is loaded into the computer memory. Therefore, memory is the most important component of a computer. No memory, and no program or file can be executed.
In the memory of a computer, each byte storage unit has an address that stores and reads data in the memory.
In a computer, the memory address is encoded in byte order. This facilitates program addressing and Data Reading and writing. The external storage of computers is stored in the same way.
In a program, it is generally not necessary or recommended to operate on the memory address directly, but is automatically allocated by the compiler.
Data Storage
In a computer, bit is the most basic storage unit. Data of different types must be converted to binary and stored in the memory.
Storage of character data
Each character variable is allocated with one byte of memory space, so only one character can be stored. The character value is stored in the memory unit of the variable in the form of ASCII code.
Data Storage
Generally, in a computer, two bytes are used to store integers and four bytes are used to store real numbers.
Program ing in memory
For computers, everything is data. A program is also a type of data. A program usually contains a large amount of common data and command data. When a computer is running, normal data is loaded into the computer memory through a program, while the program is loaded into the memory by the operating system.
The ing of an application in a computer should include the following aspects:
Memory space allocated for application commands
Memory space allocated for static data of the application
Memory space reserved for dynamic data of applications --- dynamic data stack
Dynamic Data is divided into two types: Automatic Recovery and manual recovery. The memory space for storing dynamic data that is automatically recycled becomes the stack space, which is called the heap space.