Computer Hardware - Processing Device
Computer Hardware - Processing Device
When a computer receives data from an input device (e.g., keyboard or mouse), the data must go through
an intermediate stage before it can be sent to an output device (e.g., monitor or printer). A processing
device is any device in a computer that handles this intermediate stage. For example, the Central Processing
Unit.
CENTRAL PROCESSING UNIT (CPU)
CPU, the brain of the computer is the electronic circuitry within a computer that carries out the
instructions of a computer program by performing the basic arithmetic, logical, control and
input/output (I/O) operations specified by the instructions.
COMPONENTS OF A CPU
1. Arithmetic Logic Unit (ALU): ALU performs arithmetic and logic operations. ALUs are capable of
calculating the results of a wide variety of basic arithmetical computations. The ALU can perform
4- kinds of arithmetic operations (mathematical operations) that is addition, subtraction,
multiplication and division. The ALU also performs logical operations such as Equal-to (=)
conditions, Less-than (<) conditions, Greater-than (>) conditions, which is usually a comparison of
letters, numbers or special characters.
2. Control Unit (CU): CU extracts instructions from memory, decodes, and executes them, calling on
the ALU when necessary. Control Unit controls the fetching (from memory) and execution of
instructions by directing the coordinated operations of the ALU, registers and other components.
3. Register: Registers are temporary storage areas for instructions or data, that offer the advantage
of speed.Registers work under the direction of the CU to accept, hold, and transfer instructions
or data. The are many registers including;
Memory Address Register (MAR): Holds the address of a location in memory.
Memory Data Register (MDR): Holds data just read from or to be written to memory.
Program Counter (PC): Holds the address of the next instructions to be fetched.
Instruction Register (IR): Holds the current instruction being executed.
Accumulator: Holds the results of executed instructions
General Purpose Registers: Can be used by programmers.
NB: The more registers a CPU has available, the faster it works.
4. Memory Unit: the area of storage in a computer that maintains information for instant retrieval
and processing, as distinct from disk storage. The Memory buffer that temporarily stores data the
processor needs, allowing the processor to retrieve the data faster than if it came from main
memory.
It holds random data, usually on first in first out, or first in last out basis.
MACHINE CYCLE
Machine Cycle is a series of steps CPU takes to execute an instruction. The machine cycle is a 4-process
cycle that includes reading and interpreting the machine language, executing the code and then storing
that code.
Four steps of Machine cycle:
1. Fetch: Retrieve an instruction from the memory. Before the CPU can execute an instruction, the
control unit must retrieve or fetch a command or data from the computer's memory.
2. Decode: Translate the retrieved instruction into a series of computer commands. Before a
command can be executed, the control unit must decode the command into instruction set into
form the ALU can understand.
3. Execute: Execute the computer commands. When the command is executed, the CPU carried out
the instructions in order by converting them into macrocode.
4. Store: Send and write the results back in memory. The CPU may be required to store the result of
an instruction in memory.
Simplified
Control Unit fetches the data from the RAM and places it in the data registers, and fetches the
instruction and places it in an instruction register.
Control Unit decodes the instruction to determine what needs to happen and tells the ALU.
ALU executes the instruction and places the result in a result register (accumulator).
Control Unit orders the data in the result register to exit the CPU, where it is stored in memory.
WHEN YOU DOUBLE CLICK ON AN ICON TO RUN A PROGRAM, HERE IS WHAT HAPPENS:
1. The program, which is stored inside the hard disk drive, is transferred to the RAM memory.
2. The CPU, using a circuit called memory controller, loads the program data from the RAM memory.
3. The data, now inside the CPU, decoded and given to the ALU to work on (processing).
4. The CPU could continue to load and executing the program, depending on the program
(instructions).
5. It is then sent back to the main memory for temporal storage before giving it out as information
(displaying something on the screen).
NB: A program is a series of instructions to the CPU.
TERMS ASSOCIATED WITH THE WORKINGS OF CPU
Processor Speed: This refers to the speed at which a microprocessor executes instructions. This
is usuallymeasured in megahertz (MHz) or gigahertz (GHz). Processor speed is more important
because the CPU is the driving force and brain of your computer. A Processor works by
performing instructions from its instruction set. A GHz means one billion hertz or cycles per
second.
The rate at which the CPU executes instructions is dependent on the system clock (clock rate).
System Clock/Clock Rate: Is an internal clock that regulates the rate which the instructions are
executedand synchronises all the various computer components. The system clock is measured
in Hertz, Megahertz, Gigahertz, etc.
NB: Processor speed is the same as clock speed of a CPU. The clock speed of a CPU is the
frequency at which the processor executes instructions or data are processed.
Simple analysis:
A 32-bit system can access 232 memory addresses, i.e., 4 GB of RAM or physical memory.
A 64-bit system can access 264 memory addresses, i.e., actually 18-Quintillion GB of
RAM. In short,any amount of memory greater than 4 GB can be easily handled by it.