The Central Processing Unit (CPU) Has The Following Characteristics
The Central Processing Unit (CPU) Has The Following Characteristics
U
The central processing unit (CPU) is the primary component of any digital
computer system, consisting of the main memory, the control unit, and the
arithmetic-logic unit. It is the physical heart of the entire computer system, to
which various peripheral equipment, such as input/output devices and
auxiliary storage units, are connected. The CPU in modern computers is
housed on an integrated circuit chip known as a microprocessor.
Logic Unit
The logic unit’s function is to perform logic operations on data such as
comparing, selecting, matching, and merging.
The arithmetic logic unit (ALU) is responsible for the computer’s arithmetic
and logical functions. The input data is held in the A and B registers, and the
result of the operation is received in the accumulator. The instruction register
stores the instruction that the ALU will execute.
When adding two numbers, for example, one is placed in the A register and
the other in the B register. The addition is performed by the ALU, and the
result is stored in the accumulator. The data to be compared is placed into the
input registers if the operation is logical. The comparison result, a 1 or 0, is
stored in the accumulator. The accumulator content is then placed into the
cache location reserved by the program for the result, whether it is a logical or
arithmetic operation.
The ALU also performs another type of operation. The result is a memory
address, which is used to calculate a new memory location to begin loading
instructions. The outcome is stored in the instruction pointer register.
Cache
The CPU never has direct access to RAM. Modern CPUs have one or more
cache layers. The CPU’s calculation speed is much faster than the RAM’s
ability to feed data to the CPU.
Cache memory is faster than system RAM and, because it is located on the
processor chip, it is closer to the CPU. The cache stores data and instructions
to keep the CPU from having to wait for data to be retrieved from RAM. When
the CPU requires data—and program instructions are considered data—the
cache checks to see if the data is already in residence and returns it to the
CPU.
If the requested data is not in the cache, it is retrieved from RAM and used to
move more data from RAM into the cache using predictive algorithms. The
cache controller analyses the requested data and attempts to predict what
additional data from RAM will be required. It loads the expected data into the
cache. By storing some data closer to the CPU in a faster-than-RAM cache,
the CPU can stay busy and avoid wasting cycles waiting for data.
Our simple CPU has three cache levels. Levels 2 and 3 are intended to
predict what data and program instructions will be required next, and to move
that data from RAM to a location closer to the CPU so that it is ready when
needed. These cache sizes typically range from 1 MB to 32 MB, depending on
the processor’s speed and intended to use.