Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views

Unit 1- Introduction to Computer Architecture

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Unit 1- Introduction to Computer Architecture

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

INTRODUCTION TO

COMPUTER ARCHITECTURE
Unit – I
Shruthi S V
What is Computer?
 A computer is a device that can be instructed to carry out sequences of
arithmetic or logical operations automatically.
 Modern computers have the ability to follow generalized sets of operations,
called programs. These programs enable computers to perform an extremely
wide range of tasks.
What is Data?
Data in a computer terminology mean raw facts and figures.

For ex:-mohan,1977etc.

What is Information?
means what we get after processing.

• means what we get after processing.


• means what we get after processing.
Data Vs. Information?
You should understand that what goes in the computers is data
and what comes out of them is information.

This process of turning data into information is also known as


information processing cycle.
COMPUTER ORGANISATION AND ARCHITECTURE
• The components from which computers are built, i.e., computer organization.
• In contrast, computer architecture is the science of integrating those
components to achieve a level of functionality and performance.
• It is as if computer organization examines the lumber, bricks, nails, and other
building material
• While computer architecture looks at the design of the house.
UNIT-I INTRODUCTION
•Evolution of Computer Systems
•Computer Types
•Functional units
•Basic operational concepts
•Bus structures
•Registers
•Classifying instruction set Architecture
•Instruction Cycle
Evolution of Computers
FIRST GENERATION (1945 – 1955)
• Program and data reside in the same memory.
• ALP(Assembly language program)was made used to write programs.
• Vacuum tubes were used to implement the functions (ALU & CU design)
• Magnetic core and magnetic tape storage devices are used.
• Using electronic vacuum tubes, as the switching components.
SECOND GENERATION (1955 – 1965)
• Transistor were used to design ALU & CU
• HLL(high level language) is used (FORTRAN)
• To convert HLL to MLL compiler were used.
• Separate I/O processor were developed to operate in parallel with CPU, thus
improving the performance.
• Invention of the transistor which was faster, smaller and required considerably
less power to operate.
THIRD GENERATION (1965-1975)
• IC technology improved.
• Improved IC technology helped in designing low cost, high speed processor and memory modules.
• Multiprogramming, pipelining concepts were incorporated.
• DOS allowed efficient and coordinate operation of computer system with multiple users.
• Cache and virtual memory concepts were developed.
FOURTH GENERATION (1975-1985)
• CPU – Termed as microprocessor.
• INTEL,MOTOROLA,TEXAS,NATIONAL semiconductors started developing microprocessor.
• Workstations, microprocessor (PC) & Notebook computers were developed.
• Interconnection of different computer for better communication LAN,MAN,WAN.
• Computational speed increased by 1000 times.
• Specialized processors like Digital Signal Processor were also developed.
BEYOND THE FOURTH GENERATION
(1985 – TILL DATE)
• E-Commerce, E- banking, home office.
• INTEL, MOTOROLA
• High speed processor - GHz speed.
• Because of IC technology lot of added features in small size.
COMPUTER TYPES
Computers are classified based on the parameters like
• Speed of operation
• Cost
• Computational power
• Type of application
DESK TOP COMPUTER
• Processing & storage units, visual display &audio units, keyboards
• Storage media-Hard disks, CD-ROMs
E.g. Personal computers which is used in homes and offices

• ADVANTAGE: Cost effective, easy to operate, suitable for general purpose


educational or business application

NOTEBOOK COMPUTER
• Compact form of personal computer (laptop)
• Advantage is portability
WORK STATIONS
•More computational power than PC
•Costlier
•Used to solve complex problems which arises in engineering application
(graphics, CAD/CAM etc.)

ENTERPRISE SYSTEM (MAINFRAME)


•More computational power
•Larger storage capacity
•Used for business data processing in large organization
•Commonly referred as servers or super computers
SERVER SYSTEM
• Supports large volumes of data which frequently need to be accessed or to be
modified.

SUPER COMPUTERS
•Faster than mainframes.
•Helps in calculating large scale numerical and algorithm calculation in short span of
time.
•Used for aircraft design and testing, military application and weather forecasting.
HANDHELD
• Also called a PDA (Personal Digital Assistant).
• A computer that fits into a pocket, runs on batteries, and
is used while holding the unit in your hand.
• Typically used as an appointment book, address book,
calculator, and notepad.
• Can be synchronized with a personal microcomputer as
a backup.
Basic Terminology
• Computer • Software
A device that accepts input, processes data, A computer program that tells the computer
stores data, and produces output, all according to how to perform particular tasks.
a series of stored instructions.

• Network
• Hardware Two or more computers and other devices that
Includes the electronic and mechanical devices are connected, for the purpose of sharing data
that process the data; refers to the computer and programs.

• Peripheral devices
Used to expand the computer’s input, output
and storage capabilities.
Basic Terminology
• Input
Whatever is put into a computer system.
• Data
Refers to the symbols that represent facts, objects, or ideas.
• Information
The results of the computer storing data as bits and bytes; the words, numbers, sounds, and graphics.
• Output
Consists of the processing results produced by a computer.
• Processing
Manipulation of the data in many ways.
• Memory
Area of the computer that temporarily holds data waiting to be processed, stored, or output.
• Storage
Area of the computer that holds data on a permanent basis when it is not immediately needed for processing.
•Assembly language program (ALP) - Programs are written using mnemonics

•Mnemonic - Instruction will be in the form of English like form

•Assembler - Is a software which converts ALP to MLL (Machine Level Language)

•HLL (High Level Language) - Programs are written using English like statements

•Compiler - Convert HLL to MLL, does this job by reading source program at once
•Interpreter – Converts HLL to MLL

•System software – Program routines which aid the user in the execution of
programs
e.g. Assemblers, Compilers

•Operating system – Collection of routines responsible for controlling and


coordinating all the activities in a computer system
COMPUTING SYSTEMS
Computers have two kinds of components:

• Hardware, consisting of its physical devices (CPU, memory, bus,


storage devices)
• Software, consisting of the programs it has (Operating system,
applications, utilities, ...)

Calvin College
FUNCTIONAL UNITS OF COMPUTER
• Input Unit

• Output Unit

• Central processing Unit (ALU and Control Units)

• Memory

• Bus Structure
FUNCTIONAL UNITS

Arithmetic
Input and
logic

Memory

Output Control

I/O Processor

Figure 1.1. Basic functional units of a computer.


FUNCTION
• ALL computer functions are:
• Data PROCESSING Data = Information
• Data STORAGE
• Data MOVEMENT
Coordinates How
• CONTROL Information is Used

• NOTHING ELSE!
INPUT UNIT:

•Converts the external world data to a binary format, which can be understood by CPU

•E.g. Keyboard, Mouse, Joystick etc.

OUTPUT UNIT:

•Converts the binary format data to a format that a common man can understand

•E.g. Monitor, Printer, LCD, LED etc.


CPU

•The “brain” of the machine

•Responsible for carrying out computational task

•Contains ALU, CU, Registers

•ALU Performs Arithmetic and logical operations

•CU Provides control signals in accordance with some timings which in turn controls
the execution process

•Register Stores data and result and speeds up the operation


Example
Add R1, R2

T1 Enable R1

T2 Enable R2

Enable ALU for addition operation


T3

T4
•Control unit works with
a reference signal called
T1 processor clock

T2 •Processor divides the


operations into basic
steps

R1 R2

•Each basic step is


executed in one clock
cycle

R2
MEMORY
 Memory is one of the most important components of a computer system as it
stores data and instructions.

Every memory chip contains thousands of memory locations. In the computer, the
data is stored in the form of bits and bytes.

A bit is the smallest storage unit of memory. A nibble is a collection of 4 bits. Eight
bits combined together to form a single byte, which in turn represents a single
character.
Memory Units
Types of Memories
The computer memories can be divided into following categories:

Primary Memory

Cache Memory

Secondary memory
Primary Memory
Broadly primary memory
can be of two types :–
1. RAM (Random Access
Memory)
2. ROM (Read only memory).
Random Access Memory (RAM)
The memory can be accessed from any desired location
randomly.

The instructions and data that we input into the computer are
stored in
the RAM of the Computer.

It is a read/write memory, so data can be both read from and


written to the RAM.
RANDOM ACCESS MEMORY (RAM)
RAM can be broadly classified into two
categories:

Dynamic RAM (DRAM) and

 Static RAM (SRAM).


Dynamic RAM (DRAM)
It consists of a transistor and a capacitor that
stores electric charge.

The DRAMs are physically smaller, cheaper


and slower memories. They are slower
because the data stored in them needs to
continuously refreshed and this consumes lot
of processor time.
Dynamic RAM (DRAM)
Each refresh operation takes
several CPU cycles to complete.
This is because a capacitor tends
to loose charge over a period of
time which needs to be refreshed
again and again.
STATIC RAM
This type of RAM is large in physical size but is
an expensive and faster memory.

It is faster because it is made up of flip flops to


store data and these flip flops do not require any
refreshing.
STATIC RAM
Static RAM is also volatile and is
easier to use as compared to
dynamic RAM. These are used in
specialized applications.
DRAM Vs. Static RAM
ROM
Its non volatile memory, ie, the information stored in it, is not
lost even if the power supply goes off. It’s used for the
permanent storage of information. It also posses random
access property. Information can not be written into a ROM by
the users/programmers. In other words the contents of ROMs
are decided by the manufactures.
Types of ROM
(i) PROM : It’s programmable ROM. Its contents
are decided by the user. The user can store
permanent programs, data etc in a PROM. The
data is fed into it using a PROM programs.
Types of ROM
(ii) EPROM : An EPROM is an erasable PROM. The stored
data in EPROM’s can be erased by exposing it to UV light for
about 20 min. It’s not easy to erase it because the EPROM IC has
to be removed from the computer and exposed to UV light. The
entire data is erased and not selected portions by the user.
EPROM’s are cheap and reliable.
Types of ROM
(iii) EEPROM (Electrically Erasable PROM)
The chip can be erased & reprogrammed on the board
easily byte by byte. It can be erased with in a few
milliseconds. There is a limit on the number of times
the EEPROM’s can be reprogrammed, i.e.; usually
around 10,000 times.
FLASH MEMORY
Its an electrically erasable & programmable permanent
type memory. It uses one transistor memory all resulting
in high packing density, low power consumption, lower
cost & higher reliability. Its used in all power, digital
cameras, MP3 players etc.
CACHE MEMORY
Cache memory is a special high speed memory made up of
high speed static RAMs.

It is used to hold frequently accessed data and instructions.

We know that the processing speed of CPU is much more


than the main memory access time of the computer.
CACHE MEMORY
This means the CPU has to wait for a substantial amount
of time.

Alternatively we have the cache memory which is a small,


expensive but fast memory that is placed between the CPU
and the main memory.
CACHE MEMORY
Whenever some data is required, the CPU first looks
into cache.

If data is found, we call it a cache hit and the


information is transferred to the CPU.

In case of a miss, the main memory is accessed.


CACHE MEMORY

There are two types of cache


memory:
L1 cache: It is small and is built inside the CPU. It is fast
as compared to L2 cache

L2 cache: It is large but slower and is mounted on the


motherboard
Secondary Memory
SECONDARY MEMORY

The major limitation of primary memory is that it


has limited storage capacity and is volatile.

To overcome this limitation we have secondary


memory storage devices. This type of memory is
also called external memory. For example Floppy
disk, hard disk, USB drives, CD/DVDs
HARD DISK
A hard disk consists of one or more
circular disks called platters which are
mounted on a common spindle. Each
surface of a platter is coated with a
magnetic material. Both surfaces of each
disk are capable of storing data except
the top and bottom disk where only the
inner surface is used.
HARD DISK
The information is recorded on the surface of the rotating disk by
magnetic read/write heads. These heads are joined to a common arm
known as access arm. This arm moves over the surface of the rotating
disk as shown in the figure (next slide)
HARD DISK
Information is recorded on each of these disks in the form of
concentric circles called tracks which are further divided into
sectors. Hard drives however, are not very portable and are
primarily used internally in a computer system. But external
hard disks are also available as a substitute for portable
storage. Today the hard disks have the storage capacity of
several gigabytes to terabytes.
Basic Operational Concepts
•Instructions take a vital role for the proper working of the computer.
•An appropriate program consisting of a list of instructions is stored in the memory so that the tasks can
be started.
•The memory brings the Individual instructions into the processor, which executes the specified
operations.
•Data which is to be used as operands are moreover also stored in the memory.

Example:
Add LOCA, R0
•This instruction adds the operand at memory location LOCA to the operand which will be present in
the Register R0.
• The above mentioned example can be written as follows:
Load LOCA, R1
Add R1, R0
•First instruction sends the contents of the memory location LOCA into processor
Register R0, and meanwhile the second instruction adds the contents of Register R1
and R0 and places the output in the Register R1.

•The memory and the processor are swapped and are started by sending the
address of the memory location to be accessed to the memory unit and issuing the
appropriate control signals.

•The data is then transferred to or from the memory.


ANALYZING HOW PROCESSOR AND MEMORY ARE CONNECTED

Processors have various registers to perform various functions :-

•Program Counter :- It contains the memory address of next instruction to be fetched.


•Instruction Register:- It holds the instruction which is currently being executed.
•MDR :- It facilities communication with memory. It contains the data to be written into or read out of
the addressed location.
•MAR :- It holds the address of the location that is to be accessed
•There are n general purpose registers that is R0 to Rn-1
Performance
• Performance means how quickly a program can be executed.

• In order to get the best performance it is required to design the compiler, machine
instruction set & hardware in a coordinated manner.
CONNECTION B / W PROCESSOR & MEMORY
The above mentioned block diagram consists of the following components

1) Memory
2) MAR
3) MDR
4) PC
5) IR
6) General Purpose Registers
7) Control Unit
8) ALU
•The instruction that is currently being executed is held by the Instruction Register.
•IR output is available to the control circuits, which generates the timing signal that
control the various processing elements involved in executing the instruction.
•The Memory address of the next instruction to be fetched and executed is contained
by the Program Counter.
•It is a specialized register.
•It keeps the record of the programs that are executed.
•Role of these registers is to handle the data available in the instructions. They store
the data temporarily.
•Two registers facilitate the communication with memory.
These registers are:
1) MAR (Memory Address Register)
2) MDR (Memory Data Register)

Memory Address Register:


•The address of the location to be accessed is held by MAR.

Memory Data Register:


•It contains the data to be written into or to be read out of the addressed location.

Working Explanation
A PC is set to point to the first instruction of the program. The contents of the PC are transferred to
the MAR and a Read control signal is sent to the memory. The addressed word is fetched from the
location which is mentioned in the MAR and loaded into MDR.
BUS STRUCTURES
• Group of lines that serve as connecting path for several devices is called a bus
(one bit per line). Individual parts must communicate over a communication line
or path for exchanging data, address and control information as shown in the
diagram below.

• Printer example – processor to printer. A common approach is to use the


concept of buffer registers to hold the content during the transfer.
INTERCONNECTION: Interconnection of the components of the computers can be in two ways.
• Single bus interconnection
• Multi-bus interconnection
Since the bus can be used for only one transfer at a time, only two units can actively use the bus at
given time.

Bus Types:
• Dedicated – Separate data, address and control lines
• Multiplexed – Shared lines

Dedicated

1. Data bus: It carries the data from one system module to other. Data bus may consist of 32,64, 128 or
even more numbers of separate lines. This number of lines decides the width of the data bus. Each line
can carry one bit at a time. So, a data bus with 32 lines can carry 32bit of data at a time. If a processor
needs to read 64bit of data from memory then the processor must access the memory twice.
2. Address Bus: It is used to carry the address of source or destination of the data on the data bus.

3. Control Bus: It is used to control the access, processing and information transferring. As either the
exclusive data and address lines are shared by all components or common paths may create congestion
in traffic, there must be a separate and dedicated path for control signal transfer.
REGISTER
Within the processor , there is a set of Registers which are very fast but hold only small amount
of data, in order to speed up its operation by providing quick access to commonly used values. Because
they are semiconductor devices whose contents can be accessed at extremely high speed. And the
most important thing about Registers is that Registers generally hold data temporarily, during execution
of a program. And registers are normally measured by the number of bits they can hold.

As an example:
An 8-bit register means, it can store 8 bit of data, 32-bit register means it can store 32 bit of
data.
Now, generally, Registers in the processor perform following two roles:

1.Enable the machine or assembly language programmer to minimize main memory reference by optimizing use of Registers.
2.Used by control unit to control the operation of the processor or by operating system programs to control the execution of
programs.

Now, we will discuss about various type of registers that are commonly used in processors.

These are:
1.Accumulator Register(AC):
Accumulator Register is a general purpose Register. This Register is required for doing operation on data. As this register
holds the initial data to be operated on, the intermediate result and the final result of processing operation. Means, the result of
arithmetic operation are transfer to AC if no specific address of result operation is specified. And the number of bits that
accumulator register contain is equal to the number of bits per word. That is, if word is of n bits, the AC is also of n bits.

2.Program Counter(PC):
Program Counter(PC) holds the address of next instruction to be read from memory after the current instruction is executed.
Means, Program Counter generally acts as a pointer which points to the memory location where the next instruction is
stored.And the no. of bits in PC, that is, the size of PC is equal to the width of the memory address.
3.Temporary Register(TR):
Temporary Register(TR) is used for holding data during the processing. And since Temporary Register
hold data, so, the no. of bits it contain is equal to no. of bits of word(data word).

4.Instruction Register(IR):
Instruction Register(IR) is used for storing the instruction. Means the instruction register hold the
current instruction that is being executed. And since it contain instruction, so, the no. of bits(size) of
Instruction Register is equal to the no. of bits of instruction, and the size of instruction is n bit for n-bit
CPU.

5.Data Register(DR):
The Data Register hold the operand from memory. Means when an operand is found, using either
direct or indirect addressing, it is placed in Data Register(DR).The processor then used in this value as
data for its operation.Its size is equal to the size of word in memory.
6.Address Register(AR):
The Address Register hold the address of memory word that is the Address Register contain the
address of memory location or Register from where data is stored or retrieved. Since it contain address,
so the size of Address Register is equal to the width of memory address is directly related to size of
memory,
Means, if a memory is of size 2n *m , then, n bits are used to specify address.

7.Input Register(INPR):
Input Register(INPR) hold(or receives) data from an input device. And the size of input register is
depend on the alphanumeric code that followed in computer, that is, if ASCII is followed, then the size of
INPR is 7 bits and if EBCDIC is followed, then the size of INPR is 8 bits.

8.Output Register(OUTR):
Output Register(OUTR) hold data that need to be sent to an output device. Its size is also depend on
the alphanumeric code that followed in computer.
Now, thus, according to Basic computer, whose CPU is of 16 bit and memory is of 212*16=4096
words, of 16 bits each, and according to definition of each type of register we discussed, the no. of bits
allocated to each register is depicted in Figure below. Here we assume that EBCDIC code is followed in
computer.
INSTRUCTION SET ARCHITECTURE
• The instruction set architecture is basically the interface between your hardware and the software.

• The only way that you can interact with the hardware is the instruction set of the processor.

• To command the computer, you need to speak its language and the instructions are the words of a
computer’s language and the instruction set is basically its vocabulary.

• ISA is the portion of the machine which is visible to either the assembly language programmer or a
compiler writer or an application programmer.

• It is the only interface that you have, because the instruction set architecture is the specification of what
the computer can do and the machine has to be fabricated in such a way that it will execute whatever
has been specified in your ISA.
REGISTER
register, where registers are used for storing operands. Such architectures are in fact also
called load – store architectures, as only load and store instructions can have memory operands.

• Register – memory, where one operand is in a register and the other one in memory.
• Memory – memory, where all the operands are specified as memory operands.

STACK ORGANIZATION
where the operands are put into the stack and the operations are carried out on the top of the stack.
The operands are implicitly specified here.
Let us assume you have to perform the operation A = B + C, where all three operands are memory
operands.

you have to initially load one operand into the accumulator and the ADD instruction will only specify the
operand’s address.

In the register memory ISA, One operand has to be moved into any register and the other one can be a
memory operand.

In the register – register ISA, both operands will have to moved to two registers and the ADD instruction will
only work on registers. The memory – memory ISA permits both memory operands. So you can directly add.

In a stack-based ISA, you’ll have to first of all push both operands onto the stack and then simply give an add
instruction which will add the top two elements of the stack and then store the result in the stack.

So you can see from these examples that you have different ways of executing the same operation, and it
obviously depends upon the ISA. Among all these ISAs, It is the register – register ISA that is very popular
and used in all other architectures.
We shall now look at what are the different features that need to be considered when
designing the instruction set architecture.

They are:

•Types of instructions (Operations in the Instruction set)


•Types and sizes of operands
•Addressing Modes
•Addressing Memory
•Encoding and Instruction Formats
•Compiler related issues
Consider the task of adding a list of n numbers.
A possible sequence is given below.

Move DATA1, R0
Add DATA2, R0
Add DATA3, R0
Add DATAn, R0
Move R0, SUM

The addresses of the memory locations containing the n numbers are symbolically given as
DATA1, DATA2, . . , DATAn, and a separate Add instruction is used to add each Databer to
the contents of register R0. After all the numbers have been added, the result is placed in
memory location SUM.
Instead of using a long list of Add instructions, it is possible to place a single Add instruction in a program
loop, as shown below:

Move N, R1
Clear R0
LOOP Determine address of “Next” number and add “Next” number to R0
Decrement R1
Branch > 0, LOOP
Move R0, SUM

The loop is a straight-line sequence of instructions executed as many times as needed. It starts at location
LOOP and ends at the instruction Branch>0. During each pass through this loop, the address of the next list
entry is determined, and that entry is fetched and added to R0.
Assume that the number of entries in the list, n, is stored in memory location N. Register R1 is used as a
counter to determine the number of times the loop is executed. Hence, the contents of location N are loaded
into register R1 at the beginning of the program. Then, within the body of the loop, the instruction, Decrement
R1 reduces the contents of R1 by 1 each time through the loop. The execution of the loop is repeated as long
as the result of the decrement operation is greater than zero.
INSTRUCTION CYCLE
A program residing in the memory unit of a
computer consists of a sequence of
instructions. These instructions are executed
by the processor by going through a cycle
for each instruction.

In a basic computer, each instruction cycle


consists of the following phases:

1.Fetch instruction from memory.


2.Decode the instruction.
3.Read the effective address from memory.
4.Execute the instruction.
Input-Output Configuration

In computer architecture, input-output devices act as an interface between the machine and the user.

Instructions and data stored in the memory must come from some input device. The results are displayed to the
user through some output device.
How it works ;

•The input-output terminals send and receive information.


•The amount of information transferred will always have eight bits of an alphanumeric code.
•The information generated through the keyboard is shifted into an input register 'INPR'.
•The information for the printer is stored in the output register 'OUTR'.
•Registers INPR and OUTR communicate with a communication interface serially and with the AC in
parallel.
•The transmitter interface receives information from the keyboard and transmits it to INPR.
•The receiver interface receives information from OUTR and sends it to the printer serially.

You might also like