COMPUTER ARCHITECTURE : 3068
1 Basic Structure of Computers, Machine Instructions and Programs
1.1 Discuss the different Computer Types
Computer is a fast electronic calculating machine which accepts digital input, processes it
according to the internally stored instructions (Programs) and produces the result on the output
The computers can be classified into various categoriesas given below:
• Micro Computer
• Laptop Computer
• Work Station
• Super Computer
• Main Frame
• Hand Held
• Multi core
Micro Computer: A personal computer; designed to meet the computer needs of an individual.
It provides access to a wide variety of computing applications, such as word processing, photo
editing, e-mail, and internet.
Laptop Computer: A portable, compact computer that can run on power supply or a battery
unit. All components are integrated as one compact unit. It is generally more expensive than a
comparable desktop. It is also called a Notebook.
Work Station: Powerful desktop computer designed for specialized tasks. Generally used for
tasks that requires a lot of processing speed. Can also be an ordinary personal computer attached
to a LAN (local area network).
Super Computer: A computer that is considered to be fastest in the world. It is used to execute
tasks that would take lot of time for other computers. For Ex: Modeling weather systems, genome
Main Frame: Large expensive computer capable of simultaneously processing data for hundreds
or thousands of users. Used to store, manage, and process large amounts of data that need to be
reliable, secure, and centralized.
Hand Held: It is also called a PDA (Personal Digital Assistant). A computer that fits into a pocket,
runs on batteries, and is used while holding the unit in your hand. Typically used as an
appointment book, address book, calculator and notepad.
Multi Core: Have Multiple Cores – parallel computing platforms. It has many Cores or computing
elements in a single chip. Typical Examples: Sony Play station, Core 2 Duo, i3, i7 etc.
1.2 Explain the Functional Units of Computer
A computer in its simplest form comprises five functional units namely input unit, output unit
memory unit, arithmetic & logic unit and control unit. Figure 2 depicts the functional units of a
1. Input Unit: Computer accepts encoded information through input unit. The standard input
device is a keyboard. Whenever a key is pressed, keyboard controller sends the code to
CPU/Memory. Examples include Mouse, Joystick, Tracker ball, Light pen, Digitizer, Scanner
2. Memory Unit: Memory unit stores the program instructions (Code), data and results of
computations etc. Memory unit is classified as:
• Primary /Main Memory
• Secondary /Auxiliary Memory
Primary memory is a semiconductor memory that provides access at high speed. Run time
program instructions and operands are stored in the main memory. Main memory is classified
again as ROM and RAM. ROM holds system programs and firmware routines such as BIOS, POST,
I/O Drivers that are essential to manage the hardware of a computer. RAM is termed as
Read/Write memory or user memory that holds run time program instruction and data. While
primary storage is essential, it is volatile in nature and expensive. Additional requirement of
memory could be supplied as auxiliary memory at cheaper cost.
3. Arithmetic and logic unit: ALU consist of necessary logic circuits like adder, comparator
etc., to perform operations of addition, multiplication, comparison of two numbers etc.
4. Output Unit: Computer after computation returns the computed results, error messages, etc.
via output unit. The standard output device is a video monitor, LCD/TFT monitor. Other output
devices are printers, plotters etc.
5. Control Unit: Control unit co-ordinates activities of all units by issuing control signals. Control
signals issued by control unit govern the data transfers and then appropriate operations take
place. Control unit interprets or decides the operation/action to be performed.
The operations of a computer can be summarized as follows:
1. A set of instructions called a program reside in the main memory of computer.
2. The CPU fetches those instructions sequentially one-by-one from the main memory, decodes
them and performs the specified operation on associated data operands in ALU. 3. Processed data
and results will be displayed on an output unit.
4. All activities pertaining to processing and data movement inside the computer machine are
governed by control unit.
1.3 Explain the Basic Operational Concepts of Computers
An Instruction consists of two parts, an Operation code and operand/s as shown below:
Let us see a typical instruction ADD LOCA, R0
This instruction is an addition operation. The following are the steps to execute the instruction:
Step 1: Fetch the instruction from main memory into the processor
Step 2: Fetch the operand at location LOCA from main memory into the processor
Step 3: Add the memory operand (i.e. fetched contents of LOCA) to the contents of register R0
Step 4: Store the result (sum) in R0.
The same instruction can be realized using two instructions as
Load LOCA, R1
Add R1, R0
The steps to execute the instructions can be enumerated as below:
Step 1: Fetch the instruction from main memory into the processor
Step 2: Fetch the operand at location LOCA from main memory into the processor Register R1
Step 3: Add the content of Register R1 and the contents of register R0
Step 4: Store the result (sum) in R0
Figure below shows how the memory and the processor are connected. As shown in the diagram,
in addition to the ALU and the control circuitry, the processor contains a number of registers used
for several different purposes. The instruction register holds the instruction that is currently being
executed. The program counter keeps track of the execution of the program. It contains the
memory address of the next instruction to be fetched and executed. There are n general purpose
registers R0 to Rn-1 which can be used by the programmers during writing programs.
1.4 Introduce the Bus Structures
Group of lines that serve as connecting path for several devices is called a bus (one bit per line).
Individual parts must communicate over a communication line or path for exchanging data,
address and control information as shown in the diagram below. Printer example – processor to
printer. A common approach is to use the concept of buffer registers to hold the content during
1.5 Evaluate the Performance of Computers
1.5.1 Processor Clock
1.5.2 Basic Performance Equation
The total time required to execute a program is the most important measure of performance for a
computer. (t0-t5 of earlier example). Compiler, instruction set and hardware architecture,
program all have impact on performance.
Basic Performance Equation: The basic performance equation is given by T = (N * S) / R
where T=execution time, N=number of instructions, S=average cycles per nstruction, R=clock
rate in cycles per second
Benchmark refers to standard task used to measure how well a processor operates. To evaluate
the performance of Computers, a non-profit organization known as SPEC-System Performance
Evaluation Corporation employs agreed-upon application programs of real world for benchmarks.
Accordingly, it gives performance measure for a computer as the time required to execute a given
benchmark program. The SPEC rating is computed as follows
1.5.3 Pipelining and Superscalar Operation
Pipelining: Like a production line, instruction execution overlapped so greater parallelism is
achieved. Superscalar operation: Execute several instructions simultaneously using multiple
1.5.4 Clock Rate
Processor circuits are controlled by a timing signal called a clock. The clock defines regular time
intervals called clock cycles. The machine instructions are divided into a sequence of basic steps
and each step is completed in one clock cycle. Clock rate R=1/P, where P is the length of one
clock cycle. R is measured in cycles per second (herts-Hz).
1.5.5 Instruction set: CISC and RISC
Reduced instruction set computer
– Large N, small S
Complex instruction set computer
– Small N, large S
• Multiple length instructions are difficult to implement with high clock rate
• Complex instruction set computers (CISC) have complex instruction encodings like this (e.g.IA-
• Reduced instruction set computers (RISC) only allow simple 32-bit formats, few addressing
modes and all data to be manipulated must be in registers
e.g. Add (R3),R2 is not allowed, instead use Move (R3),R1 followed by Add R1,R2 (e.g. ARM)
RISC machines often are 3-address machines as the addressing mode field is either not necessary
or simplified e.g. Add R1, R2, R3
CISC machines usually require less instructions but have a lower clock rate, RISC require more
instructions but have a higher clock rate
1 Examples of CISC processors are the System/360(excluding the 'scientific' Model 44),
4 Motorola 68000 family
5 Intel x86 architecture based processors.
8 RISC Examples
9 •Apple iPods (custom ARM7TDMI SoC)
10 •Apple iPhone (Samsung ARM1176JZF)
11 •Palm and PocketPC PDAs and smartphones (Intel XScale family)
12 •Nintendo Game Boy Advance (ARM7)
13 •Nintendo DS (ARM7, ARM9)
14 •Sony Network Walkman (Sony in‐house ARM based chip)
15 •Some Nokia and Sony Ericsson mobile phones
The CISC approach attempts to minimize the number of instructions per program, sacrificing the
number of cycles per instruction. RISC does the opposite, reducing the cycles per instruction at
the cost of the number of instructions per program.
18 Characteristics of RISC Vs CISC processors
No RISC CISC
1 Simple instructions taking one cycle Complex instructions taking multiple
2 Instructions are executed by hardwired
Instructions are executed by
microprogramed control unit
3 Few instructions Many instructions
4 Fixed format instructions Variable format instructions
5 Few addressing mode, and most instructions
have register to register addressing mode
Many addressing modes
6 Multiple register set Single register set
7 Highly pipelined Not pipelined or less pipelined
1.5.6 Compiler - Translates high level language such as C, C++ and Java to machine
instructions. Aim is to reduce N×S. To reduce N, we need a suitable instruction set and and a
good compiler. NxS is the total clock cycle needed to execute a program.
1.6 Introduce to Multiprocessors and Multicomputers
Large computer systems contain a number of processor units and called multiprocessor
systems. They execute different applications in parallel or subtasks in parallel. All
processors can access all of the memory in the system (shared memory multiprocessor
The interconnected group of computers can be used to achieve high total computational
power. The computers have access to only their own memory. When executing the data
transferred as messages between the computers.(message passing multicomputers).
1.7 Understand the Memory Operations
• The program & data are in memory
• Instructions and operands are to be transferred from memory
• Result has to be stored into memory
• The basic operations are LOAD and STORE
• LOAD copies contents of memory to processor. Processor send the address and gives
request for reading
• STORE transfers data from processor to specific memory location. Processor send the
address and gives request for writing
1.8 Understand Instructions and Instruction Sequencing
A computer must have instruction capable of performing the following operations. They are:
• Data transfer between memory and processor register.
• Arithmetic and logical operations on data.
• Program sequencing and control.
• I/O transfer.
1.8.1 Introduce to Instruction Execution and Straight Line Sequencing
Instruction Execution: There are 2 phases for executing an instruction. They are,
• Instruction Fetch
• Instruction Execution
Instruction Fetch:The instruction is fetched from the memory location whose address is in PC.
This is then placed in IR.
Instruction Execution: Instruction in IR is examined and decoded to determine which operation
is to be performed.
Program execution Steps:
To begin executing a program, the address of first instruction must be placed in PC. The
processor control circuits use the information in the PC to fetch & execute instructions one at a
time in the order of increasing order. This is called Straight line sequencing. During the execution
of each instruction, the PC is incremented by 4 to point to the address of next instruction.
Straight line sequencing: If fetching and executing of instructions is carried out one by one from
successive addresses of memory, it is called straight line sequencing.
1.8.2 Introduce to 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.
Branch instructions are those which change the normal sequence of execution. Sequence can be
changed either conditionally or unconditionally. Accordingly we have conditional branch
instructions and unconditional branch instruction. Conditional branch instruction changes the
sequence only when certain conditions are met. Unconditional branch instruction changes the
sequence of execution irrespective of condition of the results.
1.8.3 Introduce to Condition Codes
Conditional Codes: In order to do conditional branches and other instructions, operations
implicitly set flags. Four commonly used (1-bit) flags
• N (negative) 1 if result –ve else 0
• Z (zero) 1 if result 0 else 0
• V (overflow) 1 if arithmetic overflow occurs else 0
• C (carry) 1 if carry out occurs –ve else 0
1.9 Familiarize Assembly Languages
Machine instructions are represented by patterns of 0s and 1s. To make it easy for handling, we
use symbol names to represent these patterns. Eg MOV, ADD, INC etc. Such words are called
mnemonics. A complete set of such symbolic names & rules make the programming language
called assembly language. The list rules is called syntax of the language.
The programs written in assembly language are translated into machine instructions by a
program called assembler. The source program in assembly language is called source program
and the assembled machine language program is called object program.
- We use capital letters to denote names and labels.
- The neumonic code in the instruction is called op-code.
- The values given with the op-code is called operands
The different ways in which the location of an operand is specified in an instruction is called as
Generic Addressing Modes:
• Immediate mode
• Register mode
• Absolute mode
• Indirect mode
• Index mode
• Base with index
• Base with index and offset
• Relative mode
• Auto-increment mode
• Auto-decrement mode
We generally use symbolic names to write a program. A complete set of such symbolic names
and rules for their use constitute a programming language, is referred to as assembly language.
LOAD - To load operand from memory
STORE - To store operand to memory
MOVE - To transfer data from one location to another location/Register
1.9.1 Introduce to Assembler Directives
Assembler Directives: Directives are the assembler commands to the assembler concerning the
program being assembled. These commands are neither translated into machine opcode nor
assigned any memory location in the object program.
S EQU 150
EQU directs the assembler that the symbolic name S must be replaced with memory location
Instruct assembler to initiate data block at main memory locations starting from 201
N DATAWORD 40 Inform the assembler that value of N i.e. data value 40 is to be placed in the
memory location 201.
States that assembler directive must load machine instructions of the object program in the main
memory starting from location 100.
End of the program and the label of where program starts
N1 RESERVE 400
Reserve memory block of 400 bytes
1.9.2 Understand Assembly and Execution of Programs
1.9.3 Introduce to Number Notation
1.10 Study the Basic Input/Output Operations
I/O is the means by which data are transferred between the processor and the outside world.
Devices operate at different speeds to the processor so handshaking is required.
Keyboard/display Example: The keyboard and display are coordinated via software
• Register (on device) assigned to the keyboard hardware
– DATAIN contains ASCII of last typed character
– SIN is the status control flag, normally 0. When a character typed, becomes 1. After the
processor reads DATAIN, it is automatically set back to 0
• Register (on device) assigned to the display hardware
– DATAOUT receives a character code
– SOUT is the status control flag. It is 1 when ready to receive a character, set to 0 when
the character is being transferred
• These registers form the respective device interface