Computer Architecture and Organisation Notes
Computer Architecture and Organisation Notes
Computer Architecture is concerned with the way hardware components are connected together
to form a computer system. Computer Organization is concerned with the behavior of a
computer system. Computer architecture explains what a computer should do. Computer
organization explains how a computer works. Computer architecture deals with high level
design. Computer organization deals with low level design. Computer architecture is designed
first. Computer organization is started after finalizing computer architecture. Computer
Architecture is programmer view. Computer organisation is transparent from programmer.
Unit-I
Basic Structure of computers
A computer can be define as the fast electronic machine that accept the data (digital input
information) process it as per the list of internally stored instruction and process the resulting
information. Set of instruction return to achieve task is called a program and internal storage is
called as computer memory.
Different Types of computer
Personal computer
Note book computer/ Laptops
Work station
Enterprise System (Servers)
Servers
Super computer
Memory Unit:
A memory unit is required to store the programs that have the set of instructions that instructs
Arithmetic and logic unit which operation has to be performed. It also stores the data associated
with the program. The memory can further be classified into three types:
Primary Memory:
Primary memory is also known as the main memory or the random-access memory (RAM). It is
the fastest accessible memory of the computer. If a program has to be executed it first needs to
be placed in the primary memory. Then the instructions of the program are fetched one at a time
by the processor for execution.
Secondary Memory:
Secondary memory is the hard disk of your system, it also includes flash drive, optical disks,
magnetic disk. The secondary memory is slower and less expensive as compared to primary
memory. It doesn’t lose its contents even if the supply of power gets off. We require secondary
memory to store a large volume of data or program permanently or the data that is less likely to
be retrieved.
The ALU unit performs the operations present in the instruction and stores the result into the
memory.
Control Unit:
The functions of input, ALU, memory, and output unit must be coordinated so that everything
goes in sequence i.e. the processor accepts input, place it in memory, processes the stored input,
and generates output. This entire sequence is coordinate by the control unit.
What is Bus?
Bus is a group of wires (or lines) that connects several devices with in a computer system. Bus is
a communication system that transfers data between components inside a computer, or between
computers. The Computer bus helps the various parts of the PC communicate. If there was no
bus, you would have an unwieldy number of wires connecting every part to every other part.
Types of Computer Bus
• Group of wire which carry data information bit from processor to peripherals and vice
versa.
• Data bus width determines the system performance (word length/ computer).
• The first standard for data bus was 32-bit, whereas newer 64-bit systems can handle
much greater amounts of data.
c. Control Bus:-
• Control bus are bidirectional that goes from peripheral to CPU and CPU to peripheral.
• Control the access to and the use of address lines and data lines.
• Control signals like memory read/write, I/O read & write etc.
• Common bus used to communication between peripheral and microprocessor. Single bus
does one transfer at a time, so only two units can actively use the bus at a given time. Bus
control lines are used to arbitrate multiple requests for use of one bus.
Multi-bus structure:
System that contains multiple buses achieve more parallelism. This leads to better performance
but an increase cost.
Multi-bus structure improves the performance but also increase cost significantly. In multi-bus
structure each of which connects subset of products.
E.g. In two bus structure one bus can, be used to fetch instruction other can be used to fetch data
required for execution.
Advantages of Multi-bus System
• Better performance
• Improves Efficiency
Disadvantages of Multi-bus System
• More costly
ADD LOC A, R0
This instruction adds the operand at memory location LOC A to the operand in a register R0 and
place the sum in to register R0. The original content of LOC A is preserved, where as those of
R0 are overwritten. This instruction requires to perform several steps, first the instruction fetch
from the memory into processor. Next, the operand at LOC A is fetch and added to the contents
of R0. Finally, the resulting sum is store in R0. In computer this two types of operations are
perform
Load LOC A, R1
Add R1, R0
First instruction transfers the content of memory location LOC A into register R1 and the second
instruction add the content of registers R1 and R0 and place the sum into R0.
Transfers between the memory and the processor are stared by sending the address of memory
location to be accessed to the memory unit and issuing the appropriate control signals. Fig.
shows the how the memory and processor can be connected. It also shows the few operational
details of the processor.
The ALU, Control unit and the processor contains a number of registers used for several
different purposes. Instruction Register (IR) holds the instruction that is currently being executed
It contains the memory address of the next instruction to be fetched for execution.
ISR save the internal state of the processor in memory before servicing the
interrupt because interrupt may alter the state of the processor.
When ISR is completed, the state of the processor is restored and the interrupted
program may continue its execution.
The Memory loads the address word into MDR. The contents are transferred to
Instruction register. The instruction is ready to be decoded & executed.
Normal execution of the program may be pre-empted if some device requires
urgent servicing.
Eg...Monitoring Device in a computer controlled industrial process may detect
a dangerous condition.
In order to deal with the situation immediately, the normal execution of the
current program may be interrupted & the device raises an interrupt signal.
The processor provides the requested service called the Interrupt Service
Routine (ISR).
ISR save the internal state of the processor in memory before servicing the
interrupt because interrupt may alter the state of the processor.
When ISR is completed, the state of the processor is restored and the interrupted
program may continue its execution.
Number Systems
• Binary number system (Base 2)
• Octal number system (Base 8)
• Decimal number system (Base 10)
• Hexadecimal number system (Base 16)
Converting from one number system to another
Words are said to have unaligned address, if they begin at an arbitrary byte address
Memory Address:
To retrieve information from memory either for one word or one byte (8bit),
addresses for each location are needed.
If length of the memory address is k bits then there are 2 k memory
address
In the little-endian assignment, the lower byte addresses are used for the rightmost bytes of the
word. Observe the word 0 in the image below the rightmost bytes of word 0 has lower byte
addresses.
SOFTWARE
• Software is a set of instructions, data or programs used to operate computers and
execute specific tasks. System Software is a collection of programs that are executed
as needed to perform function such as,
• Receiving & Interpreting user commands.
• Entering & editing application program and storing them as files in secondary Storage
devices.
• Managing the storage and retrieval of files in Secondary Storage devices.
• Running the standard application such as word processor, games, and Spreadsheets
with data supplied by the user.
• Controlling I/O units to receive input information and produce output results.
• Translating programs from source form prepared by the user into object form.
• Linking and running user-written application programs with existing standard Library
routines.
Software is of 2 types
Application program
System program
Application Program:
It is written in high level programming language(C, C++, Java, and FORTRAN). The
programmer using high level language need not know the details of machine program
instruction.
System Program: (Compiler, Text Editor, File)
Compiler:
It translates the high-level language program into the machine language program.
Text Editor:
It is used for entering & editing the application program. System software Component -> OS
(OPERATING SYSTEM)
Operating System:
It is a large program or a collection of routines that is used to control the sharing of and
interaction among various computer units.
Functions of OS:
Assign resources to individual application program.
Assign memory and magnetic disk space to program and data files.
Move the data between the memory and disk units.
Handles I/O operation.
The transfer of information from one location to another, possible locations that may be
involved in such transfers are memory locations, registers in the I/O subsystem. We
identify a location by a symbolic name.
Add R1,R2,R3 Add the contents of register R1 & R2 and places their sum
into register R3.
Type of Instruction
Type is depend on the no. of operands means how many no. of operands we are using.
Three Address
Branching:
The Address of the memory locations containing the n numbers are symbolically
given as NUM1,NUM2…..NUMn.
Separate Add instruction is used to add each number to the contents of
register R0.
After all the numbers have been added,the result is placed in memory location
SUM.
Decrement R1
It reduces the contents of R1 by 1 each time through the loop.
Conditional Codes: