COMPUTER ORGANISATION
AND ARTICTECTURE
CPU organization:- CPU organization refers to the internal
structure and arrangement of the Central Processing Unit (CPU), detailing how
its components are organized and interconnected to execute instructions
efficiently. The CPU is the brain of the computer, responsible for performing all
the computations, data processing, and controlling tasks in a system.
Understanding CPU organization helps us see how different parts of the CPU
work together to execute instructions and manage data.
Components of CPU Organization:
1. Arithmetic Logic Unit (ALU)
Purpose: The ALU is responsible for performing all arithmetic (addition,
subtraction, multiplication, division) and logical (AND, OR, NOT, XOR)
operations.
2. Control Unit (CU)
Purpose: The control unit directs the operation of the CPU. It fetches
instructions from memory, decodes them, and coordinates the activities
of the other CPU components.
3. Registers
Purpose: Registers are small, fast storage locations within the CPU. They
temporarily hold data that the CPU is currently working with.
4. Cache Memory
Purpose: Cache memory is a small, high-speed memory located inside or
very close to the CPU. It stores frequently accessed data and
instructions, reducing the time it takes to fetch them from the slower
main memory (RAM).
5. Buses
Purpose: Buses are the communication pathways used for transferring
data between various components inside the CPU and between the CPU
and other parts of the computer (memory, I/O devices).
6. Clock
Purpose: The clock generates timing signals that synchronize the
operations of the CPU. It determines the speed at which the CPU can
execute instructions by controlling the rate of the instruction cycle
(fetch, decode, execute).
7. Input/Output (I/O) Interface
Purpose: The I/O interface connects the CPU to external devices like
keyboards, mice, storage devices, and other peripherals. It allows the
CPU to communicate with and control these devices.
Instruction Execution:-
Instruction execution is the process by which a computer's processor
carries out the instructions contained in a program. This involves
fetching instructions from memory, decoding their meaning, and
then executing them. The processor retrieves an instruction from
memory, decodes it, and performs the necessary actions, such as
arithmetic, logical operations, or data transfer. The result is then
stored in a register or memory location.
Instruction Cycle:-
The instruction cycle is the process by which a CPU executes a single
instruction from a program. It involves a series of steps that the CPU
follows to fetch, decode, and execute each instruction in the correct
order. This cycle is repeated for every instruction that the CPU
processes, and it happens millions or billions of times per second.
The instruction cycle has three main phases:
1. Fetch:
The CPU fetches (or gets) the next instruction from memory,
where the program is stored.
The address of the next instruction is stored in the Program
Counter (PC), which points to the memory location where the
instruction can be found.
Once the CPU has fetched the instruction, it moves it to the
Instruction Register (IR), and the Program Counter is updated
to point to the next instruction.
2. Decode:
The CPU then decodes the instruction to figure out what action
is required.
This means breaking down the instruction into parts (like the
operation and the data involved) so that the CPU can
understand what needs to be done.
The Control Unit (CU) plays a key role in decoding the
instruction by interpreting its opcode (the part of the
instruction that tells the CPU what operation to perform, like
adding, subtracting, or moving data).
3. Execute:
The CPU performs the required action based on the decoded
instruction. This could be:
o Performing an arithmetic or logical operation in the
Arithmetic Logic Unit (ALU).
o Accessing data from memory or writing data to memory.
o Jumping to a different instruction (like in loops or
conditionals).
After executing the instruction, the result might be stored back
in memory or in one of the CPU's registers.
4.Optional: Store
In some cases, after execution, the result needs to be stored
back into memory or a register for future use.