SlideShare a Scribd company logo
MODULE-3
Basic Structure of Computers:
• Personal computers: This is the most common type found in homes,
schools, Business offices etc.,
• Note book computers: These are compact and portable versions of PC
• Work stations: These have high resolution input/output (I/O) graphics
capability, but with same dimensions as that of desktop computer.
• Enterprise systems: These are used for business data processing in
medium to large corporations that require much more computing power
and storage capacity than work stations.
• Super computers: These are used for large scale numerical
calculations required in the applications like weather forecasting etc.
Functional Units:
Input unit:
• The source program/high level languages program/coded
information/simply data is fed to a computer through input devices
keyboard is a most common type.
• Example: Joysticks, trackballs, mouse, scanners etc are other input
devices.
Output unit:
• These actually are the counterparts of input unit. Its basic function is to
send the processed results to the outside world.
• Examples: Printer, speakers, monitor etc.
Memory unit:
• Primary memory
Is the one exclusively associated with the processor and operates at the
electronics speeds programs must be stored in this memory while they are
being executed.
• Secondary memory
Is used where large amounts of data & programs have to be stored,
particularly information that is accessed infrequently.
Examples: Magnetic disks & tapes, optical disks (ie CD-ROM’s), floppies etc.,
Arithmetic logic unit (ALU):
• Most of the computer operators are executed in ALU of the processor
like addition, subtraction, division, multiplication, etc.
• The control and the ALU are many times faster than other devices
connected to a computer system.
• This enables a single processor to control a number of external devices
such as key boards, displays, magnetic and optical disks,
Control unit:
• It effectively is the nerve center that sends signals to other units and
senses their states.
• The actual timing signals that govern the transfer of data between input
unit, processor, memory and output unit are generated by the control unit.
Basic Operational Concepts
• To perform a given task an appropriate program consisting of a list of
instructions is stored in the memory.
Examples: Add LOCA, R0
• First the instruction is fetched from the memory into the processor.
• The operand at LOCA is fetched and added to the contents of R0
• Finally the resulting sum is stored in the register R0
Examples: Load LOCA, R1
Add R1, R0
Connections between the processor and the memory
The instruction register (IR):
• Holds the instructions that are currently being executed.
• Its output is available for the control circuits which generates the
timing signals that control the various processing elements in one
execution of instruction.
The program counter PC:
• This is another specialized register that keeps track of execution of a
program.
• It contains the memory address of the next instruction to be fetched
and executed.
• Besides IR and PC, there are n-general purpose registers R0 through
Rn-1.
MAR – (Memory Address Register): It holds the address of the
location to be accessed.
MDR – (Memory Data Register): It contains the data to be written into
or read out of the address location.
Operating steps are:
1. Programs reside in the memory & usually get these through the I/P unit.
2. Execution of the program starts when the PC is set to point at the first
instruction of the program.
3. Contents of PC are transferred to MAR and a Read Control Signal is sent
to the memory.
4. After the time required to access the memory elapses, the address word is
read out of the memory and loaded into the MDR.
5. Now contents of MDR are transferred to the IR & now the instruction is
ready to be decoded and executed.
6. If the instruction involves an operation by the ALU, it is necessary to
obtain the required operands.
7. An operand in the memory is fetched by sending its address to MAR
& Initiating a read cycle.
8. When the operand has been read from the memory to the MDR, it is
transferred from MDR to the ALU.
9. After one or two such repeated cycles, the ALU can perform the
desired operation.
10. If the result of this operation is to be stored in the memory, the result
is sent to MDR.
12. Address of location where the result is stored is sent to MAR & a
write cycle is initiated.
13. The contents of PC are incremented so that PC points to the next
instruction that is to be executed.
Bus structure:
• The simplest and most common way of interconnecting various parts
of the computer.
• To achieve a reasonable speed of operation, a computer must be
organized so that all its units can handle one full word of data at a
given time.
• A group of lines that serve as a connecting port for several
devices is called a bus.
• Bus control lines are used to arbitrate multiple requests for use of one
bus.
• Low cost
• Very flexible for attaching peripheral devices
• Multiple bus structure certainly increases the performance but also
increases the cost significantly.
• This is solved by using cache registers. These buffers are electronic
registers of small capacity when compared to the main memory but of
comparable speed.
• The instructions from the processor at once are loaded into these
buffers and then the complete transfer of data at a fast rate will take
place.
Performance, Processor Clock, Basic Performance Equation, Clock
Rate Performance Measurement
• The total time required to execute the program is elapsed time is a
measure of the performance of the entire computer system.
• It is affected by the speed of the processor, the disk and the printer.
The time needed to execute a instruction is called the processor time.
Processor clock
• Processor circuits are controlled by a timing signal called clock. The
clock designer the regular time intervals called clock cycles.
• To execute a machine instruction the processor divides the action to
be performed into a sequence of basic steps that each step can be
completed in one clock cycle.
• The length P of one clock cycle is an important parameter that affects
the processor performance.
Basic Performance Equation
• Let ‘T’ be the processor time required to execute a program that has
been prepared in some high-level language.
• The number N is the actual number of instruction execution and is not
necessarily equal to the number of machine cycle instructions in the
object program.
• The average number of basic steps needed to execute one machine
cycle instruction is S, where each basic step is completed in one clock
cycle.
• If clock rate is ‘R’ cycles per second,
𝑇 =
𝑁 ∗ 𝑅
𝑆
Clock rate
These are two possibilities for increasing the clock rate ‘R’.
• Improving the IC technology makes logical circuit faster, which
reduces the time of execution of basic steps.
• Reducing the amount of processing done in one basic step also makes
it possible to reduce the clock period P.
Increase in the value ‘R’ that is entirely caused by improvements in IC
technology affects all aspects of the processor’s operation equally with
the exception of the time it takes to access the main memory.
Performance measurements
• It is very important to be able to access the performance of a
computer, computer designers use performance estimates to evaluate
the effectiveness of new features.
• In spite of the performance equation being so simple, the evaluation of
‘T’ is highly complex.
• Hence measurement of computer performance using bench mark
programs is done to make comparisons possible, standardized
programs must be used.
• The performance measure is the time taken by the computer to
execute a given bench mark.
The same program is also compiled and run on one computer selected as
reference.
𝑺𝑷𝑬𝑪 𝒓𝒂𝒕𝒊𝒏𝒈 =
𝑹𝒖𝒏𝒏𝒊𝒏𝒈 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒕𝒉𝒆 𝒓𝒆𝒇𝒆𝒓𝒆𝒏𝒄𝒆 𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓
𝑹𝒖𝒏𝒏𝒊𝒏𝒈 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒕𝒉𝒆 𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓 𝒖𝒏𝒅𝒆𝒓 𝒕𝒆𝒔𝒕
If the SPEC(Standard Performance Evaluation Corporation.)
rating = 50 Means that the computer under test is 50 times as fast as the
ultra sparc 10.
Let SPECi be the rating for program ‘i’ in the suite. The overall SPEC
rating for the computer is given by
𝑺𝑷𝑬𝑪 𝒓𝒂𝒕𝒊𝒏𝒈 =
𝒊=𝟏
𝒏
𝑨𝒌𝑺𝑷𝑬𝑪𝒊
𝟏
𝒏
Memory Location and Addresses
• The memory consists of many millions of storage cells, each of which
can store a bit of information having the value 0 or 1.
• Modern computers have word lengths that typically range from 16 to 64
bits.
• If the word length of a computer is 32 bits, a single word can store a 32-
bit 2’s complement number or four ASCII characters, each occupying 8
bits.
• It is customary to use numbers from 0 through 2K-1, for some suitable
values of k, as the addresses of successive locations in the memory.
• 24-bit address generates an address space of 224 (16,777,216) locations.
A 32-bit address creates an address space of 232 or 4G (4 Giga)
locations.
Byte Addressability:
• We now have three basic information quantities to deal with: the bit,
byte and word.
Fig: Memory words
Fig: A signed integer
Fig: Four characters
Big-Endian and Little-Endian Assignments:
• The name big-endian is used when lower byte addresses are used for
the more significant bytes (the left most bytes) of the word.
• The name little-endian is used for the opposite ordering, where the
lower byte addresses are used for the less significant bytes (the right
most bytes) of the word.
Word Alignment:
In the case of a 32-bit word length, natural word boundaries occur at
addresses 0, 4, 8, …, We say that the word locations have aligned addresses.
In general, words are said to be aligned in memory if they begin at a byte
address that is a multiple of the number of bytes in a word.
Accessing Numbers, Characters, and Character Strings:
A number usually occupies one word. It can be accessed in the
memory by specifying its word address. Similarly, individual characters can
be accessed by their byte address.
In many applications, it is necessary to handle character strings of
variable length. The beginning of the string is indicated by giving the
address of the byte containing its first character.
“end of string”
Memory Operations
• Load (or Read or Fetch) and Store (or Write).
• The load operation transfers a copy of the contents of a specific
memory location to the processor.
• The store operation transfers an item of information from the
processor to a specific memory location
Instruction and Instruction sequencing:
• Data transfers between the memory and the processor registers
• Arithmetic and logic operations on data
• Program sequencing and control
• I/O transfers
Register Transfer Notation:
• Transfer of information from one location in the computer to another.
• Most of the time, we identify a location by a symbolic name standing
for its hardware binary address.
• LOC, PLACE, A, VAR2; processor registers names may be R0, R5;
and I/O register names may be DATAIN, OUTSTATUS, and so on.
R1← [LOC]
• Means that the contents of memory location LOC are transferred into
processor register R1.
R3← [R1] + [R2]
• operation that adds the contents of registers R1 and R2, and then
places their sum into register R3.
Assembly Language Notation:
Move LOC, R1
an instruction that causes the transfer described above, from
memory location LOC to processor register R1,
The contents of LOC are unchanged by the execution of this
instruction, but the old contents of register R1 are overwritten.
Add R1, R2, R3
adding two numbers contained in processor registers R1 and R2
and placing their sum in R3 can be specified by the assembly language
statement
Basic Instructions:
• The operation of adding two numbers is a fundamental capability in
any computer. The statement
C=A+B
• In a high-level language program is a command to the computer to
add the current values of the two variables called A and B, and to
assign the sum to a third variable, C.
C← [A] + [B]
• assume that this instruction contains the memory addresses of the
three operands – A, B, and C. This three-address instruction can be
represented symbolically as
Add A, B, C
• Operands A and B are called the source operands, C is called the
destination operand, and Add is the operation to be performed on the
operands. A general instruction of this type has the format.
Operation Source1, Source 2, Destination
• Suppose that two- address instructions of the form
Operation Source, Destination
• Are available. An Add instruction of this type is
Add A, B
• Which performs the operation?
B← [A] + [B]
• The problem can be solved by using another two-address instruction
that copies the contents of one memory location into another. Such an
instruction is
Move B, C
• Using only one-address instructions, the operation C← [A] + [B] can
be performed by executing the sequence of instructions
Load A
Add B
Store C
• Let Ri represent a general-purpose register. The instructions
Load A, Ri
Store Ri, A and
Add A, Ri
• In processors where arithmetic operations are allowed only on operands
that are processor registers, the
C = A + B task can be performed by the instruction sequence
Move A, Ri
Move B, Rj
Add Ri, Rj
Move Rj, C
• In processors where one operand may be in the memory but the other
must be in register, an instruction sequence for the required task would
be
Move A, Ri
Add B, Ri
Move Ri, C
Instruction Execution and Straight-Line Sequencing:
• The three instructions of the
program are in successive word
locations, starting at location i.
since each instruction is 4 bytes
long, the second and third
instructions start at addresses i
+ 4 and i + 8.
• Then, the processor control circuits use the information in the PC to
fetch and execute instructions, one at a time, in the order of increasing
addresses, this is called straight-line sequencing.
Branching:
A straight-line program for adding n numbers Using a loop to add n numbers
Branch > 0 LOOP
Condition Codes:
• The processor keeps track of information about the results of various
operations for use by subsequent conditional branch instructions.
• This is accomplished by recording the required information in individual
bits, often called condition code flags.
• These flags are usually grouped together in a special processor register
called the condition code register or status register. Individual condition
code flags are set to 1 or cleared to 0,
• N(negative) Set to 1 if the result is negative; otherwise, cleared to
• Z(zero) Set to 1 if the result is 0; otherwise, cleared to 0
• V(overflow) Set ot1 if arithmetic overflow occurs; otherwise, cleared to 0
• C(carry) Set to 1 if a carry-out results from the operation; otherwise,
cleared to 0
Generating Memory Addresses:
• The purpose of the instruction block at LOOP is to add a different
number from the list during each pass through the loop.
• the Add instruction in the block must refer to a different address
during each pass.
• The memory operand address cannot be given directly in a single Add
instruction in the loop. Otherwise, it would need to be modified on
each pass through the loop.
• The instruction set of a computer typically provides a number of such
methods, called addressing modes.
Addressing Modes
Implementation of Variable and Constants:
• Register mode: The operand is the contents of a processor register;
the name (address) of the register is given in the instruction.
• Absolute mode: The operand is in a memory location; the address of
this location is given explicitly in the instruction.
Move LOC, R2
The Absolute mode can represent global variables in a program. A
declaration such as
Integer A, B;
• Immediate mode: The operand is given explicitly in the instruction.
For example, the instruction
Move 200immediate, R0 or Move #200, R0
Indirection and Pointers:
• Indirect mode: The effective address of the operand is the contents of
a register or memory location whose address appears in the instruction
Where B is a pointer variable.
This statement may be
compiled into
Move B, R1
Move (R1), A
Using indirect addressing
through memory, the same
action can be achieved with
Move (B), A
Basic Structure of Computers: Functional Units, Basic Operational Concepts, Bus structure, Performance – Processor Clock, Basic Performance Equation, Clock Rate, Performance Measurement..pptx
Indexing and Arrays:
• Index mode: the effective address of the operand is generated by
adding a constant value to the contents of a register.
X (Ri)
Where X denotes the constant value contained in the instruction and Ri is
the name of the register involved. The effective address of the operand is
given by
EA = X + [Rj]
The contents of the index register are not changed in the process
of generating the effective address. In an assembly language program,
the constant X may be given either as an explicit number or as a
symbolic name
R1, contains the address of a memory
location value X defines an offset from
this address to the location where the
operand is found
the constant X corresponds to a memory
address, and the contents of the index
register define the offset to the operand.
Relative Addressing:
• Relative mode: The effective address is determined by the Index
mode using the program counter in place of the general-purpose
register Ri
• This mode can be used to access data operands. But, its most common
use is to specify the target address in branch instructions. An
instruction such as
Branch > 0 LOOP
• Causes program execution to go to the branch target location
identified by the name LOOP if the branch condition is satisfied.
• This location can be computed by specifying it as an offset from the
current value of the program counter.
• Auto increment mode: the effective address of the operand is the
contents of a register specified in the instruction. After accessing the
operand, the contents of this register are automatically to point to the
next item in a list.
(Ri)+
• Auto decrement mode: the contents of a register specified in the
instruction are first automatically decremented and are then used as
the effective address of the operand.
-(Ri)
The Auto increment addressing mode used in the program
Ad

More Related Content

What's hot (20)

Introduction To Embedded Systems
Introduction To Embedded SystemsIntroduction To Embedded Systems
Introduction To Embedded Systems
anishgoel
 
CLASSIFICATION OF COMPUTER
CLASSIFICATION OF COMPUTERCLASSIFICATION OF COMPUTER
CLASSIFICATION OF COMPUTER
GLOBAL TECHNOLOGY CONSULTANCY
 
Cmp104 lec 4 types of computer
Cmp104 lec 4 types of computerCmp104 lec 4 types of computer
Cmp104 lec 4 types of computer
kapil078
 
Install operating system
Install operating systemInstall operating system
Install operating system
Abdulrahman Zalah
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
Adeel Rasheed
 
Introduction motherboard
Introduction motherboardIntroduction motherboard
Introduction motherboard
Prof. Dr. K. Adisesha
 
Computer and its classification
Computer and its classificationComputer and its classification
Computer and its classification
Ayush Jain
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
Haris456
 
CSS L17 - DOS COMMANDS IN COMPUTER NETWORKING
CSS L17 - DOS COMMANDS IN COMPUTER NETWORKINGCSS L17 - DOS COMMANDS IN COMPUTER NETWORKING
CSS L17 - DOS COMMANDS IN COMPUTER NETWORKING
Marvin Bronoso
 
Embedded systems basics
Embedded systems basicsEmbedded systems basics
Embedded systems basics
Mathivanan Natarajan
 
Cpu and its functions
Cpu and its functionsCpu and its functions
Cpu and its functions
myrajendra
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
Yanne Evangelista
 
Semiconductor memory
Semiconductor memorySemiconductor memory
Semiconductor memory
Then Murugeshwari
 
Disk storage - SlideShare by jayed hossain jibon
Disk storage - SlideShare by jayed hossain jibonDisk storage - SlideShare by jayed hossain jibon
Disk storage - SlideShare by jayed hossain jibon
Jayed Hossain Jibon
 
Bios and cmos
Bios and cmosBios and cmos
Bios and cmos
Online
 
Internal components of PC
Internal components of PCInternal components of PC
Internal components of PC
Tushar B Kute
 
Bios
BiosBios
Bios
Evans Lampi
 
peer to peer and client server model
peer to peer and client server modelpeer to peer and client server model
peer to peer and client server model
Bharath Nair
 
Types of computers
Types of computersTypes of computers
Types of computers
SaqibRiaz23
 
Universal serial bus
Universal serial busUniversal serial bus
Universal serial bus
Muhammad Muzaffar Khan
 
Introduction To Embedded Systems
Introduction To Embedded SystemsIntroduction To Embedded Systems
Introduction To Embedded Systems
anishgoel
 
Cmp104 lec 4 types of computer
Cmp104 lec 4 types of computerCmp104 lec 4 types of computer
Cmp104 lec 4 types of computer
kapil078
 
Computer and its classification
Computer and its classificationComputer and its classification
Computer and its classification
Ayush Jain
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
Haris456
 
CSS L17 - DOS COMMANDS IN COMPUTER NETWORKING
CSS L17 - DOS COMMANDS IN COMPUTER NETWORKINGCSS L17 - DOS COMMANDS IN COMPUTER NETWORKING
CSS L17 - DOS COMMANDS IN COMPUTER NETWORKING
Marvin Bronoso
 
Cpu and its functions
Cpu and its functionsCpu and its functions
Cpu and its functions
myrajendra
 
Disk storage - SlideShare by jayed hossain jibon
Disk storage - SlideShare by jayed hossain jibonDisk storage - SlideShare by jayed hossain jibon
Disk storage - SlideShare by jayed hossain jibon
Jayed Hossain Jibon
 
Bios and cmos
Bios and cmosBios and cmos
Bios and cmos
Online
 
Internal components of PC
Internal components of PCInternal components of PC
Internal components of PC
Tushar B Kute
 
peer to peer and client server model
peer to peer and client server modelpeer to peer and client server model
peer to peer and client server model
Bharath Nair
 
Types of computers
Types of computersTypes of computers
Types of computers
SaqibRiaz23
 

Similar to Basic Structure of Computers: Functional Units, Basic Operational Concepts, Bus structure, Performance – Processor Clock, Basic Performance Equation, Clock Rate, Performance Measurement..pptx (20)

computer organization and architecturebec306c
computer organization and architecturebec306ccomputer organization and architecturebec306c
computer organization and architecturebec306c
sunilm82
 
Computer organization unit 2detaila with analysis
Computer organization unit 2detaila with analysisComputer organization unit 2detaila with analysis
Computer organization unit 2detaila with analysis
423ec0007
 
Co m1-1
Co m1-1Co m1-1
Co m1-1
Radhika Ajadka
 
introduction COA(M1).pptx
introduction COA(M1).pptxintroduction COA(M1).pptx
introduction COA(M1).pptx
BhavanaMinchu
 
Co module 1 2019 20-converted
Co module 1 2019 20-convertedCo module 1 2019 20-converted
Co module 1 2019 20-converted
ramamani keshava
 
Cao u1
Cao u1Cao u1
Cao u1
vishnu murthy
 
Computer Organization and Architecture_Unit 1_part a.pptx
Computer Organization and Architecture_Unit 1_part a.pptxComputer Organization and Architecture_Unit 1_part a.pptx
Computer Organization and Architecture_Unit 1_part a.pptx
SwethaRaniMuniraju
 
Computer Architecture and Organization ppt
Computer Architecture and Organization pptComputer Architecture and Organization ppt
Computer Architecture and Organization ppt
JayasimhaThummala1
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
AshokRachapalli1
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1)
Subhasis Dash
 
CAO.pptx
CAO.pptxCAO.pptx
CAO.pptx
FarhanaMariyam1
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basics
Lucky Sithole
 
Computer organization and architecture|KTU
Computer organization and architecture|KTUComputer organization and architecture|KTU
Computer organization and architecture|KTU
ashlinpj36
 
Computer organization and architecture|KTU
Computer organization and architecture|KTUComputer organization and architecture|KTU
Computer organization and architecture|KTU
ashlinpj36
 
BASIC STRUCTURE OF COMPUTERS.pptx
BASIC STRUCTURE OF COMPUTERS.pptxBASIC STRUCTURE OF COMPUTERS.pptx
BASIC STRUCTURE OF COMPUTERS.pptx
DrAbhishekKumarSingh3
 
chapter 1 -Basic Structure of Computers.pptx
chapter 1 -Basic Structure of Computers.pptxchapter 1 -Basic Structure of Computers.pptx
chapter 1 -Basic Structure of Computers.pptx
janani603976
 
module 1 computer architecture diploma
 module 1 computer architecture diploma   module 1 computer architecture diploma
module 1 computer architecture diploma
Manoharan Ragavan
 
unit-i.pdf
unit-i.pdfunit-i.pdf
unit-i.pdf
RISHI643981
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
Deepak John
 
Unit I.pptx
Unit I.pptxUnit I.pptx
Unit I.pptx
sahushweta1702
 
computer organization and architecturebec306c
computer organization and architecturebec306ccomputer organization and architecturebec306c
computer organization and architecturebec306c
sunilm82
 
Computer organization unit 2detaila with analysis
Computer organization unit 2detaila with analysisComputer organization unit 2detaila with analysis
Computer organization unit 2detaila with analysis
423ec0007
 
introduction COA(M1).pptx
introduction COA(M1).pptxintroduction COA(M1).pptx
introduction COA(M1).pptx
BhavanaMinchu
 
Co module 1 2019 20-converted
Co module 1 2019 20-convertedCo module 1 2019 20-converted
Co module 1 2019 20-converted
ramamani keshava
 
Computer Organization and Architecture_Unit 1_part a.pptx
Computer Organization and Architecture_Unit 1_part a.pptxComputer Organization and Architecture_Unit 1_part a.pptx
Computer Organization and Architecture_Unit 1_part a.pptx
SwethaRaniMuniraju
 
Computer Architecture and Organization ppt
Computer Architecture and Organization pptComputer Architecture and Organization ppt
Computer Architecture and Organization ppt
JayasimhaThummala1
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
AshokRachapalli1
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1)
Subhasis Dash
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basics
Lucky Sithole
 
Computer organization and architecture|KTU
Computer organization and architecture|KTUComputer organization and architecture|KTU
Computer organization and architecture|KTU
ashlinpj36
 
Computer organization and architecture|KTU
Computer organization and architecture|KTUComputer organization and architecture|KTU
Computer organization and architecture|KTU
ashlinpj36
 
chapter 1 -Basic Structure of Computers.pptx
chapter 1 -Basic Structure of Computers.pptxchapter 1 -Basic Structure of Computers.pptx
chapter 1 -Basic Structure of Computers.pptx
janani603976
 
module 1 computer architecture diploma
 module 1 computer architecture diploma   module 1 computer architecture diploma
module 1 computer architecture diploma
Manoharan Ragavan
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
Deepak John
 
Ad

Recently uploaded (20)

Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
Origin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theoriesOrigin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theories
PrachiSontakke5
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
Origin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theoriesOrigin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theories
PrachiSontakke5
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
Ad

Basic Structure of Computers: Functional Units, Basic Operational Concepts, Bus structure, Performance – Processor Clock, Basic Performance Equation, Clock Rate, Performance Measurement..pptx

  • 1. MODULE-3 Basic Structure of Computers: • Personal computers: This is the most common type found in homes, schools, Business offices etc., • Note book computers: These are compact and portable versions of PC • Work stations: These have high resolution input/output (I/O) graphics capability, but with same dimensions as that of desktop computer. • Enterprise systems: These are used for business data processing in medium to large corporations that require much more computing power and storage capacity than work stations. • Super computers: These are used for large scale numerical calculations required in the applications like weather forecasting etc.
  • 2. Functional Units: Input unit: • The source program/high level languages program/coded information/simply data is fed to a computer through input devices keyboard is a most common type. • Example: Joysticks, trackballs, mouse, scanners etc are other input devices.
  • 3. Output unit: • These actually are the counterparts of input unit. Its basic function is to send the processed results to the outside world. • Examples: Printer, speakers, monitor etc. Memory unit: • Primary memory Is the one exclusively associated with the processor and operates at the electronics speeds programs must be stored in this memory while they are being executed. • Secondary memory Is used where large amounts of data & programs have to be stored, particularly information that is accessed infrequently. Examples: Magnetic disks & tapes, optical disks (ie CD-ROM’s), floppies etc.,
  • 4. Arithmetic logic unit (ALU): • Most of the computer operators are executed in ALU of the processor like addition, subtraction, division, multiplication, etc. • The control and the ALU are many times faster than other devices connected to a computer system. • This enables a single processor to control a number of external devices such as key boards, displays, magnetic and optical disks, Control unit: • It effectively is the nerve center that sends signals to other units and senses their states. • The actual timing signals that govern the transfer of data between input unit, processor, memory and output unit are generated by the control unit.
  • 5. Basic Operational Concepts • To perform a given task an appropriate program consisting of a list of instructions is stored in the memory. Examples: Add LOCA, R0 • First the instruction is fetched from the memory into the processor. • The operand at LOCA is fetched and added to the contents of R0 • Finally the resulting sum is stored in the register R0 Examples: Load LOCA, R1 Add R1, R0
  • 6. Connections between the processor and the memory
  • 7. The instruction register (IR): • Holds the instructions that are currently being executed. • Its output is available for the control circuits which generates the timing signals that control the various processing elements in one execution of instruction. The program counter PC: • This is another specialized register that keeps track of execution of a program. • It contains the memory address of the next instruction to be fetched and executed. • Besides IR and PC, there are n-general purpose registers R0 through Rn-1.
  • 8. MAR – (Memory Address Register): It holds the address of the location to be accessed. MDR – (Memory Data Register): It contains the data to be written into or read out of the address location.
  • 9. Operating steps are: 1. Programs reside in the memory & usually get these through the I/P unit. 2. Execution of the program starts when the PC is set to point at the first instruction of the program. 3. Contents of PC are transferred to MAR and a Read Control Signal is sent to the memory. 4. After the time required to access the memory elapses, the address word is read out of the memory and loaded into the MDR. 5. Now contents of MDR are transferred to the IR & now the instruction is ready to be decoded and executed. 6. If the instruction involves an operation by the ALU, it is necessary to obtain the required operands.
  • 10. 7. An operand in the memory is fetched by sending its address to MAR & Initiating a read cycle. 8. When the operand has been read from the memory to the MDR, it is transferred from MDR to the ALU. 9. After one or two such repeated cycles, the ALU can perform the desired operation. 10. If the result of this operation is to be stored in the memory, the result is sent to MDR. 12. Address of location where the result is stored is sent to MAR & a write cycle is initiated. 13. The contents of PC are incremented so that PC points to the next instruction that is to be executed.
  • 11. Bus structure: • The simplest and most common way of interconnecting various parts of the computer. • To achieve a reasonable speed of operation, a computer must be organized so that all its units can handle one full word of data at a given time. • A group of lines that serve as a connecting port for several devices is called a bus.
  • 12. • Bus control lines are used to arbitrate multiple requests for use of one bus. • Low cost • Very flexible for attaching peripheral devices • Multiple bus structure certainly increases the performance but also increases the cost significantly. • This is solved by using cache registers. These buffers are electronic registers of small capacity when compared to the main memory but of comparable speed. • The instructions from the processor at once are loaded into these buffers and then the complete transfer of data at a fast rate will take place.
  • 13. Performance, Processor Clock, Basic Performance Equation, Clock Rate Performance Measurement • The total time required to execute the program is elapsed time is a measure of the performance of the entire computer system. • It is affected by the speed of the processor, the disk and the printer. The time needed to execute a instruction is called the processor time.
  • 14. Processor clock • Processor circuits are controlled by a timing signal called clock. The clock designer the regular time intervals called clock cycles. • To execute a machine instruction the processor divides the action to be performed into a sequence of basic steps that each step can be completed in one clock cycle. • The length P of one clock cycle is an important parameter that affects the processor performance.
  • 15. Basic Performance Equation • Let ‘T’ be the processor time required to execute a program that has been prepared in some high-level language. • The number N is the actual number of instruction execution and is not necessarily equal to the number of machine cycle instructions in the object program. • The average number of basic steps needed to execute one machine cycle instruction is S, where each basic step is completed in one clock cycle. • If clock rate is ‘R’ cycles per second, 𝑇 = 𝑁 ∗ 𝑅 𝑆
  • 16. Clock rate These are two possibilities for increasing the clock rate ‘R’. • Improving the IC technology makes logical circuit faster, which reduces the time of execution of basic steps. • Reducing the amount of processing done in one basic step also makes it possible to reduce the clock period P. Increase in the value ‘R’ that is entirely caused by improvements in IC technology affects all aspects of the processor’s operation equally with the exception of the time it takes to access the main memory.
  • 17. Performance measurements • It is very important to be able to access the performance of a computer, computer designers use performance estimates to evaluate the effectiveness of new features. • In spite of the performance equation being so simple, the evaluation of ‘T’ is highly complex. • Hence measurement of computer performance using bench mark programs is done to make comparisons possible, standardized programs must be used. • The performance measure is the time taken by the computer to execute a given bench mark.
  • 18. The same program is also compiled and run on one computer selected as reference. 𝑺𝑷𝑬𝑪 𝒓𝒂𝒕𝒊𝒏𝒈 = 𝑹𝒖𝒏𝒏𝒊𝒏𝒈 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒕𝒉𝒆 𝒓𝒆𝒇𝒆𝒓𝒆𝒏𝒄𝒆 𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓 𝑹𝒖𝒏𝒏𝒊𝒏𝒈 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒕𝒉𝒆 𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓 𝒖𝒏𝒅𝒆𝒓 𝒕𝒆𝒔𝒕 If the SPEC(Standard Performance Evaluation Corporation.) rating = 50 Means that the computer under test is 50 times as fast as the ultra sparc 10. Let SPECi be the rating for program ‘i’ in the suite. The overall SPEC rating for the computer is given by 𝑺𝑷𝑬𝑪 𝒓𝒂𝒕𝒊𝒏𝒈 = 𝒊=𝟏 𝒏 𝑨𝒌𝑺𝑷𝑬𝑪𝒊 𝟏 𝒏
  • 19. Memory Location and Addresses • The memory consists of many millions of storage cells, each of which can store a bit of information having the value 0 or 1. • Modern computers have word lengths that typically range from 16 to 64 bits. • If the word length of a computer is 32 bits, a single word can store a 32- bit 2’s complement number or four ASCII characters, each occupying 8 bits. • It is customary to use numbers from 0 through 2K-1, for some suitable values of k, as the addresses of successive locations in the memory. • 24-bit address generates an address space of 224 (16,777,216) locations. A 32-bit address creates an address space of 232 or 4G (4 Giga) locations.
  • 20. Byte Addressability: • We now have three basic information quantities to deal with: the bit, byte and word. Fig: Memory words Fig: A signed integer Fig: Four characters
  • 21. Big-Endian and Little-Endian Assignments: • The name big-endian is used when lower byte addresses are used for the more significant bytes (the left most bytes) of the word. • The name little-endian is used for the opposite ordering, where the lower byte addresses are used for the less significant bytes (the right most bytes) of the word.
  • 22. Word Alignment: In the case of a 32-bit word length, natural word boundaries occur at addresses 0, 4, 8, …, We say that the word locations have aligned addresses. In general, words are said to be aligned in memory if they begin at a byte address that is a multiple of the number of bytes in a word. Accessing Numbers, Characters, and Character Strings: A number usually occupies one word. It can be accessed in the memory by specifying its word address. Similarly, individual characters can be accessed by their byte address. In many applications, it is necessary to handle character strings of variable length. The beginning of the string is indicated by giving the address of the byte containing its first character. “end of string”
  • 23. Memory Operations • Load (or Read or Fetch) and Store (or Write). • The load operation transfers a copy of the contents of a specific memory location to the processor. • The store operation transfers an item of information from the processor to a specific memory location Instruction and Instruction sequencing: • Data transfers between the memory and the processor registers • Arithmetic and logic operations on data • Program sequencing and control • I/O transfers
  • 24. Register Transfer Notation: • Transfer of information from one location in the computer to another. • Most of the time, we identify a location by a symbolic name standing for its hardware binary address. • LOC, PLACE, A, VAR2; processor registers names may be R0, R5; and I/O register names may be DATAIN, OUTSTATUS, and so on. R1← [LOC] • Means that the contents of memory location LOC are transferred into processor register R1. R3← [R1] + [R2] • operation that adds the contents of registers R1 and R2, and then places their sum into register R3.
  • 25. Assembly Language Notation: Move LOC, R1 an instruction that causes the transfer described above, from memory location LOC to processor register R1, The contents of LOC are unchanged by the execution of this instruction, but the old contents of register R1 are overwritten. Add R1, R2, R3 adding two numbers contained in processor registers R1 and R2 and placing their sum in R3 can be specified by the assembly language statement
  • 26. Basic Instructions: • The operation of adding two numbers is a fundamental capability in any computer. The statement C=A+B • In a high-level language program is a command to the computer to add the current values of the two variables called A and B, and to assign the sum to a third variable, C. C← [A] + [B] • assume that this instruction contains the memory addresses of the three operands – A, B, and C. This three-address instruction can be represented symbolically as Add A, B, C
  • 27. • Operands A and B are called the source operands, C is called the destination operand, and Add is the operation to be performed on the operands. A general instruction of this type has the format. Operation Source1, Source 2, Destination • Suppose that two- address instructions of the form Operation Source, Destination • Are available. An Add instruction of this type is Add A, B • Which performs the operation? B← [A] + [B]
  • 28. • The problem can be solved by using another two-address instruction that copies the contents of one memory location into another. Such an instruction is Move B, C • Using only one-address instructions, the operation C← [A] + [B] can be performed by executing the sequence of instructions Load A Add B Store C • Let Ri represent a general-purpose register. The instructions Load A, Ri Store Ri, A and Add A, Ri
  • 29. • In processors where arithmetic operations are allowed only on operands that are processor registers, the C = A + B task can be performed by the instruction sequence Move A, Ri Move B, Rj Add Ri, Rj Move Rj, C • In processors where one operand may be in the memory but the other must be in register, an instruction sequence for the required task would be Move A, Ri Add B, Ri Move Ri, C
  • 30. Instruction Execution and Straight-Line Sequencing: • The three instructions of the program are in successive word locations, starting at location i. since each instruction is 4 bytes long, the second and third instructions start at addresses i + 4 and i + 8. • Then, the processor control circuits use the information in the PC to fetch and execute instructions, one at a time, in the order of increasing addresses, this is called straight-line sequencing.
  • 31. Branching: A straight-line program for adding n numbers Using a loop to add n numbers Branch > 0 LOOP
  • 32. Condition Codes: • The processor keeps track of information about the results of various operations for use by subsequent conditional branch instructions. • This is accomplished by recording the required information in individual bits, often called condition code flags. • These flags are usually grouped together in a special processor register called the condition code register or status register. Individual condition code flags are set to 1 or cleared to 0, • N(negative) Set to 1 if the result is negative; otherwise, cleared to • Z(zero) Set to 1 if the result is 0; otherwise, cleared to 0 • V(overflow) Set ot1 if arithmetic overflow occurs; otherwise, cleared to 0 • C(carry) Set to 1 if a carry-out results from the operation; otherwise, cleared to 0
  • 33. Generating Memory Addresses: • The purpose of the instruction block at LOOP is to add a different number from the list during each pass through the loop. • the Add instruction in the block must refer to a different address during each pass. • The memory operand address cannot be given directly in a single Add instruction in the loop. Otherwise, it would need to be modified on each pass through the loop. • The instruction set of a computer typically provides a number of such methods, called addressing modes.
  • 35. Implementation of Variable and Constants: • Register mode: The operand is the contents of a processor register; the name (address) of the register is given in the instruction. • Absolute mode: The operand is in a memory location; the address of this location is given explicitly in the instruction. Move LOC, R2 The Absolute mode can represent global variables in a program. A declaration such as Integer A, B; • Immediate mode: The operand is given explicitly in the instruction. For example, the instruction Move 200immediate, R0 or Move #200, R0
  • 36. Indirection and Pointers: • Indirect mode: The effective address of the operand is the contents of a register or memory location whose address appears in the instruction Where B is a pointer variable. This statement may be compiled into Move B, R1 Move (R1), A Using indirect addressing through memory, the same action can be achieved with Move (B), A
  • 38. Indexing and Arrays: • Index mode: the effective address of the operand is generated by adding a constant value to the contents of a register. X (Ri) Where X denotes the constant value contained in the instruction and Ri is the name of the register involved. The effective address of the operand is given by EA = X + [Rj] The contents of the index register are not changed in the process of generating the effective address. In an assembly language program, the constant X may be given either as an explicit number or as a symbolic name
  • 39. R1, contains the address of a memory location value X defines an offset from this address to the location where the operand is found the constant X corresponds to a memory address, and the contents of the index register define the offset to the operand.
  • 40. Relative Addressing: • Relative mode: The effective address is determined by the Index mode using the program counter in place of the general-purpose register Ri • This mode can be used to access data operands. But, its most common use is to specify the target address in branch instructions. An instruction such as Branch > 0 LOOP • Causes program execution to go to the branch target location identified by the name LOOP if the branch condition is satisfied. • This location can be computed by specifying it as an offset from the current value of the program counter.
  • 41. • Auto increment mode: the effective address of the operand is the contents of a register specified in the instruction. After accessing the operand, the contents of this register are automatically to point to the next item in a list. (Ri)+ • Auto decrement mode: the contents of a register specified in the instruction are first automatically decremented and are then used as the effective address of the operand. -(Ri)
  • 42. The Auto increment addressing mode used in the program
  翻译: