You are on page 1of 50

Computer Organization and Software Systems

(SS ZG516)
BITS Pilani
K K Birla Goa Campus

Dr. Lucy J. Gudino


Dept. of CS and IS

Text and Reference Books


Prescribed Text Book (S) Stallings William, Computer Organization & Architecture, Pearson Education, 9th Ed., 2013 (T1) A. Silberschatz, Abraham and others, Operating Systems Concepts, Wiley Student Edition, 8th Edition, 2008. (T2) Reference Book (S) J. Hennessy and D. Patterson. Computer Architecture A Quantitative Approach, Morgan Kaufman, 1990. William Stallings, Operating Systems Internals and Design Principles. Prentice Hall of India, 2001.
BITS Pilani, K K Birla Goa Campus

Contd
Reference Books from 24x7 C. Madana Kumar Reddy, Operating Systems Made Easy Laxmi Publications, India, 2009 Nirmala Sharma, Computer Architecture Laxmi Publications, India, 2009

BITS Pilani, K K Birla Goa Campus

Evaluation Components
Three Evaluation Components
EC1 : Online Quiz (15%) EC2: Mid Semester Test (35%) EC3: Comprehensive Examination (50%)

BITS Pilani, K K Birla Goa Campus

BITS Pilani
K K Birla Goa Campus

Lecture 1: Introduction

Source: Most of the Slides are based on original slides of William Stallings

Contents
Computer Components Functions Interconnection Structures

BITS Pilani, K K Birla Goa Campus

Definition of a Computer
Device capable of performing computations and making logical decisions
Is a complex system
Is a programmable device Must be able to process data Must be able to store data Must be able to move data

Must be able to control above three functions

Computers process data under the control of sets of instructions called computer programs
BITS Pilani, K K Birla Goa Campus

Computer Architecture and


Organization
Architecture is those attributes visible to the programmer
Logical aspects of system as seen by the programmer. Instruction set, instruction formats, data types, number of bits used for data representation, I/O mechanisms, addressing techniques: addressing modes. e.g., Is there a multiply instruction?

Organization is how features are implemented


physical aspects of computer system. Control signals, interfaces, memory technology. e.g. Is there a hardware multiply unit or is it done by repeated addition?
BITS Pilani, K K Birla Goa Campus

Computer Architecture and Organization


Why study computer organization and architecture?
Design better programs, including system software such as compilers, operating systems, and device drivers. Optimize program behavior. Evaluate (benchmark) computer system performance. Understand time, space, and price tradeoffs.

BITS Pilani, K K Birla Goa Campus

Parts of a Computer System


Computer System

Computer Hardware

Computer Software

System Software

Application Software

BITS Pilani, K K Birla Goa Campus

Five components in every computer


Input unit
Obtains information from input devices (keyboard, mouse)

Output unit
Outputs information (to screen, to printer, to control other devices)

Memory unit
Rapid access, low capacity, stores input information

Central processing unit (CPU) ALU+ CU


Performs arithmetic calculations and logic decisions Supervises and coordinates the various components of the computer

Secondary storage unit


Cheap, long-term, high-capacity storage Stores inactive programs
BITS Pilani, K K Birla Goa Campus

Contd
CPU Input ALU Output

CU

Memory

BITS Pilani, K K Birla Goa Campus

Structure & Function


Computer is a complex system
describe it as a hierarchical system

Structure is the way in which components relate to each other Function is the operation of individual components as part of the structure

BITS Pilani, K K Birla Goa Campus

Function
Functions of Computer:
Data processing Data storage Data movement Control

BITS Pilani, K K Birla Goa Campus

Operations : Data movement


Important Terms : I/O Devices or peripherals Data communications

BITS Pilani, K K Birla Goa Campus

Operations: Storage

BITS Pilani, K K Birla Goa Campus

Operation :Processing from/to storage

BITS Pilani, K K Birla Goa Campus

Operation: Processing from storage to I/O

BITS Pilani, K K Birla Goa Campus

Structure - Top Level


Peripherals COMPUTER

Central Processing Unit


Computer

Main Memory

Systems Interconnection

Input/ Output Communication lines

19
BITS Pilani, K K Birla Goa Campus

Structure - Top Level


CPU

ALU Registers

CPU

Internal CPU Interconnection (Bus)

Control unit

20
BITS Pilani, K K Birla Goa Campus

Structure - Top Level


CONTROL UNIT

Sequencing logic

Control unit

Control unit registers and decoders

Control memory

21
BITS Pilani, K K Birla Goa Campus

Von Neumann Architecture and Harvard Architecture


Von Neumann Architecture
Stored program concept

Three key concepts:


Data and instructions are stored in a single read write memory The contents of this memory are addressable by location, without regard to the type of data contained there Execution occurs in a sequential fashion ( unless explicitly modified) from one instruction to the next
22
BITS Pilani, K K Birla Goa Campus

Contd
Stored-program computers have the following characteristics:
Three hardware systems: A central processing unit (CPU) A main memory system An I/O system The capacity to carry out sequential instruction processing. A single path between the CPU and main memory. This single path is known as the von Neumann bottleneck.

23
BITS Pilani, K K Birla Goa Campus

Non-von Neumann Models


Conventional stored-program computers have undergone many incremental improvements over the years. These improvements include adding specialized buses, floating-point units, and cache memories, to name only a few. But enormous improvements in computational power require departure from the classic von Neumann architecture. Adding processors is one approach.

24
BITS Pilani, K K Birla Goa Campus

Harvard Architecture
Uses separate memory for data and program Example: MIPS processor

BITS Pilani, K K Birla Goa Campus

What is a program?
A sequence of steps For each step, an arithmetic or logical or data movement operation is done For each operation, a different set of control signals is needed Hardwired program: process of connecting various components in the desired configuration as a form of programming
Data Sequence of arithmetic and Logic functions Results

(a) Programming in Hardware

26
BITS Pilani, K K Birla Goa Campus

Contd
Software program: Uses general purpose configuration of arithmetic and logic functions and instruction interpreter which decodes the instruction codes and generates control signals that drives general purpose hardware.
Instruction Codes

Instruction Interpreter
Control Signals General Purpose Arithmetic and Logic functions

Data

Results

(b) Programming in software

BITS Pilani, K K Birla Goa Campus

Contd
Hardwired systems are fast but inflexible Using software program general purpose hardware can do different tasks, given correct control signals Instead of re-wiring, supply a new set of control signals

BITS Pilani, K K Birla Goa Campus

Computer Components: Top Level View

29
BITS Pilani, K K Birla Goa Campus

Instruction Cycle
Two steps:
Fetch Execute

30
BITS Pilani, K K Birla Goa Campus

Fetch Cycle
Program Counter (PC) holds address of next instruction to fetch Processor fetches instruction from memory location pointed to by PC Increment PC
Unless told otherwise

Instruction loaded into Instruction Register (IR) Processor interprets instruction and performs required actions
31
BITS Pilani, K K Birla Goa Campus

Execute Cycle
Processor-memory
data transfer between CPU and main memory

Processor-I/O
Data transfer between CPU and I/O module

Data processing
Some arithmetic or logical operation on data

Control
Alteration of sequence of operations e.g. jump

Combination of above
32
BITS Pilani, K K Birla Goa Campus

Hypothetical Machine
0 Opcode 3 4 Address 15

Fig: Instruction Format


0 1 Magnitude 15

Fig: Integer Format

With 4 bits of opcode we can represent 16 different instructions With 12 bits address we can address 212 = 4096 (4K) memory locations

BITS Pilani, K K Birla Goa Campus

Hypothetical Machine
Program Counter (PC) = Address of instruction
Instruction Register (IR) = Instruction being executed Accumulator (AC) = Temporary storage

Fig: Internal CPU register

0001 = Load AC from memory


0010 = Store AC to memory 0101 = Add to AC from memory

Fig: Partial list of opcodes

BITS Pilani, K K Birla Goa Campus

Program statement
Write a program to add the contents of the memory word at address 940H to the contents of the memory word at address 941H and store the result in the location 941H

BITS Pilani, K K Birla Goa Campus

Program statement
Write a program to add the contents of the memory word at address 940H to the contents of the memory word at address 941H and store the result in the location 941H need 3 instructions:
Load AC from memory address 940H opcode is 0001 1H

Instruction : 1940H
Add to AC from memory address 941H opcode is 0101 5H

Instruction : 5941H
Store AC to memory address 941H opcode is 0010 2H

Instruction : 2941H

BITS Pilani, K K Birla Goa Campus

Example of Program Execution

37
BITS Pilani, K K Birla Goa Campus

Instruction Cycle State Diagram

38
BITS Pilani, K K Birla Goa Campus

Interrupts
Mechanism by which other modules (e.g. I/O) may interrupt normal sequence of processing Program
e.g. overflow, division by zero

Timer
Generated by internal processor timer Used in pre-emptive multi-tasking

I/O
from I/O controller

Hardware failure
e.g. memory parity error
39
BITS Pilani, K K Birla Goa Campus

Program Flow Control

40
BITS Pilani, K K Birla Goa Campus

Interrupt Cycle
Added to instruction cycle Processor checks for interrupt
Indicated by an interrupt signal

If no interrupt, fetch next instruction If interrupt pending:


Suspend execution of current program Save context Set PC to start address of interrupt handler routine Process interrupt Restore context and continue interrupted program
41
BITS Pilani, K K Birla Goa Campus

Transfer of Control via Interrupts

42
BITS Pilani, K K Birla Goa Campus

Instruction Cycle with Interrupts

43
BITS Pilani, K K Birla Goa Campus

Program Timing Short I/O Wait

44
BITS Pilani, K K Birla Goa Campus

Program Timing : Long I/O Wait

45
BITS Pilani, K K Birla Goa Campus

Instruction Cycle (with Interrupts) State Diagram

46
BITS Pilani, K K Birla Goa Campus

Multiple Interrupts
Disable interrupts
Processor will ignore further interrupts whilst processing one interrupt Interrupts remain pending and are checked after first interrupt has been processed Interrupts handled in sequence as they occur

Define priorities
Low priority interrupts can be interrupted by higher priority interrupts When higher priority interrupt has been processed, processor returns to previous interrupt
47
BITS Pilani, K K Birla Goa Campus

Multiple Interrupts - Sequential

48
BITS Pilani, K K Birla Goa Campus

Multiple Interrupts Nested

49
BITS Pilani, K K Birla Goa Campus

Time Sequence of Multiple Interrupts

50
BITS Pilani, K K Birla Goa Campus

You might also like