unit 4
unit 4
system to ensure that they work together efficiently to execute instructions and perform tasks.
Computer have gone through many changes over time. The first generation of computer started around
1940 and since then there have been five generations of computers until 2023. Computers evolved over
a long period of time, starting from the 16th century, and continuously improved themselves in terms of
speed, accuracy, size and price to become the modern day computer.
Overview of Computer Organization:
Computer organization refers to the way a compute’s hardware components are arranged and interact to
execute instructions. It encompasses the design and structure of the computer’s internal architecture
including CPU, Memory, input/output devices and reliable and scalable system that can execute a wide
range of tasks.
1. CPU:
It is regarded as the brain of the computer, the CPU is responsible for executing instructions
stored in memory. It comprises the arithmetic logical unit (ALU) for performing calculations, the
control unit for managing the execution of instructions and register for temporary data storage.
2. Memroy:
Memory is where data and program instructions are sotred for quick access by the CPU.
Computer system typically have two types of memory – volatile RAM (Random Access Memory)
for temporary data storage and non-volatile storage (like hard drives and SSDs) for long-term
data storage.
3. Input/Output Devices:
These includes peripherals like keyboards, mouse, displays and external storage devices. I/O
devices facilitate communication between the computer and the external world.
4. System Bus:
The system bus is a communication pathway that connects the CPU, memory and I/O devices,
allowing them to exchange data and instructions.
5. Storage:
In addition to RAM, computer’s have long-term storage devices like hard drives or SSDs, where
data and applications are stored even when the power is turned off.
6. Cache memory:
Cache memory is a small, high-speed type of volatile computer memroy that provides high-
speed data access to a processor and stores frequently used computer programs, applications
and data.
Computer organization also considers factors such as data representation, instruction set architecture,
and addreesing modes. Different types of computer organizations, such as Von neumann architecture
and Harvard Architecture, offer varying approaches to organizing memory an processing units.
Memroy hierarchy is an enhancement to organize the memory such that it can minimize the access time.
The Memory Hierarchy was developed based on a program behavior known as locality of references.
The memory hierarchy design is divided into 2 main types:
Secondary Storage:
Secondary storage, such as HDD(Hard disk drives and Solid state drives (SSD) is a type of non-
volatile memory unit that has a larger storage capacity than main memory. It is used to store
data and instructions that are not currently in use by the CPU. Secondary storage has the slowest
access time and is typically the least expensive type of memory in the memory hierarchy.
Magnetic Disk:
Magnetic disks are simply circular plates that are fabricated with either a metal or a plastic or a
magnetized material. The Magnetic disks work at a high speed inside the computer and these
are frequently used.
Magnetic Tape:
Magnetic tapes is a simply a magnetic recording device that is covered with a plastic film. It is
generally used for the backup of data. In the case of a magnetic tape, the access time for a computer is a
little slower and therefore, it requires some amount of time for accessing the strip.
Instruction Codes:
Instruction codes are bits that instruct the computer to execute a specific operation. An
instruction comprises groups called fields. These includes:
1. The Operation code(Opcode) field determines the process that needs to perform.
2. The Address Field contains the operands locations i.e. register or memory location.
3. The mode fields specifies how the operand locates.
Structure of Instruction code
Connections:
The outputs of all the registers except the OUTR (output register) are connected to the common
bus. The output selected depends upon the binary value of variables S2, S1 and S0. The lines
from common bus are connected to the inputs of the registers and memory. A register receives
the information from the bus when its LD (load) input is activated while in case of memory the
Write input must be enabled to receive the information. The contents of memory are placed
onto the bus when its Read input is activated
Computer Registers
In Computer Architecture, the Registers are very fast computer memory
that is used to execute programs and operations efficiently. This is done
by giving access to commonly used values, i.e., the values that are at
the point of operation/execution at that time. So, for this purpose,
there are several different classes of CPU registers that work in
coordination with the computer memory to run operations efficiently.
There are several types of registers available in the CPU for different
purpose :
Accumulator: This is the most frequently used register used to
store data taken from memory. It is indifferent numbers in
different microprocessors.
Stack Pointer (SP): The stackPCs pointer points to the top of the
stack, which is a part of the memory used to store function calls
and other operations.
Flag Register: A flag register, also known as a status register or
condition code register, is a special type of register in a computer’s
central processing unit (CPU) used to indicate the status of the
CPU or the outcome of various operations such as Zero Flag, Carry
flag, Sign Flag, Overflow Flag, Parity Flag, Auxiliary Carry Flag, and
Interrupt Enable Flag.
Condition code register ( CCR ): Condition code registers contain
different flags that indicate the status of any operation. For
instance, let’s suppose an operation caused the creation of a
negative result or zero, then these flags are set high accordingly.
and the flags are
1. Carry C: Set to 1 if an add operation produces a carry or a subtract
operation produces a borrow; otherwise cleared to 0.
2. Overflow V: Useful only during operations on signed integers.
3. Zero Z: Set to 1 if the result is 0, otherwise cleared to 0.
4. Negate N: Meaningful only in signed number operations. Set to 1
if a negative result is produced.
5. Extend X: Functions as a carry for multiple precision arithmetic
operations.
These are generally decided by ALU.
So, these are the different registers that are operating for a specific
purpose.
Size of CPU Register
The number and size of the register in the CPU depend on the processor
design and can have an important impact on its performance and
capabilities on the CPU. Now, let’s discuss the different sizes of the
register available in the CPU:
8-bit registers: These can store 8 bits of data, which is the same as
1 byte. They are used for simple arithmetic and data
manipulation.
16-bit registers: These hold 16 bits of data, or 2 bytes. These
registers are found in older processors or certain systems that
need 16-bit operations.
32-bit registers: These can store 32 bits of data or 4 bytes. They
are common in many processors and can handle larger data sizes
and more complex calculations than 8-bit or 16-bit registers.
64-bit registers: These hold 64 bits of data, or 8 bytes. Modern
processors often use these, providing more computational power
and better memory-addressing capabilities.