0% found this document useful (0 votes)
5 views

unit 4

Uploaded by

Chanda Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

unit 4

Uploaded by

Chanda Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Computer Architecture refers to the design and organization of the various components of a computer

system to ensure that they work together efficiently to execute instructions and perform tasks.

History of Computer Architecture:

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.

The key components include:

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.

Memory Hierarcy and Cache

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:

1. External Memory or Secondary Memory:


Comprising of Magnetic Disk, Optical Disk and Magnetic tape i.e. peripheral storage devices
which are accessible by the processor via an I/O Module.

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.

2. Internal Memory or Primary Memory


Comprising of Main memory, Cache Memory & CPU registers. This is directly accessible by the
processor.
1. Registers:
Registers are small, high-speed memory units located in the CPU. They are used to store the
most frequently used data and instructions. Registers have the fastest access time and the
smallest storage capacity, typically ranging from 16 to 64 bits.

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

Types of Instruction Code:


They are classified based on the number of operands, the type of
operation performed, and the addressing modes used. The following
are some common types of instruction codes:
1. One-operation instruction:
These instructions have one operand and perform an operation on
that operand.
e.g. “neg” instruction in the x86 assembly language
2. Two-operation operand instructions:
These instructions have two operands and perform an operation
involving both.
e.g. “add”

3. Three-operand instructions: These instructions have three


operands and performs an operation that involves all three
operands.
e.g. “fma” (fused multiply-add) instruction in some processor
multiplies two operands together, adds a third operand, and
stores the result in a fourth operand.
4. Data transfer instruction:
These instructions mode data between memory and registers or
between registers.
e.g. “mov”
5. Control transfer instruction
These instructions change the flow of program execution by
modifying the program counter.
e.g. “jmp” – jumps to a different location in the program
6. Arithmetic instruction
These instruction perform mathematical operations on operands.
e.g. “add”
7. Logical instruction
These instruction perform logical operations on operands.
e.g. “and”
8. Comparison instruction
These instructions compare two operands and set a flag based on
the result.
e.g. cmp
9. Floating-point instructions:
These instruction perform arithmetic and other operations on
floating-point numbers.
e.g. fadd

Stored Program Organization


Common Bus System:
A basic computer has 8 registers, memory unit and a control unit.
The diagram of the common bus system is as shown below:

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.

 Memory Address Registers (MAR): It holds the address of the


location to be accessed from memory. MAR and MDR (Memory
Data Register) together facilitate the communication of the CPU
and the main memory.

 Memory Data Registers (MDR): It contains data to be written into


or to be read out from the addressed location.

 General Purpose Registers: These are numbered as R0, R1,


R2….Rn-1, and used to store temporary data during any ongoing
operation. Its content can be accessed by assembly programming.
Modern CPU architectures tend to use more GPR so that register-
to-register addressing can be used more, which is comparatively
faster than other addressing modes.

 Program Counter (PC): Program Counter (PC) is used to keep the


track of the execution of the program. It contains the memory
address of the next instruction to be fetched. PC points to the
address of the next instruction to be fetched from the main
memory when the previous instruction has been successfully
completed. Program Counter (PC) also functions to count the
number of instructions. The incrementation of PCs depends on
the type of architecture being used. If we are using a 32-bit
architecture, the PC gets incremented by 4 every time to fetch the
next instruction.

 Instruction Register (IR): The IR holds the instruction which is just


about to be executed. The instruction from the PC is fetched and
stored in IR. As soon as the instruction is placed in IR, the CPU
starts executing the instruction, and the PC points to the next
instruction to be executed.

 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.

You might also like