Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 76

COMPUTER ORGANIZATION

AND ARCHITECTURE
CHAPTER 1
Mr. Rajab Muhammad Ssemwogerere
0784410986 / 0705064320
rajabhovah@gmail.com
Ssemwogerere.rajab@kc.iuiu.ac.ug

©2018 Comp Organization and Architecture By Rajab Ssemwogerere - 0705064320


Introduction

 The course is about the structure and


functions of modern day computers.

 Challenging task because:


• There are so many computer products.
• Computer technology is changing fast.
 The course will describe general
principles of computer architecture that
apply to computers of any category.
©2018 Comp Organization and Architecture By Rajab Ssemwogerere - 0705064320
COMPUTER ARCHITECURE

 The structure, design and behavior of the


various functional modules of the computer and
how they interact to provide the processing
needs of the user.

 Architectural attributes include:


 Instruction set (the complete set of all the instructions in machine
code that can be recognized and executed by a central processing unit.)

 Number of bits used


 I/O mechanisms
 Addressing Techniques
 etc. ©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
Computer Organisation
 The way the hardware components are
connected together to form a computer
system.

 Organisational attributes include hardware


details visible to the user e.g. the interfaces,
memory technology.

N.B. A number of manufacturers offer many different


computer models (organizations) but all having the
same architecture and thus differing in costs.
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
WHY STUDY COMPUTER
ORGANIZATION AND ARCHITECTURE
 To understand the computer’s functional components,
their characteristics, their performance and their
interactions.

 Computer architecture helps to structure programs that


can run more efficiently on a real machine (CPU speed,
memory etc)

 To know the most cost effective computer for use in an


organization.

 Computer architecture concepts are needed in other


courses e.g. (programming, and and
©2018 Comp Organisation operating Systems)
Architecture By Rajab Ssemwogerere -
0705064320
Basic
Basic activities
activities of
of aa
computer
computer system
system

Input Processing Output

FEEDBACK

6
6
Input and Output Devices

 Input devices accept data and instructions from the user


or from another computer system. The keyboard and
mouse are examples of input devices.

 Output devices return processed data back to the user or


to another computer system. The printer and monitor are
examples.

 Communications devices (such as modems and network


interface cards) perform both input and output, allowing
computers to share information.

08/22/2020 Computer Systems 7


08/22/2020 Computer Systems 8
Storage Devices

 Storage devices hold data not currently being used by


the CPU. Data is commonly stored on a magnetic or
optical disk. Each type uses a special medium for
storing data on its surface.

 A disk drive is a device that reads data from and writes


data to a disk. Most new computers feature a floppy
disk drive, a hard disk drive, and an optical disk drive.

 The most common optical storage devices are CD-ROM


and DVD-ROM drives.

08/22/2020 Computer Systems 9


08/22/2020 Computer Systems 10
Computer Functions

 Process data or manipulation i.e sorting of a


list, arithmetic operations among others.

 Store data

 Move the data between the different


computer components and the external
world

 To control all the above operations


©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
• Memory: The area of a computer that
temporarily holds data that is waiting to be
processed, stored or out put.

©2018 Comp Organisation and


Architecture By Rajab Ssemwogerere -
0705064320
The CPU

The procedure that The processor


transforms raw data is also called
into useful information the central
is called processing. processing unit
This function is divided (CPU). It
between the computer's manages all
processor and memory. devices and
performs the
actual
processing of
data.

The CPU consists of one or more chips attached to the


computer's main circuit board (the motherboard).
08/22/2020 Computer Systems 13
Classification of Memory
• Primary Memory: This holds the software programs and
data during the processing.
It stores the resulting information or output before being
sent to output or secondary storage devices. It includes
ROM and RAM.
-ROM: Forms a small portion of main storage and is used
to store only vital data and programs. The contents of
ROM are set during manufacture and can not be altered.
-RAM: Forms the major portion of main storage. It is
volatile. meaning it holds data
– only when the power is on. When the power
– is off, RAM's contents are lost.
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
Classification of Memory
• Secondary Memory: It is relatively long term,
non volatile storage of data.

Examples include;
-Hard disks
-Flash Disks
-CDs
-DVDs(Digital Versatile Disc)
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
Functions of a computer
1. Accepting Instructions & data from the user.
2. Performing various arithmetic and Logical
operations as per Instructions given.
3. Presenting the Information or Output to the
user

©2018 Comp Organisation and


Architecture By Rajab Ssemwogerere -
0705064320
LOGICAL
ARCHITECTURE OF A
COMPUTER

17
 The Von Neumann Architecture
 A Micro Computer System
 Memory
 System Bus
 Language Translators

18
What is a computer architecture?
Computer Architecture specifies:
The structure and organization of the physical and
logical relations between parts of a computer system.
It shows the relations between the CPU, Memory, input
and output systems and interconnecting structures (bus
systems)
For example, at a high level, computer architecture
may be concerned with how the central processing
unit (CPU) acts and how it uses computer memory

19
20
Von Neumann Model
 Computers vary in size, cost and performance but several
general purpose computers are based on the “Von Neumann
Model” proposed in 1946 by John Von Neumann.
 The model presents the concept of a stored program(set of
instructions that describe the steps involved to carry out a
computational task).
 A Program is stored in memory with any data upon which
instructions operate.
 For the program to run, the Control Unit (a part of the CPU)
repeatedly fetches, interprets and (ALU part) executes the
instructions one after the other in a sequential manner.

21
 Execution phase involves fetching data, altering it in some
way and writing it back to memory.
 This requires that an instruction in a program should specify
both the operation and the memory address or location of any
data required during operation.
 ALU (Arithmetic Logic Unit) performs operations like
addition, subtraction etc.
 I/O devices transfer information to and from memory.
 Various control lines are used by the control unit to sequence
transfers and enforce orderly movement of data and
instructions in the system.

22
Structure of Von Neumann Architecture

23
Structure of Von Neumann Architecture

24
 The Von Neumann Model is a Model which shows the flow of
DATA and CONTROL between the various elements needed in
a generic architecture.
Defines main parts of the machine i.e.:
1. Memory: for storage for instructions (programs), data and
results.
2. Arithmetic Logic Unit: for performing calculations.
3. Control Unit: Interpreting instructions, Issuing commands
and controls the ALU
4. Input Device: provides instructions and data to programs
5. Output Device: Where results of operations are sent to.

25
A Micro Computer System
 Several electronic components are mounted on the
motherboard
 They are connected by conducting tracks for carrying electrical
signals between them
 Digital Signals;- carry information in digital form.
 Most electronic components are in the form of ICs (Integrated
Circuits) which are circuits built from small slices or chips of
the semiconductor material (silicon)
 One of the largest and most complex IC on the motherboard is
the microprocessor.

26
 CPU contains several electronic switches called transistors
organized in form of logic gates (logic gates to be discussed
later).
 Logic gates are used to implement control unit, ALU and the
register set (CPU components)
 Two types of memory exist on the printed circuit board i.e.:
1. RAM (Read-Write Memory):
It is good for storing programs and data. But it is volatile(loses
contents when power is off).
2. ROM (Read Only Memory):
Non volatile, and used to store system programs and data required
to be available when the computer is first switched on.

27
 But why is ROM not suitable for storing user
programs?
 Programs are stored on disk as files and must be
loaded (written) into main memory before
execution by the CPU.

28
The System Bus
 The CPU is connected to memory and other parts of a
computer by a group of conducting tracks called System Bus
 System bus provides a pathway for exchange of data and
control information.
 System bus is divided into 3 parts;
 Address Bus – Where is the information going?
 Control Bus – How is it sent?
 Data Bus – The actual content.
 To coordinate activities taking place inside the processor, with
those taking place on the system bus, some form of timing is
required.
 This timing is provided by a crystal controlled IC.

29
 Peripheral devices have a much slower speed than the CPU
and therefore require special interface chips for connecting
them to the system bus.

Connecting the CPU to the other components

30
 Not all elements of Von Neumann's are needed, thus
three sub-units:
 CPU (ALU, Control, Registers) - Combined into
one unit
 I/O Devices
 Memory

31
System Bus Model
ADDRESS DATA

CONTROL

Control

ALU

Registers

I/O
Devices

Memory

32
Three types of Buses & their functions
1. Data Bus
 Data transfer
 The data bus can be a very busy pathway
2. Address Bus
 Where is the information to be sent
3. Control Bus
 Used to send out signals to coordinate and manage the
activities of the motherboard components.

33
COMPUTER STRUCTURE

©2018 Comp Organisation and


Architecture By Rajab Ssemwogerere -
0705064320
The microprocessor (CPU)
 Decodes instructions and use them to
control the activities within the system

 It also performs the arithmetic( + , -, /, *)


and logical (>,>=,<,<=, =, =!)
computations.

Memory
 Stores both data and instructions that
are currently being used.
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
I/O Subsystem:
Moves data between the computer and
external environment. It consists of devices
for :
 Communicating with the external world
(I/O Devices)

 Storing large quantities of information


(mass storage devices or secondary
memory)
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
Interfaces
Circuitry needed to connect the bus to a device.

Memory interfaces
 Decode the address of the memory location being
accessed.
 Buffer data onto/off the bus.
 Contain circuitry to perform memory reads or write.

I/O interfaces
 Buffer data onto/off the system bus
 Receive commands from the CPU
 Transmit information©2018 Comp Organisation and
from
Architecture their
By Rajab devices
Ssemwogerere - to the CPU.
0705064320
COMPUTER STRUCTURE
Two arrangements of these components can be
described:
 The single bus / Single processor
architecture: one processing element and all
the other components are connected to a single
link (the System Bus)

 The Multiprocessing System: has several


processing elements surrounded by different
subsystems and a central link (the system bus)
connecting the different subsystems together.
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
Single Bus / Single Processor

©2018 Comp Organisation and


Architecture By Rajab Ssemwogerere -
0705064320
Multi Processing System

©2018 Comp Organisation and


Architecture By Rajab Ssemwogerere -
0705064320
Multi Processing System
 The links in the subsystems are called local buses.

 Each subsystem operates as an independent computer


but can take advantage of the shared resources.

 The shared main memory can be used for passing


information between subsystems

 The shared mass storage can be used to store large


programs and large quantities of data that are needed
by more than one subsystem.

 The competition for the shared resources by the


different elements is called contention.
©2018 Comp Organisation and
Architecture By Rajab Ssemwogerere -
0705064320
CENTRAL PROCESSING
UNIT
The Central Processing Unit (CPU)
Control Unit, Registers, Arithmetic Logic Unit
Processor-Memory Interconnection
Fetching Instructions
Instruction Format
Executing Instructions
The Fetch and Execute Cycle
CISC Characteristics
RISC Architectures
Pipelining
The Central Processing Unit
o Hardware within a computer that carries out
the instructions of a computer program by
performing the basic arithmetical, logical,
and input/output operations of the system
o Also referred to as a central processor unit
o The term has been in use in the computer
industry at least since the early 1960s
o  Form, design, and implementation of CPUs
have changed over the course of their history,
but their fundamental operation remains much
the same
08/22/2020 CPU 45
Most of the computer’s work is done with
integrated circuit chips such as the CPU.
The CPU is the part of the computer that does the
"thinking“ referred to as the “Brain” of the PC.
CPU runs a program by repeatedly fetching
instructions from main memory.
Components of CPU:
 Arithmetic and Logic Unit (ALU).
 Registers.
 Internal connections (buses).
 Control Unit.
Read about the History of the CPU
08/22/2020 CPU 46
Arithmetic and Logic Unit (ALU)

o The part of a computer processor (CPU) that carries


out arithmetic and logic operations 
o  The ALU is divided into two units, an arithmetic unit
(AU) and a logic unit (LU)
o The AU performs the arithmetic operations and the
LU performs the logical operations
o The processors found inside modern CPUs and
graphics processing units (GPUs) accommodate very
powerful and very complex ALUs, a single
component may contain a number of ALUs
08/22/2020 CPU 47
Registers

 A processor register is a local storage space on a


processor that holds data that is being processed
by CPU.
 Processor registers generally occupy the top-
most position in the memory hierarchy, providing
high-speed storage space and fast access to data.
 A register may include the address of the
memory location instead of the real data itself

08/22/2020 CPU 48
There are 4 main types of registers:
1. Memory Address Register
(MAR)
2. Memory Buffer Register (MBR)
3. Instruction Register (IR)
4. Program counter (PC)

08/22/2020 CPU 49
1. Memory Address Register (MAR)
 This register holds the memory addresses of data and
instructions.
 This register is used to access data and instructions
from memory during the execution phase of an
instruction. 
 Suppose CPU wants to store some data in the
memory or to read the data from the memory.
 It places the address of the-required memory location
in the MAR
08/22/2020 CPU 50
2. Memory Buffer Register (MBR)
This register holds the contents of data or
instruction read from, or written in memory.
It means that this register is used to store
data/instruction coming from the memory or
going to the memory.

08/22/2020 CPU 51
3. Instruction Register (IR)
 Is the part of a CPU's control unit that stores
the instruction currently being executed or
decoded.
 In simple processors each instruction to be
executed is loaded into the instruction register
which holds it while it is decoded, prepared
and ultimately executed, which can take
several steps.
08/22/2020 CPU 52
4. Program counter (PC)
 A program counter is a register in a
computer processor that contains the address (location)
of the instruction being executed at the current time.
 As each instruction gets fetched, the program counter
increases its stored value by 1.
 After each instruction is fetched, the program counter
points to the next instruction in the sequence.
 When the computer restarts or is reset, the program
counter normally reverts to 0

08/22/2020 CPU 53
Control unit
 Is responsible for controlling much of the operation of the
rest of the processor.
 It does this by issuing control signals to the other areas of
the processor, instructing them on what should be
performed next
 A control unit works by gathering input through a series of
commands it receives from instructions in a running
programs
 Outputs those commands into control signals that the
computer and other hardware attached to the computer
carry out.
08/22/2020 CPU 54
Processor - Memory Interconnection
CPU is connected to main memory by data,
address and control bus.
A program consists of a series of instructions or
actions that the processor should carryout.
 Actions are performed on data
 Instructions and data are stored in main
memory during program execution.
 Instructions and data occupy various memory
locations, each with a unique location
08/22/2020 CPU 55
08/22/2020 CPU 56
What happens when instructions are
fetched from the memory by the
cpu?
CISC and RISC Characteristics
The CPU executes a program, which is a sequence of
stored instructions.
Each model of processor has an instruction set, which
it executes.
The CPU executes the program by processing each
piece of data as directed by the program and the
instruction set.
While the CPU is executing one step of the program,
the remaining instructions and the data are stored
nearby in a special memory called cache.
However, there are two major CPU architectures
related to instruction sets, that is CISC and RISC
Complex Instruction Set Computer (CISC)

 Is a microprocessor instruction set architecture (ISA)


in which each instruction can indicate several low-
level operations, such as a load from memory, an
arithmetic operation, and a memory store, all in a
single instruction.
 A CISC microprocessor contains a more complex set
of instructions that it responds to.
 The complexity of some of these instructions means
that the operation cannot be completed in one
machine cycle.
 After an instruction has been decoded on a CISC
processor, the actual implementation may require up
to 10 or 12 machine cycles dependent upon the
instruction and the addressing mode.
 The Intel 80x86 processors are the most common
CISC devices.
 Therefore, these architectures use a broad set of
instructions, resulting in fewer steps per operation.
Advantages of CISC
As each instruction became more
capable, fewer instructions could be used to
implement a given task. This made more
efficient use of the relatively slow main
memory
 Supports higher-level languages
 Fewer calls to main memory
 Less RAM needed
Disadvantages of CISC
 Greater overhead in decoding instructions, therefore
slowdown of execution
 Higher power consumption
 Designing the chips requires more work
Reduced Instruction Set Computer (RISC)
 A type of microprocessor design that focuses on rapid
and efficient processing of a relatively small set of
instructions.
 A processor that uses a simplified set of internal
operating instructions to speed execution
 RISC design is based on the premise that most of the
instructions a computer decodes and executes are
simple.
 As a result, RISC architecture limits the number of
instructions that are built into the microprocessor but
optimizes each so it can be carried out very rapidly
usually within a single clock cycle.
 RISC chips thus execute simple instructions faster
than microprocessors designed to handle a much
wider array of instructions.
 Families of RISC chips that are gaining popularity
include Sun Microsystems' SPARC, Motorola's
PowerPC, Digital Equipment Corporation's Alpha,
and MIPS R4000 and R4400.
 Therefore, these architectures use a relatively small
set of instructions, and RISC chips are designed to
execute these instructions very rapidly.
Advantages of RISC
1. Speed
Since a simplified instruction set allows for a pipelined
,superscalar design RISC processors often achieve 2 to 4
times the performance of the CISC processors using
comparable semiconductor technology and the same rates.
2. Simpler hardware
Because of the instruction set of the RISC processor is
simple, it uses up much less chip space, extra functions
such as memory management units or floating point
arithmetic units can also be placed on the same chip.
3. Shorter design cycle
Since RISC Processors are simpler than
corresponding CISC processors, they can be
designed more quickly and can take advantage
of other technological developments sooner
than corresponding CISC design, leading to
greater leaps in performance between
generations.
Disadvantages of RISC
1. Code Quality: The performance of a RISC processor
depends greatly on the code that it is executing.
If the programmer (or compiler) does a poor job of
instruction scheduling, the processor can spend quite a bit
of time stalling: waiting for the result of one instruction
before it can proceed with a subsequent instruction
2. Debugging: Unfortunately, instruction scheduling can
make debugging difficult.
If scheduling (and other optimizations) are turned off, the
machine-language instructions show a clear connection
with their corresponding lines of source
3. Code expansion
Since CISC machines perform complex actions with a
single instruction, where RISC machines may require
multiple instructions for the same action,
code expansion can be a problem.
4. System Design
 RISC machines require very fast memory systems to
feed them instructions.
RISC-based systems typically contain large memory
caches, usually on the chip itself
Important to Note About the CPU
Some CPUs incorporate hyperthreading to
enhance the performance of the CPU.
With hyperthreading, the CPU has multiple
pieces of code being executed simultaneously
on each pipeline.
To an operating system, a single CPU with
hyperthreading appears to be two CPUs.
The power of a CPU is measured by the speed
and the amount of data that it can process.
The speed of a CPU is rated in cycles per second.
 The speed of current CPUs is measured in millions of
cycles per second, called megahertz (MHz), or billions
of cycles per second, called gigahertz (GHz).
The amount of data that a CPU can process at the
one time depends on the size of the processor data
bus.
 This is also called the CPU bus or the front side bus
(FSB). The wider the processor data bus width, the more
powerful the processor is.
Current processors have a 32-bit or a 64-bit
processor data bus.
Single Core CPU – One core inside a single
CPU chip that handles all of the processing
capability.
 A motherboard manufacturer may provide sockets
for more than one single processor, providing the
ability to build a powerful, multi-processor
computer.
Dual Core CPU – Two cores inside a single
CPU chip in which both cores can process
information at the same time.
Pipelining
An instruction pipeline is a technology used on
microprocessors to enhance their performance.
Similar to the concept of the output of a program being
used as an input data stream for another program.
Pipelining improves system performance by allowing
the CPU to begin executing a second instruction before
the first is completed.
A pipeline is the continuous and somewhat overlapped
movement of instruction to the processor or in the
arithmetic steps taken by the processor to perform an
instruction.
Without a pipeline, a computer processor gets the
first instruction from memory, performs the
operation it calls for, and then goes to get the next
instruction from memory, and so forth.
 While fetching (getting) the instruction, the
arithmetic part of the processor is idle.
 It must wait until it gets the next instruction.
With pipelining, the computer architecture allows
the next instructions to be fetched while the
processor is performing arithmetic operations,
holding them in a buffer close to the processor until
each instruction operation can be performed.
The staging of instruction fetching is
continuous.
The result is an increase in the number of
instructions that can be performed during a
given time period.
COURSE WORK
Write some notes on the following:
a) How a processor fetches instructions from the
memory
b) Instruction Format of a processor
c) How does a processor execute instructions
d) The Fetch and Execute Cycle of a processor

To be submitted on 28th/01/19
NB: Should be written on a maximum of 2pages

You might also like