0% found this document useful (0 votes)
7 views67 pages

Module 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 67

Computer Architecture

and Organization
Module:1 Introduction To Computer Architecture and Organization

Overview of Organization and Architecture –Functional components of a computer:


Registers and register files - Interconnection of components - Overview of IAS
computer function - Organization of the von Neumann machine - Harvard
architecture - CISC & RISC Architectures.
 Computer Architecture is concerned with the way hardware
components are connected together to form a computer system.

 Computer Organization is concerned with the structure and behavior


of a computer system as seen by the user. It acts as the interface
between hardware and software.

Computer Organization and Architecture is the study of internal working, structuring, and
implementation of a computer system. Architecture in the computer system, same as
anywhere else, refers to the externally visual attributes of the system
 Computer Architecture & Organization
The internal logic design of the system is known as architecture. It determines the various
operations performed by the system.

 Computer architecture is a set of rules stating how computer software and hardware are
joined together and interact to make a computer work.
 Computer organization refers to the operational units and their interconnections that realize
the architectural specification.

Computer Architecture Computer Organization


Logical aspects of Computer system Physical aspects of computer
system
Study on the structure and behavior Study on circuits and components
of a computer system involved in building a working
computer
Computer Architecture & Organization
There have been 2 types of Computers:

Fixed Program Computers – Their function is very specific and they


couldn’t be re-programmed, e.g. Calculators.
Stored Program Computers – These can be programmed to carry out
many different tasks, applications are stored on them, hence the
name !!!

A computer is an electronic machine designed to accept data, perform mathematical manipulations on


the received data and finally stores or display the results. (e.g. Simple task like arithmetic calculations
to Complex tasks like Scientific Research)

To perform simple or complex tasks, a computer needs essential functional components which are
called as the building blocks of computer.
Functional components of a computer
Input unit accepts Arithmetic and logic unit(ALU):
information: •Performs the desired
•Human operators, operations on the input
•Electromechanical devices (keyboard) information as determined
•Other computers by instructions in the memory

Memory
Arithmetic
Input
Instr1 & Logic
Instr2
Instr3
Data1
Output Data2 Control

I/O Processor
Stores
information: Control unit coordinates
Output unit sends various actions
results of processing: •Instructions,
•Data •Input,
•To a monitor display, •Output
•To a printer •Processing
6
Computer Components
Computer Architecture
• Computer architecture refers to,
• Those attributes of a system visible to a programmer
• Those attributes that have a direct impact on the logical execution of a program.
• Examples
• Instruction set
• The number of bits used to represent various data types (e.g., numbers,
characters)
• I/O mechanisms, and techniques for addressing memory.
• It is an architectural design issue whether a computer will have a multiply instruction.
Computer Organization
• Computer organization refers to the operational units and their
interconnections that realize the architectural specifications.
• Organizational attributes include those hardware details transparent
to the programmer
• Examples
• Control signals;
• Interfaces between the computer and peripherals;
• The memory technology used.
• It is an organizational issue whether that instruction will be
implemented by a special multiply unit or by a mechanism that makes
repeated use of the add unit of the system.
Need of Architecture and Organization

• Computing should acquire some understanding of a computer system’s


functional components, their characteristics, performance, and interactions.
• Need to understand computer architecture in order to structure a
program so that it runs more efficiently on a real machine.
• In selecting a system to use, they should be able to understand the tradeoff
among various components, such as CPU clock speed vs. memory size.
Architecture and Organization

• A particular architecture may span many years and encompass a number of


different computer models, its organization changing with changing
technology.
• IBM System/370 architecture - This architecture was first introduced in
1970 and included a number of models.
• The customer with modest requirements could buy a cheaper, slower model
and, if demand increased, later upgrade to a more expensive, faster model
S.NO Computer Architecture Computer Organization

Architecture describes what the computer


1. Organization describes how it does it.
does.

Computer Architecture deals with Computer Organization deals with structural


2.
functional behavior of computer system. relationship.

3. Architecture indicates its hardware. Where, Organization indicates its performance.

For designing a computer, its architecture is For designing a computer, organization is decided
4.
fixed first. after its architecture.

Computer Architecture is also called as Computer Organization is frequently called as


5.
instruction set architecture. micro architecture.

Computer Architecture comprises logical


Computer Organization consists of physical units like
6. functions such as instruction sets, registers,
circuit designs, peripherals and adders.
data types and addressing modes.
Computer Design

• Computer Design is the structure in which components relate to each


other. The designer deals with a particular level of system at a time and there
are different types of issues at different levels. At each level, the designer is
concerned with the structure and function.
• Structure is the skeleton of the various components related with each other
for the communication.
• Function is the activities involved in the system.
Structure and Function

• Structure is the way in which components relate to each other


• Function is the operation of individual components as part of the structure
Functional Components of Computer

 Input Unit
 Output Unit
 Central Processing Unit (CPU)
 Arithmetic and Logic Unit (ALU)
 Control Unit
 Memory Registers
 Input Unit : A computer accepts the information through input device.

 Input device writes data into the memory through the data path. Some of the
common input devices are keyboard, mouse, joystick, scanner etc.

 Output Unit: The Output unit send the processed result to the user using output
device. It reads the data from memory through data path. Some devices are
monitor, printer etc.

 Central Processing Unit (CPU) : The CPU is called the brain of the computer
because it is the control center of the computer. It first fetches instructions from
memory and then interprets them so as to know what is to be done.
 CPU executes or performs the required computation and then either stores the
output or displays on the output device
 Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests performs
mathematical calculations and takes logical decisions. Arithmetic calculations
include addition, subtraction, multiplication and division

 Control Unit : The Control unit coordinates and controls the data flow in and
out of CPU and also controls all the operations of ALU, memory registers and
also input/output units.

 It is also responsible for carrying out all the instructions stored in the program.
 It decodes the fetched instruction, interprets it and sends control signals to
input/output devices until the required operation is done properly by ALU and
memory.
 Memory Registers : A register is a temporary unit of memory in the CPU.
These are used to store the data which is directly used by the processor.

 Registers can be of different sizes(16 bit, 32 bit, 64 bit and so on) and each
register inside the CPU has a specific function like storing data, storing an
instruction, storing address of a location in memory etc.

 The user registers can be used by an assembly language programmer for storing
operands, intermediate results
Flip flop stores a single bit of information
Group of flipflops forms a register
Group of registers forms a memory
Memories are made up of registers.
Each register in the memory is one storage location. Storage location is also called as
memory location.
Memory locations are identified using Address.
The total number of bit a memory can store is its capacity.
Registers

⚫ To speed up the processor operations, the processor includes some


internal memory storage locations called registers.

⚫ Memory hierarchy
⚫ Registers
⚫ Cache memory
⚫ Main memory
⚫ Secondary memory
⚫ At higher level of hierarchy, memory is faster, more expensive.

⚫ Registers are top level of hierarchy.


Registers
⚫ Two roles
⚫ User visible registers – referenced by machine instruction
⚫ Control and Status registers – employed to control
the operation
⚫ User-Visible Registers

⚫ General Purpose

⚫ Data

⚫ Address

⚫ Condition Codes
⚫ General purpose registers:

Register can contain the operand for any Opcode.


⚫ Opcode is a part of the instruction that tells the processor what

should be done.

⚫ Operand is a part of the instruction that contains the data to be

acted on, or the memory location of the data in a register


⚫ Restricted Registered:
Used for specific operations like floating point and stack
operations (dedicated registers).
⚫ Data registers:

 Used only to hold data and cannot be employed in the


calculation of a n operand address.

 Accumulator (AC):

 Accumulator is a register acts a s a temporary storage


location which holds intermediate value in arithmetic and logic
operation results.
⚫ Address registers – devoted for particular addressing mode.
⚫ Segment registers – holds the address of the base of the
segment.

⚫ Index registers – used for indexed addressing and may be auto-


indexed(increment).

⚫ Stack pointer (SP) – points to the top of the stack.

⚫ FLAG register is the status register that contains the current


state of the processor (ie-reflects the result of arithmetic operation).
⚫ Condition Code Register(Flag)
⚫ C C R contains five flag bits, they are set by the ALU to hold

information about the result of an arithmetic or logical operation


instruction that has just been executed.
⚫ Flags in C C R :
⚫ Carry C: Set to 1 if an add operation produces a carry or a subtract

operation produces a borrow; otherwise cleared to 0.


⚫ Overflow V: Useful only during operations on signed integers.

⚫ Zero Z: Set to 1 if the result is 0, otherwise cleared to 0.

⚫ Negate N: Meaningful only in signed number operations. Set to 1 if

a negative result is produced.


⚫ Extend X: Functions as a carry for multiple precision arithmetic

operations.
⚫ Control & Status Registers:
⚫ Not visible to the user, visible in a control or operating system
mode (supervisory mode).
⚫ Program counter holds the address of the instruction that
should be executed next.
⚫ Instruction register holds the actual instruction to be
executed.
⚫ Memory Address Register (MAR) connects to address bus

⚫ Memory Buffer Register (MBR) connects to data bus, feeds

other registers.
 Exa m p le of Re gi s te r Organizations
Register F iles
⚫ A register file is a n array of processor registers in a central
processing unit (CPU).

⚫ Implemented by way of fast static RAMs with multiple ports.

⚫ Dedicated read and write ports, whereas ordinary multi-ported


S R A M s will usually read and write through the same ports.
Register F iles with three access ports- symbol
A Register File with three access ports Logic
diagram
Organization of Von-Neumann Machine (IAS Computer)
⚫ The task of entering and altering programs for ENIAC was
extremely tedious
⚫ Stored program concept – says that the program is stored in the
computer along with any relevant data
⚫ A stored program computer consists of a processing unit and an
attached memory system.
⚫ The processing unit consists of data-path and control. The data-path
contains registers to hold data and functional units, such as
arithmetic logic units and shifters, to operate on data.
Structure of Von Neumann Machine
IAS Architecture
Memory of the IAS
 1000 storage locations called words.
 Each word 40 bits.
 A word may contain:
 A numbers stored as 40 binary digits (bits) – sign bit + 39 bit
value
 An instruction-pair. Each instruction:
 An opcode (8 bits)
 An address (12 bits) – designating one of the 1000
words in memory.
 The modern computers are based on a stored-program concept introduced
by John Von Neumann.
 In stored-program concept, programs and data are stored in a separate
storage unit called memories and are treated the same.

Computer is having three basic units:

 The Central Processing Unit (CPU)


 The Main Memory Unit
 The Input/Output Device

 Control Unit –
A control unit (CU) handles all processor control signals. It directs all input
and output flow, fetches code for instructions, and controls how data moves
around the system.
 Arithmetic and Logic Unit (ALU) –
The arithmetic logic unit is that part of the CPU that handles
all the calculations the CPU may need, e.g. Addition,
Subtraction, Comparisons.
 It performs Logical Operations, Bit Shifting Operations, and
Arithmetic operations.
 Input/Output Devices – Program or data is read into main
memory from the input device or secondary storage under the
control of CPU input instruction.
 Output devices are used to output the information from a
computer, some results are evaluated by computer and it is
stored in the computer
 Buses – Data is transmitted from one part of a computer
to another, connecting all major internal components to
the CPU and memory, by the means of Buses.
 Types:
 Data Bus: It carries data among the memory unit, the
I/O devices, and the processor.
 Address Bus: It carries the address of data (not the
actual data) between memory and processor.
 Control Bus: It carries control commands from the CPU
(and status signals from other devices) in order to
control and coordinate all the activities within the
computer.
Von Neumann Machine
Von Neumann bottleneck :
 To enhance performance, we cannot get away from the fact that
instructions can only be done one at a time and can only be
carried out sequentially.
 Creates a inadequate rate data transfer between Memory and
processor.
 Both of these factors hold back the competence of the CPU. This is
referred as the „Von Neumann bottleneck‟.
 Von Neumann processor with more cache, more RAM, or faster
components but if original gains are to be made in CPU
performance then an influential inspection needs to take place of
CPU configuration.
 This architecture is very important and is used in our PCs and even
in Super Computers.
Register transfer operation for addition operation
Fetch / Execute Cycle
Flowchart of IAS operation
Flowchart of IAS operation
I A S I n s truc tio n s
IAS – Total 21 Instructions

⚫ Data Transfer
⚫ Unconditional Branch Instruction
⚫ Conditional Branch Instruction
⚫ Arithmetic
⚫ Address Modify Instruction
IAS Instruction set
Example
 Write an ALP for the given expression using Von Neumann
instruction set and write the register transfer notation for the same.
Assume that B,C and D are available in the memory locations 450,
451 and 452 respectively.

A = ( B + C ) * D
X = A + B/2
ALP
Harvard Architecture
 The Harvard architecture is a computer architecture with physically
separate storage and signal pathways for instructions and data.
 It was basically developed to overcome the bottleneck of Von
Neumann Architecture.
 The main advantage of having separate buses for instruction and
data is that CPU can access instructions and read/write data at the
same time.
 Programs needed to be loaded by an operator; the processor could
not initialize itself.
 In a Harvard architecture, there is no need to make the two memories
share characteristics.
 In particular, the word width, timing, implementation technology,
and memory address structure can differ.
 Instructions – read-only memory
 Data memory –read-write memory.
 In some systems, there is much more instruction memory than data
memory so instruction addresses are wider than data addresses.
Von-Neumann Vs Harvard
Modified Harvard Architecture
 A modified Harvard architecture machine is very much like a
Harvard architecture machine, but it relaxes the strict separation
between instruction and data while still letting the CPU
concurrently access two (or more) memory buses.
 The most common modification includes separate instruction and
data caches backed by a common address space.
 While the CPU executes from cache, it acts as a pure Harvard
machine.
 When accessing backing memory, it acts like a von Neumann
machine
RISC and CISC Architecture

 Reduced instruction set computing is a Central Processing Unit


design strategy based on the vision that a basic instruction set gives
great performance when combined with a microprocessor
architecture.
 This architecture has the capacity to perform the instructions by
using some microprocessor cycles per instruction. This is a small or
reduced set of instructions.
 The instruction sets are modest and simple, which help in
comprising more complex commands.
 Most commands are completed in one machine cycle. This
pipelining is a crucial technique used to speed up RISC machines.
Reduced Instruction Set Computer is a microprocessor that
is designed to carry out few instructions at a similar time.

These chips need fewer transistors, which makes the


transistors inexpensive to design and produce
The features of RISC:

 The demand for decoding is less


 Few data types in hardware
 General-purpose register Identical
 Uniform instruction set
 Simple addressing nodes
Characteristics:
 RISC helps and supports few simple data types and synthesizes complex data types.
 RISC utilizes simple addressing modes and fixed-length instructions for pipelining.
 One Cycle Execution Time
 The amount of work that a computer can perform is reduced by separating “LOAD” and
“STORE” instructions.
 RISC contains a Large Number of Registers to prevent various interactions with memory.
 In RISC, Pipelining is easy as the execution of all instructions will be done in a uniform
interval of time i.e. one click.
 In RISC, more RAM is required to store assembly-level instructions.
 Reduced instructions need a less number of transistors in RISC.
 RISC uses the Harvard memory model means it is Harvard Architecture.
 A compiler is used to perform the conversion operation means converting a high-level
language statement into the code of its form.
CISC
 CISC computers have small programs. It has a huge number of
compound instructions, which take a long time to perform.
 A single set of instructions is protected in several steps; each
instruction set has an additional than 300 separate instructions.
 Maximum instructions are finished in two to ten machine cycles.
In CISC, instruction pipelining is not easily implemented.
 They achieve low-level processes, which makes it easier to have
huge addressing nodes and additional data types in the hardware
of a machine.
 CISC is considered less efficient than RISC, because of its
incompetence to eliminate codes which leads to wasting of
cycles.
 microprocessor chips are difficult to understand and program
for, because of the complexity of the hardware.
 CISC achieve low-level processes, which makes it easier
to have huge addressing nodes and additional data
types in the hardware of a machine.
 CISC is considered less efficient than RISC, because of
its incompetence to eliminate codes which leads to
wasting of cycles
Characteristics:
 Instruction-decoding logic will be Complex.
 One instruction is required to support multiple addressing
modes.
 Less chip space is enough for general purpose registers for
the instructions that are 0operated directly on memory.
 Various CISC designs are set up with two special registers
for the stack pointer, handling interrupts, etc.
 MUL is referred to as a “complex instruction
CISC VS RISC

You might also like