You are on page 1of 67

Computer Organization and

Architecture

Sumathi A
Associate Professor, ECE
BNM Institute of Technology

COA, SA,ECE,BNMIT 1
Computer
1. Computer is a fast electronic calculating
machine that accepts digitized input,
processes it as per the instructions and
produces the output.
2. List of instructions: Program
3. Internal storage: Memory

COA, SA,ECE,BNMIT 2
COA
■ Computer Architecture
– It is concerned with the way hardware components
are connected together to form a computer system.
■ Computer Organization
– It is concerned with the structure and behaviour of
a computer system as seen by the user. ...
■ A programmer can view architecture in terms of
instructions, addressing modes and registers.

While designing a computer system An organization is done on the basis of


architecture is considered first. architecture.
Computer Architecture deals with high- Computer Organization deals with low-
level design issues. level design issues.

COA, SA,ECE,BNMIT 3
Basic/Key Elements

■ Data in form of bits


■ High level language
■ Low level language
Assembly and Machine
■ Compiler
■ Interpreter
■ Assembler

COA, SA,ECE,BNMIT 4
Computer Types
Based on size, cost, computational power
and intended use (specs).
1. Personal Computers

2. Servers and Enterprise Systems

3. Supercomputers and Grid Computers

4. Embedded Computers

COA, SA,ECE,BNMIT 5
Personal computers

 Personal computers have achieved widespread use in homes,


educational institutions, and business and engineering office settings,
primarily for dedicated individual use.
 They support a variety of applications such as general computer-aided
design, audio visual entertainment, interpersonal communication,
computation, document preparation,, and Internet browsing.
COA, SA,ECE,BNMIT 6
Computer Types..
 A number of classifications are used for personal
computers.
 Desktop computers serve general needs and fit within
a typical personal workspace.
 Portable and Notebook computers provide the basic
features of a personal computer in a smaller lightweight
package.
 They can operate on batteries to provide mobility.

 Workstation computers offer higher computational


capacity and more powerful graphical display
capabilities for engineering and scientific work.
COA, SA,ECE,BNMIT 7
Servers and Enterprise Systems
 These are large computers
that are meant to be shared by
a potentially large number of
users who access them from
some form of personal
computer over a public or
private network.
 Such computers may host
large databases –server
and provide information
processing for a
government agency or a
commercial organization.
Mail server
File server
COA, SA,ECE,BNMIT 8
Supercomputers and Grid Computers

Supercomputers and Grid computers normally offer the


highest performance.
 They are the most expensive and physically the largest category of
computers.
26 supercomputers  Japanese Fugaku - June 2020
Supercomputers are used for the highly demanding
computations needed in Weather forecasting, 3D nuclear test
simulations, molecular simulation, scientific research for
outbreak
 They have a high cost.
COA, SA,ECE,BNMIT 9
COA, SA,ECE,BNMIT 10
Grid Computers
 Grid computers provide a more cost-effective
alternative.
 They combine a large number of personal
computers and disk storage units in a physically
distributed high-speed network, called a grid, which
is managed as a coordinated computing resource.

COA, SA,ECE,BNMIT 11
Grid Computers
 By evenly distributing the computational workload
across the grid, it is possible to achieve high
performance on large applications ranging from
numerical computation to information searching.

COA, SA,ECE,BNMIT 12
Embedded Computers
 Embedded computers are integrated into a
larger device or system in order to
automatically monitor and control a physical
process or environment.
 They are used for a specific purpose rather
than for general processing tasks.
 Typical applications include industrial and
home automation, appliances, mobiles,
digital camera and vehicles.
COA, SA,ECE,BNMIT 13
COA, SA,ECE,BNMIT 14
Emerging trends
■ Emerging trends
■ Cloud computing
■ Edge computing
■ Automation
■ IoT
■ Blockchain
■ Virtual Reality
■ VLSI

16

COA, SA,ECE,BNMIT 15
Functional Units

COA, SA,ECE,BNMIT 16
Functional Units

Arithmeti
Input c and
logic

Memory

Output Control

I/O Processo
r

Basic functional units of a computer.


COA, SA,ECE,BNMIT 17
Information handled by a
computer
 Instruction
 Data

COA, SA,ECE,BNMIT 18
Information handling
1. Instruction
2. Commands to perform particular task-
Program
3. Controlled by stored programs, except
few interrupts
4. Programs are stored in memory

COA, SA,ECE,BNMIT 19
Information handled by a
computer..
Data
Digital information-number-encoded characters
Data are also stored in the memory.

High level Compiler/ Low/machine level


Source program Object program
Assembler

COA, SA,ECE,BNMIT 20
Information handled by a
computer..
• Data
• It is represented in either ON or OFF state (1 or 0)
– bits
• 4 bits=1 nibble
• 8 bits=2 nibbles = 1 byte
• 16 bits=2 bytes=1 word
• Coding schemes:
• ASCII( American Standard Code for Information
Interchange) – 7 bits
• EBCDIC (Extended Binary Coded Decimal
Interchange) – 8 bits
COA, SA,ECE,BNMIT 21
Input Unit

 Computers accept coded information through input


units.
 The most common input device is the keyboard.
 Whenever a key is pressed, the corresponding letter or digit is
automatically translated into its corresponding binary code
and transmitted to the processor.
 Other kinds of input devices – mouse, joystick,
trackball,COA,
touchpad,
SA,ECE,BNMIT
microphone, camera. 22
Memory Unit
• The function of the memory unit is to store
programs and data.
• There are two types of memory
• Primary/Main

• Secondary/Auxiliary

COA, SA,ECE,BNMIT 23
Primary Storage
• Fast memory
• Semiconductor storage cells
• Word- word length
• Store and retrieve – address

COA, SA,ECE,BNMIT 24
Primary Storage
1. Random Access Memory (RAM)
2. Memory access time -> fixed -> independent of
location
1. It typically ranges from a few
nanoseconds (ns) to about 100 ns for
modern RAM units.
3. Memory Hierarchy
Caches - small, fast, tightly coupled with processor
Main memory - large, slow

30

COA, SA,ECE,BNMIT 25
Memory Unit..
 Although primary memory is essential, it
tends to be expensive and does not retain
information when power is turned off.

COA, SA,ECE,BNMIT 26
Memory Unit..
 Secondary storage is used when large amounts of data
and many programs have to be stored.
 Particularly for information that is accessed infrequently.
 Access times for secondary storage are longer than
for primary memory.
 Examples - magnetic disks, optical disks
(DVD and CD), and flash memory devices.

COA, SA,ECE,BNMIT 27
Arithmetic and Logic Unit (ALU)
1. Arithmetic and logic operations – addition,
subtraction…….comparison
2. Operands are brought to the processor.
3. Example – add two numbers
4. Stored in high speed storage elements called
Registers
5. Each register can store one word of data
6. Access time are shorter than cache unit

COA, SA,ECE,BNMIT 28
Output Unit
• Processed results to outside world
• Both input and output: touchscreen, digital
camera, pen drive.

COA, SA,ECE,BNMIT 29
Control Unit
1. CU coordinates the operation of all other units like
input, output, ALU and memory.
2. I/O transfers
3. Data transfers between memory & processor
4. Timing signals determine when action to be
performed
5. Control lines carry signals for timing and
synchronization of events in all units.

COA, SA,ECE,BNMIT 30
Control Unit..
 Much of the control circuitry is physically
distributed throughout the computer.
 A large set of control lines (wires) carries the
signals used for timing and synchronization of
events in all units.

COA, SA,ECE,BNMIT 31
Functional Units

Arithmeti
Input c and
logic

Memory

Output Control

I/O Processo
r

Basic functional units of a computer.


COA, SA,ECE,BNMIT 32
Basic Operational
Concepts

COA, SA,ECE,BNMIT 33
Basic Operational Concepts
1. Activity in a computer is controlled by
instructions.
2. Task  program  memory  individual
instruction are brought from memory to 
processor execute
Add LOCA,R0
Processor
Memory

Memory location A Register R0


+
5 (00…00000101) 4(00…000000100)
Sum
= 9(0000……01001)

COA, SA,ECE,BNMIT 34
Two instruction sequence
Add LOCA,R0

Load LOCA,R1
Add R1,R0
Processor
Memory

Memory location A R1 X 5 (00…00000101)


5 (00…00000101) R0 4 (00…000000100)
4 (00…000000100)
Sum
9(0000……01001)

COA, SA,ECE,BNMIT 35
Connection between
processor and memory
■ N general purpose registers
■ IR instruction register hold the
instruction currently being
executed
■ PC program counter-keeps
track of execution of programs
■ It points to memory location of
next instruction to be fetched
■ Memory address register
(MAR)
■ Memory Data Register (MDR)
■ Facilitate communication with
memory

COA, SA,ECE,BNMIT 36
Registers
 Instruction register (IR)
 Hold the instruction that is currently being executed
 Program counter (PC)
 Keeps track of the execution of a program
 It contains the address of the next instruction to be fetched and
executed
 General-purpose register (R0 – Rn-1)
 Memory address register (MAR)
 Holds the address of the memory location to be accessed
 Memory data register (MDR)
 Contains the data to be written into or read out of the addressed
location
COA, SA,ECE,BNMIT 37
Typical Operating Steps
• Programs reside in memory
• PC points to instruction1
• Contents of PC are transferred to
MAR
• And read signal is sent to
memory
• Address word is read out of
memory and loaded into MDR
• Contents from MDR are
transferred to IR
• Now instruction is ready to be
decoded and executed
• Now, PC increments by one and
point to instruction2
COA, SA,ECE,BNMIT 38
Operating Steps if ALU is
involved
If operation is performed by ALU, then
operands should be obtained
In addition to data
transfer between
memory and
processor, I/O
devices also transfer
data. I/O instructions

COA, SA,ECE,BNMIT 39
Interrupt

■ Normal execution of programs may be stopped


temporarily if any Urgent service from I/O device is
required.
■ The device raises an interrupt signal.
■ Processor executes interrupt-service routine

COA, SA,ECE,BNMIT 40
Interrupt

COA, SA,ECE,BNMIT 41
Interrupt

COA, SA,ECE,BNMIT 42
Bus Structures..
1. Computer has many units
and there are multiple ways
to connect them together.
2. When a word is transferred,
all the bits are transferred in
parallel over many wires,
one bit per line.
3. This group of lines is
referred as bus
COA, SA,ECE,BNMIT 43
Single Bus Structure
1. Unidirectional and bidirectional bus
1. Low cost
2. Flexible for attaching peripheral
devices
2. Multiple buses-better performance
with increased cost

COA, SA,ECE,BNMIT 44
Types of Bus

COA, SA,ECE,BNMIT 45
Speed Issue
 Different devices have different transfer/operating speed.
 Some electromechanical devices, such as keyboards and
printers, are relatively slow
 Magnetic or optical disks are considerably faster
 Memory and processor units operate at electronic speeds -
fastest
 If the speed of bus is bounded by the slowest device
connected to it, the efficiency will be very low.
 How to solve this?
1. Use buffer registers: Example Printer
2. These hold information during transfers
3. This smooth out timing difference among processor, memories and
I/O devices
COA, SA,ECE,BNMIT 46
Software
1. System software
1. Used for operating computer hardware
2. Installed when operating system is installed
2. Application software
1. User to perform specific task.
2. Installed according to user’s requirements

COA, SA,ECE,BNMIT 47
System Software
It is a collection of programs that are
executed to perform the functions:
1. Receiving and interpreting the user commands
2. Entering and editing application programs and
storing them as files in secondary storage devices
3. Secondary storage management: store and
retrieve
4. Running standard application programs: word
processors, spreadsheets with data supplied by
the user
COA, SA,ECE,BNMIT 48
System Software
It is a collection of programs that are
executed to perform the functions:
1. Controlling I/O units
2. Translating programs from source form into object
form
3. Linking and running user-written application
programs with existing standard library routines

System software is responsible for the coordination of all


activities in a computer system

COA, SA,ECE,BNMIT 49
System Software
1. Compiler
High level language to machine language
ADD LOCA, R0
2. Text editor
Entering and editing application program
3. File
A sequence of alphanumeric characters or binary data
that is stored in memory or in secondary storage.

COA, SA,ECE,BNMIT 50
Operating System
1. Large program-collection of routines
2. It controls sharing of various computer units and
their interaction
3. OS routines perform tasks like
1. Assign computer resources to individual
programs
2. Assign memory and magnetic disk space to
programs
3. Moving data between memory and disk units
4. Handling I/O operations

COA, SA,ECE,BNMIT 51
Basics of Operating System
1. Example: one processor, one disk and one printer
2. Application program  compiled  transfer object
file to memory  then execution of program starts 
part requires reading data file…..
3. Multiprogramming or multitasking

COA, SA,ECE,BNMIT 52
Performance

COA, SA,ECE,BNMIT 53
Performance
 The most important measure of the
performance a computer is how quickly it can
execute programs.
 Three factors affect performance:
 Hardware design
 Instruction set
 Compiler
 So design all the above in a coordinated way

70

COA, SA,ECE,BNMIT 54
Performance..
■ t5-t0  total time required to execute the program
■ This is elapse time, a measure of the performance
of the entire computer system
■ This is affected by speed of the processor, disk and
printer.

COA, SA,ECE,BNMIT 55
Performance..
 To discuss the performance of the processor,
we should consider only the periods during
which the processor is active.
 These are the periods labelled Program and OS
routines
 Sum of these periods is referred as the processor
time needed to execute the program.

COA, SA,ECE,BNMIT 56
Performance..
 Processor time to execute a program depends on the hardware
involved in the execution of individual machine instructions.

Main Cache
memor memor Processor
y y

Bu
s

The processor
cache.
COA, SA,ECE,BNMIT 57
Performance..
 The processor and a relatively small cache
memory can be fabricated on a single
integrated circuit chip.
 A program will be executed faster if the
movement of instructions and data between the
main memory and the processor is minimized,
which is achieved by using the cache.

COA, SA,ECE,BNMIT 58
COA, SA,ECE,BNMIT 59
Performance..
 At the start of execution, all program instructions and the
required data are stored in the main memory.
 As execution proceeds, instructions are fetched one by
one over the bus into the processor, and a copy is
placed in the cache.
 When the execution of an instruction calls for data
located in the main memory, the data are fetched and a
copy is placed in the cache.
 Later, if the same instruction or data item is needed a
second time, it is read directly from the cache.

COA, SA,ECE,BNMIT 60
Processor Clock
 Processor circuits are controlled by a timing
signal called a clock.
 The clock defines regular time intervals,
called clock cycles.
 The execution of each instruction is divided
into several steps, each of which completes in
one clock cycle.
 Length of one clock cycle is denoted as P.

COA, SA,ECE,BNMIT 61
Processor Clock..

500 million cycles per second  500Megahertz (MHz)


1250 million cycles per second  1.25Gigahetrz (GHz)
Clock periods are 2 and 0.8 nanoseconds(ns)

COA, SA,ECE,BNMIT 62
Basic Performance Equation
 T – processor time required to execute a program that has been
written in high-level language
Compiler converts source code to object code/machine language
instructions
 N – number of actual machine language instructions needed to
complete the execution (note: loop)
 S – average number of basic steps needed to execute one
machine instruction. Each step completes in one clock cycle
 R – clock rate –R cycles per second
Program execution time is given by

NS
T
R
How to improve T?

COA, SA,ECE,BNMIT 63
Basic Performance Equation

 Lesser the value of T, higher the performance.


 Reducing T means reducing N and S, and
increasing R
 The value of N is reduced if the source program is
compiled into fewer machine instructions.
 The value of S is reduced if instructions have a
smaller number of basic steps to perform or if the
execution of instructions is overlapped.
 Using a higher-frequency clock increases the value or
R, which means that the time required to complete a
basic execution step is reduced.
COA, SA,ECE,BNMIT 64
Few terminologies
■ pipelining

COA, SA,ECE,BNMIT 65
Few terminologies
■ Superscalar – parallel processing

COA, SA,ECE,BNMIT 66
Few terminologies
■ RISC and CISC architecture Kiran
Sumanth
■ Reduced Instruction Set Computing-Apple gagan
■ Complex Instruction Set Computing-Intel

COA, SA,ECE,BNMIT 67

You might also like