Computer Organisation
Computer Organisation
WOMEN
(Autonomous Institution-UGC, Govt. of India)
Accredited by NBA & NAAC with ‘A’ Grade, UGC, Govt. of India NIRF Indian
Ranking–2018, Accepted by MHRD, Govt. of India
COMPUTER ORGANIZATION AND
OPERATING SYSTEMS
Mr.K.Raghavendra
Associate Professor, ECE Dept.
UNIT – I
3
UNIT - I
Basic Structure of Computers
Computer Types, Functional unit, Basic Operational Concepts, Bus structures,
Software performance, Multiprocessors and Multi Computers, Data Representation,
Fixed Point Representation, Floating - Point Representation.
Memory
Reference Instructions, Input - Output and Interrupt, STACK Organization, Instruction
Formats, Addressing Modes, DATA Transfer and Manipulation, Program Control,
Reduced Instruction Set Computer.
4
INTRODUCTION
5
What is Computer?
Organize -
o Arranging the things in a systemically or in an
order.
Organization –
o One or a group of people working with a
particular purpose.
Computer Organization –
o Software, Hardware and User.
7
Internal operations in Computer
8
What is Computer organization?
9
Types of Computers
10
Types of Computers
Types of Computers
Size and
Capacity Purpose
11
Computer classification based on size and capacity
Super
Embedded
Computers
Computers
Mainframe Micro
Mini Computers
Computers Computers
12
Computer classification based on data handling
13
μPs
Sequential Parallel
Computers Computers
14
Computer classification based on Users
15
Computer classification based on Purpose
General Specific
Computers Computers
16
Computer
Definition
17
Computer Definition
18
Computer Definition
19
Computer Definition
20
Computer Definition
21
FUNCTIONAL
UNIT
22
Functional unit
Arithmetic
INPUT and Logic
OUTPUT Control
23
Information Handelled by a Computer
Information – Instruction or Data.
Instructions – Commands
• Govern the transfer of information within a computer as
well as between the computer and its I/O devices .
• Specify the arithmetic and logic operations to be
performed.
Program – set of instructions that performs a task.
• Stored in memory
• One instruction is fetched and processed by processor
24
Information Handelled by a Computer
25
Functional unit - Input Unit
o Accepts the coded information.
o Reads the data.
o On pressing a key - Converts external world data to a
binary form.
o Examples:
26
Functional unit - Output Unit
o Counterpart of input unit.
o Sends the processed result.
o Converts binary format to a external world data.
o Examples:
27
Functional unit - Arithmetic and Logic Unit
o Executes most operations.
o Performs – Arithmetic and Logical
o Arithmetic operations: Addition, subtraction,
multiplication, division
o Logical operations: OR, AND, NOT, <, >, = etc.
o Instruction execution : Operands are brought into ALU
from memory.
o Stored in registers.
o Operation is performed in ALU.
o Result is stored in memory or retained in processor.
28
Functional unit – Control Unit
o Controls all Operations.
29
Functional unit - Memory Unit
o Stores – Programs and Data
o Computer memory types –
o Primary memory (Main memory)
o Secondary memory (Auxiliary memory)
30
Functional unit – Memory- Primary
o Also called main memory.
o Fast and exclusively associated with Processor and
operates at electronic speed.
o Stores programs and their data while there are being
executed.
o Semiconductor memory that access at high speed.
o Large number of storage cells (one cell – one bit)
o Cells are processed in a group of fixed size – WORD.
o Each word is associated with address.
o Word length – number of bits in each word.
31
Functional unit – Memory- Primary
o Primary memory – RAM and ROM.
RAM (DRAM)-
o Any location can be accessed in a short and fixed time.
o Volatile memory ( temporary).
o Holds programs while they are running.
ROM -
o Readable only and can’t be altered.
o Non-volatile memory (Permanent).
o System Programs and firmware routines ( BIOS, I/O
drives, etc.). 32
Functional unit – Memory- Secondary
o Also called Auxiliary memory.
o Stores large amount of data and programs.
o Stores infrequently accessed information.
o Non-Volatile memory ( Permanent).
o Cheaper, Greater storage capacity.
o Slower than primary memory.
o Not directly accessed by Processor.
o Examples – CD, DVD, Hard Disk Optical disk, USB
storage etc.
33
Basic Operational Concepts
34
Basic Operational Concepts
o Computer is governed by instructions.
ADD LOCA, R0
The execution steps:
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. 36
Basic Operational Concepts
The same instruction can be realized using two instructions
to improve the performance as
Load LOCA, R 1 // M[LOCA] R1
Add R1, R0 // R0 + R1 R0
The execution steps:
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. 37
Connections between the Processor and the Memory
38
Instruction Register - IR
o Contains/Holds the instruction that is being executed.
o Its contents are available with the control unit which
generates the timing signals that controls the various
processing elements in one execution of instruction.
o The control unit decodes the current instruction to be
executed.
o After decoding, execution of the instruction will take
place. 39
Program Counter - PC
o Contains the memory address of the instruction to be
executed.
o During execution, the contents of the PC are updated
to point to the next instruction.
o Every time that an instruction is to be executed, the
program counter releases its contents to the internal
bus and sends it to the memory address register.
40
Memory Address Register - MAR
o Holds the address of the location to or from which data
are to be transferred.
o The connection of the MAR to the main memory is one-
way or unidirectional.
41
Memory Data Register - MDR
o Contains the data to be written or read out of the
addressed location.
o During the fetch operation, the MDR contains the
instruction to be executed or data needed during
execution.
o In write operation, MDR the data to be written into the
main memory.
42
Typical Operating Steps:
1. Programs reside in the memory through the input unit.
2. Execution of the program starts when, the PC is set to point at
the first instruction of the program.
3. The contents of the PC are transferred to MAR and a READ
control signal is sent to the memory.
4. The instruction is read out (fetched) of the memory and loaded
into the MDR.
5. The contents of MDR are transferred to the IR.
6. The instruction in IR is decoded.
43
Typical Operating Steps:
7. If the instruction involves an ALU operations, it obtains the
required operands.
8. If an operand is in the GPRs, it is transferred to the ALU for
operation.
9. If an operand is in the memory, it id fetched by sending its
address to MAR and initiating a READ cycle.
10. When operands has been read from the memory into the MDR, it
is transferred from MDR to the ALU.
44
Typical Operating Steps:
11. When all operands are available, the ALU preforms the desired
operation.
12. Results are stored back to GPRs or memory.
13. If the result of this operation is to be stored in the memory, the
results is sent to MDR.
14. Address of location where the result has to be stored is sent to
MAR and a WRITE cycle is initiated.
45
Bus Structure
46
What is Bus?
o A Bus is a collection of wires/lines that
connects several devices.
o Each wire/line carries one bit of information.
o Buses are used to send address, data and
control signals between the processor and
other components.
o This is to achieve a reasonable speed of
operation.
o In computer system all the peripherals are
connected to microprocessor through Bus.
47
Buses: Connecting I/O to Processor and
Memory
48
Types of Buses
Three types
o Address Bus
o Data Bus
o Control Bus
System
Bus
o Uni-directional
o Carries the memory address from processor
to peripherals.
o Address bus carry I/O port address or device
address from I/O port.
o Address bus width determines the maximum
memory capacity.
o With n address line 2n memory location. 50
Data Bus
o Bi-directional.
51
Control Bus
o Bi-directional.
52
Types of Control Signals:
Memory Read: Issued by the CPU or DMA controller
when performing a read operation with the memory.
Memory Write: Issued by the CPU or DMA controller
when performing a write operation with the memory.
I/O Read: Issued by the CPU when it is reading from
an input port.
I/O Write: Issued by the CPU when writing into an
output port.
Ready: Issued to the CPU to synchronize the slow
memory or I/O ports with the fast CPU.
53
Types of Buses
54
Types of Bus Structures
55
Single Bus Structure
Disadvantages
o Occurrence of any fault occur affects all the elements
of the system.
o Low Performance – devices vary in speed of
operation.
57
Multi Bus Structure
o One bus is used to fetch
instruction.
o While other is used to
fetch data, required for
execution.
o It is to overcome the
bottleneck of single bus
o Contains multiple buses
– more Parallelism.
o Improves performance
and also increases cost.
58
Software
59
Software System
61
User program and OS routine sharing of the processor
Transfer data
OS loads file from disk
application and prints the
program results.
from disk.
63
Performance
o Measures of how fast a computer can execute
a program.
o Factors affecting performance:
Design of the computer’s hardware.
Machine language instruction set.
Compiler.
o Performance is increased by the coordination
between the three factors.
64
Performance
o Elapsed Time : t0 – t5.
o Affected by speed of –
Processor
Disk
Printer
o Measures performance of the computer system.
o Depends on all of the units.
65
Performance – Processor time
o Processor performance – Processor time.
o Period during which the processor is active –
(Program and OS routine)
o To increase “performance” – minimized
“processor time”
o Depends on the hardware involved in the
execution of the machine instructions.
66
Performance – Processor time
o Processor time depends –
71
Basic Performance Equation
72
Pipelining and Superscalar Operation
Non-Pipelined Architecture
Pipelined Architecture
77
Multiprocessors & Multicomputers
78
Multiprocessors
79
Multiprocessors
80
Multiprocessors
o A system with two or more CPUs or processors.
o Can execute tasks at the same time.
o Failure in one processor will not affect the tasks of the other
processors - more reliable.
o Two types –
Shared memory multiprocessor –
▪ all the CPUs shares the common memory.
▪ processors communicate with each other by reading and
writing to the memory.
Distributed memory multiprocessor –
▪ every CPU has its own private memory.
▪ If the required data is not available in the private memory, the
processor communicates with the main memory or the other
processors via the bus. 81
Multicomputers
Message Passing
Interconnect Network
82
Multicoumpters
o A system with multiple processors that are connected together to
solve a problem.
o Each processor has its own memory and it is accessible only by
that particular processor.
o The processors can communicate with each other via an
interconnection network.
o A task is divided between processors.
o Processors communicate with each other by passing messages
between them.
83
Difference
84
Data Representation
85
Information
Interpretation of information handled by computer –
Data Representation.
86
Fixed point Representation
o A positive and negative integer number.
o With the help of fixed number representation –
data is converted into binary form
data is processed
Stored
used by the system.
o Also known as Integer Number Representation.
87
Fixed point Representation
Range : For n bits
-2n-1 to + (2n-1-1)
89
Signed Representation – Sign & Magnitude
o Uses most significant bit of the word to represent the sign.
0 - Positive
1 - Negative.
MSB LSB
o Rest of the number is encoded in magnitude part.
o Examples :
+37 = 00100101
-37 = 10100101
+6712 = 00011010 00111000
-6712 = 10011010 00111000
90
Signed Representation – 1’s Complement
o Negative number is stored as bit-wise complement of
corresponding positive number.
o Leftmost bit of positive number is 0 and negative number is
1.
o +196 = 00000000 11000100
o -196 = 11111111 00111011
o Arithmetic is easier than sign-magnitude.
o Two representations for zero:
+0 = 00000000 00000000
-0 = 11111111 11111111 91
Signed Representation – 2’s Complement
o Negative number obtained by taking 1's Complement of
positive number and adding 1.
o +0 = 00000000 00000000
o -0 = 00000000 00000000
92
Floating point Representation
o Can represent a very large positive and
negative numbers. As well as zero.
o Example: 1.23 × 1088
1.23 × 10-88
-1.23 × 1088
-1.23 × 10-88
o Typically expressed in the scientific notation,
with a fraction (m) also known as mantissa,
and an exponent (e) of a certain radix (r), in
the form of m × re . 93
Floating point Representation
o In computers, floating-point numbers are
represented with a radix of 2, in the form
of M×2^E'.
o Both E and m can be positive as well as
negative.
o Modern computers adopt IEEE 754 standard
for representing floating-point numbers.
o There are two representation schemes:
32-bit single-precision
64-bit double-precision.
94
IEEE-754 32-bit Single-Precision Floating-Point Numbers
o The most significant bit is the sign bit (S), with 0 for
positive numbers and 1 for negative numbers.
o The following 8 bits represent Biased Exponent (E').
o The remaining 23 bits represents fraction or
mantissa (m or M).
95
IEEE-754 64-bit Double-Precision Floating-Point Numbers
o The most significant bit is the sign bit (S), with 0 for
positive numbers and 1 for negative numbers.
o The following 11 bits represent Biased Exponent (E').
o The remaining 52 bits represents fraction or
mantissa (m or M).
96