COA Unit 1 Notes
COA Unit 1 Notes
Unit 1 Notes
Unit 1-Syllabus
Introduction:
Functional units of digital system and their interconnections, buses, bus architecture, types of
buses and bus arbitration. Register, bus and memory transfer. Processor organization, general
registers organization, stack organization and addressing modes
BOOKS:
1. Computer System Architecture- Third Edition By M. Morris Mano
2. Computer Organization And Architecture-Designing For Performance, Eighth Edition
By William Stallings
3. Computer Organization And Embedded Systems, Sixth Edition, By Carl Hamacher,
Zvonko Vranesic, Safwat Zaky, Naraig Manjikian.
Compiled by‐ Mukesh Raj Page 1
COMPUTER
Computer is an electronic device that processes the data.
Computer is an electronic digital device that takes input from input device, processes that
input and sends the result to the output device.
Functions of a computer:
Data Processing
Data Storage
Data Movement
Control
Types of computer
Analog
Digital
Analog vs. Digital Computer
Analog Computers work on the analog signals.
Analog signals are continuous in nature.
Digital computers work on digital signals.
The digital signals are discrete in nature.
Image [1]
Embedded computers
Embedded computers are integrated into a larger device or system in order to
automatically monitor and control a physical process or environment.
They are used for a specific purpose rather than for general processing tasks.
Typical applications include industrial and home automation, appliances,
telecommunication products, and vehicles.
Personal computers
Personal computers are used in homes, educational institutions, and business and
engineering office settings, primarily for dedicated individual use.
They support a variety of applications such as general computation, document
preparation, computer-aided design, audiovisual entertainment, interpersonal
communication, and Internet browsing.
Compiled by‐ Mukesh Raj Page 3
COMPUTER ORGANIZATION vs. COMPUTER ARCHITECTURE
Computer Architecture:
Computer architecture refers to those attributes of a system visible to a programmer or those
attributes that have a direct impact on the logical execution of a program.
Examples of architectural attributes include the instruction set, the number of bits used to
represent various data types (e.g., numbers, characters), I/O mechanisms, and techniques for
addressing memory.
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, such as control signals; interfaces between the computer and
peripherals; and the memory technology used.
Compiled by‐ Mukesh Raj Page 4
Computer Architecture Models:
There are two basic types of architecture.
• Von-Neumann Architecture
• Harvard Architecture
Von-Neumann Architecture:
Instruction and data use the same signal pathways and memory.
It uses Stored Program Principle. Example: PC
Harvard Architecture:
Harvard Architecture uses the physically separate storage and signal pathways for their
instructions and data
Example Micro controller based Computer
Von-Neumann Architecture
Input Unit: Computers accept coded information through input units. Examples of input
devices are keyboard, touchpad, mouse, joystick, trackball, microphones and, cameras.
Output Unit: With the help of output unit computer results can be provided to the user.
Examples of output devices are printer, plotter, speaker, and graphic displays
Central Processing Unit: Controls the operation of the computer and performs the
processing functions. Processor has the following components:
ALU: performs the data processing functions such as execution of arithmetic and
logic operations.
CU: controls the operations of the CPU.
Registers: provide internal storage to CPU as temporary storage of data.
Internal interconnection: some communication mechanism among ALU, CU and
registers
Secondary memories are another kind of memories used for the permanent storage of the data
and program. Examples of secondary memories are Hard disk, floppy disk, magnetic tapes,
and optical disks.
Non-volatile memory is computer memory that can retain the stored information even
when not powered. Examples of non-volatile memory include read-only memory (see
ROM), flash memory, most types of magnetic computer storage devices (e.g. hard
disks, floppy disc and magnetic tape), and optical disc.
System interconnection: An interconnection network provides the means for the functional
units to exchange information and coordinate their actions. Example: system bus.
Compiled by‐ Mukesh Raj Page 7
INTERCONNECTION SYSTEM
Interconnection System:
Memory to processor
Processor to memory
I/O to processor
Processor to I/O
I/O to or from memory
Memory to processor: The processor reads an instruction or a unit of data from memory.
Processor to memory: The processor writes a unit of data to memory.
I/O to processor: The processor reads data from an Input device via an I/O module.
Processor to I/O: The processor sends data to the output device an I/O module.
I/O to or from memory: For these two cases, an I/O module is allowed to exchange data
directly with memory, without going through the processor, using direct memory access
(DMA).
BUS System:
Typically, a bus consists of multiple communication pathways, or lines. Each line is capable
of transmitting signals representing binary 1 and binary 0. Over time, a sequence of binary
digits can be transmitted across a single line. Taken together, several lines of a bus can be
used to transmit binary digits simultaneously (in parallel).
For example, an 8-bit unit of data can be transmitted over eight bus lines.
Computer systems contain a number of different buses that provide pathways between
components at various levels of the computer system hierarchy.
Compiled by‐ Mukesh Raj Page 8
System Bus:
A bus that connects major computer components (processor, memory, I/O) is called a system
bus. The most common computer interconnection structures are based on the use of one or
more system buses.
Bus Structure
A system bus consists, typically, hundreds of separate lines. Each line is assigned a particular
meaning or function. Although there are many different bus designs, on any bus the lines can
be classified into three functional groups
• Data Lines.
• Address Lines.
• Control Lines.
In addition, there may be power distribution lines that supply power to the attached modules.
Data Lines:
The data lines provide a path for moving data among system modules. These lines,
collectively, are called the data bus. The data bus may consist of 32, 64, 128, or even more
separate lines, the number of lines being referred to as the width of the data bus.
The width of the data bus is a key factor in determining overall system performance. For
example, if the data bus is 32 bits wide and each instruction is 64 bits long, then the processor
must access the memory module twice during each instruction cycle.
Address Lines
The address lines are used to designate the source or destination of the data on the data bus.
For example, if the processor wishes to read a word (8, 16, or 32 bits) of data from memory,
Control Lines
The control lines are used to control the access to and the use of the data and address lines.
Because the data and address lines are shared by all components, there must be a means of
controlling their use. Control signals transmit both command and timing information among
system modules.
Timing signals indicate the validity of data and address information. Command signals
specify operations to be performed.
Memory write: Causes data on the bus to be written into the addressed location
Memory read: Causes data from the addressed location to be placed on the bus
I/O write: Causes data on the bus to be output to the addressed I/O port
I/O read: Causes data from the addressed I/O port to be placed on the bus
Transfer ACK: Indicates that data have been accepted from or placed on the bus
Bus request: Indicates that a module needs to gain control of the bus
Bus grant: Indicates that a requesting module has been granted control of the bus
Interrupt request: Indicates that an interrupt is pending
Interrupt ACK: Acknowledges that the pending interrupt has been recognized
Clock: Is used to synchronize operations
Reset: Initializes all modules
Bus Operation:
The operation of the bus is as follows. If one module wishes to send data to another, it must
do two things:
If one module wishes to request data from another module, it must (1) obtain the use of the
bus, and (2) transfer a request to the other module over the appropriate control and address
lines. It must then wait for that second module to send the data.
Compiled by‐ Mukesh Raj Page 10
Bus Types:
Dedicated
Multiplexed.
A dedicated bus line is permanently assigned either to one function or to a physical subset of
computer components.
Functionally Dedicated
An example of functional dedication is the use of separate dedicated address and data lines.
Physically Dedicated
Physical dedication refers to the use of multiple buses, each of which connects only a subset
of modules.
A typical example is the use of an I/O bus to interconnect all I/O modules; this bus is then
connected to the main bus through some type of I/O adapter module.
The potential advantage of physical dedication is high throughput, because there is less bus
contention.
Multiplexed Bus:
For example, address and data information may be transmitted over the same set of lines
using an Address Valid control line. At the beginning of a data transfer, the address is placed
on the bus and the Address Valid line is activated. At this point, each module has a specified
period of time to copy the address and determine if it is the addressed module. The address is
then removed from the bus, and the same bus connections are used for the subsequent read or
write data transfer. This method of using the same lines for multiple purposes is known as
time multiplexing.
The advantage of time multiplexing is the use of fewer lines, which saves space and, usually,
cost.
Compiled by‐ Mukesh Raj Page 11
The disadvantage is that more complex circuitry is needed within each module. Also, there is
a potential reduction in performance because certain events that share the same lines cannot
take place in parallel.
TIMING
Timing refers to the way in which events are coordinated on the bus. Buses use either
synchronous timing or asynchronous timing.
Synchronous Timing
With synchronous timing, the occurrence of events on the bus is determined by a clock.
The bus includes a clock line upon which a clock transmits a regular sequence of alternating
1s and 0s of equal duration.
A single 1–0 transmission is referred to as a clock cycle or a bus cycle and defines a time
slot. All other devices on the bus can read the clock line, and all events start at the beginning
of a clock cycle.
Compiled by‐ Mukesh Raj Page 12
In this simple example,
The processor places a memory address on the address lines during the first clock cycle and
may assert various status lines.
Once the address lines have stabilized, the processor issues an address enable signal.
The processor issues a read command at the start of the second cycle. A memory module
recognizes the address and, after a delay of one cycle, places the data on the data lines. The
processor reads the data from the data lines and drops the read signal.
The processor puts the data on the data lines at the start of the second cycle, and issues a
write command after the data lines have stabilized.
The memory module copies the information from the data lines during the third clock cycle.
Asynchronous Timing
With asynchronous timing, the occurrence of one event on a bus follows and depends on the
occurrence of a previous event.
Compiled by‐ Mukesh Raj Page 13
For Read Operation:
In the simple read example of the shown image (a),
The processor places address and status signals on the bus.
After pausing for these signals to stabilize, it issues a read command, indicating the presence
of valid address and control signals.
The appropriate memory decodes the address and responds by placing the data on the data
line.
Once the data lines have stabilized, the memory module asserts the acknowledged line to
signal the processor that the data are available.
Once the master has read the data from the data lines, it deasserts the read signal. This causes
the memory module to drop the data and acknowledge lines.
Finally, once the acknowledge line is dropped; the master removes the address information.
For Write Operation
Image (b) shows a simple asynchronous write operation.
In this case, the master places the data on the data line at the same time that is puts signals on
the status and address lines.
The memory module responds to the write command by copying the data from the data lines
and then asserting the acknowledge line.
The master then drops the write signal and the memory module drops the acknowledge
signal.
Synchronous timing is simpler to implement and test. However, it is less flexible than
asynchronous timing. Because all devices on a synchronous bus are tied to a fixed clock rate,
the system cannot take advantage of advances in device performance.
With asynchronous timing, a mixture of slow and fast devices, using older and newer
technology, can share a bus.
Compiled by‐ Mukesh Raj Page 14
BUS ARBITRATION
Arbitration
There are occasions when two or more entities contend for the use of a single resource in
a computer system. For example, two devices may need to access a given slave at the same
time.
In such cases, it is necessary to decide which device will access the slave first. The decision
is usually made in an arbitration process performed by an arbiter circuit. The arbitration
process starts by each device sending a request to use the shared resource. The arbiter
associates priorities with individual requests. If it receives two requests at the same time, it
grants the use of the slave to the device having the higher priority first.
To illustrate the arbitration process, we consider the case where a single bus is the shared
resource. The device that initiates data transfer requests on the bus is the bus master. It is
possible that several devices in a computer system need to be bus masters to transfer data. For
example, an I/O device needs to be a bus master to transfer data directly to or from the
computer’s memory. Since the bus is a single shared facility, it is essential to provide orderly
access to it by the bus masters.
A device that wishes to use the bus sends a request to the arbiter. When multiple requests
arrive at the same time, the arbiter selects one request and grants the bus to the corresponding
device.
Compiled by‐ Mukesh Raj Page 15
Centralized Bus Arbitration Techniques:
Daisy Chaining Method
Polling Method
Independent Request Method
The priority of bus masters is rigid and depends on the physical proximity of the bus masters
with the bus arbiter i.e. The one nearest to the Bus Arbiter gets the highest priority. Therefore, it
has poor performance.
The bus is granted serially and hence a propagation delay is induced in the circuit. Therefore, it
has poor priority mechanism.
Failure of one of the devices may fail the entire system. Therefore, it has poor reliability.
Advantages
This method is also quite simple.
The priority is flexible and can easily be changed by altering the polling sequence.
If one module fails, the entire system does not fail.
Disadvantages
Adding more bus masters is difficult as it increases the number of address lines of the
circuit. E.g: In the above circuit to add the 9th Bus Master we need 4 address lines.
Time Consuming
Non productive polling sequence: the arbiter generated the polling sequence for the
module which did not request the bus.
The number of control lines required is more (2n line required for n devices).
Hardware cost is high as large number. of control lines is required.
Register Transfer:
Information transfer from one register to another is designated in symbolic form by means of
a replacement operator. The statement
R2 R1
denotes a transfer of the content of register R1 into register R2. It designates a replacement of
the content of R2 by the content of R l. By definition, the content of the source register R1
does not change after the transfer. A statement that specifies a register transfer implies that
circuits are available from the outputs of the source register to the inputs of the
destination register and that the destination register has a parallel load capability.
Compiled by‐ Mukesh Raj Page 19
Normally, we want the transfer to occur only under a predetermined control condition. This
can be shown by means of an if-then statement.
Memory Transfer:
Memory Read:
Consider a memory unit that receives the address from a register, called the address register,
symbolized by AR. The data are transferred to another register, called the data register,
symbolized by DR . The read operation can be stated as follows:
Read: DR M [AR]
This causes a transfer of information into DR from the memory word M selected by the
address in AR.
Memory Write:
The write operation transfers the content of a data register to a memory word M selected by
the address register.
Write: M [AR] DR
Compiled by‐ Mukesh Raj Page 21
Encoder and Decoder
An encoder is combinational circuit that accepts an active (or high or 1) on one of its 2n
inputs and converts/ encodes it into n-bit binary coded output.
A decoder is a combinational circuit that converts/decodes n-bit binary input to one of its 2n
outputs.
For both the encoders and decoders enable input E has the important role.
If Enable E =0 then encoder or decoder is in inactive state
If Enable E =1 then encoder or decoder is in active state
4x1 Mux:
Applications of de-multiplexers:
Communication system
Telephone networks
Serial to Parallel conversion
BUS transfer
A typical digital computer has many registers, and paths must be provided to transfer
information from one register to another. A more efficient scheme for transferring
information between registers in a multiple-register configuration is a common bus system.
A bus structure consists of a set of common lines, one for each bit of a register, through
which binary information is transferred one at a time. Control signals determine which
register is selected by the bus during each particular register transfer.
Common Bus Structure can be implemented by:
BUS System Using Multiplexers
BUS System Using Tri-State Buffer
Two of the states are signals equivalent to logic 1 and 0 as in a conventional gate. The third
state is a high-impedance state. The high-impedance state behaves like an open circuit, which
means that the output is disconnected and does not have logic significance. The graphic
symbol of a three-state buffer gate is shown
Question:
Construct a common bus with three-state buffers for 4 registers of 2-bit each. Or
Calculate the following for a common bus with three-state buffers for 4 registers of 2-bit
each.
Number of stages= size of register =2
Number of tri-state buffers used for a single stage =number of registers =4
Number of decoders used= number of stages = size of register =2
Number of output lines in a decoder = number of tristate buffer in a stage= number of
registers =4
Size of decoder = n x number of register = n x 4
Size of decoder = 2 x 4
Selection Table:
The outputs of four buffers are connected together to form a single bus line. The control
inputs to the buffers determine which of the four normal inputs will communicate with the
bus line.
No more than one buffer may be in the active state at any given time. One way to ensure that
no more than one control input is active at any given time is to use a decoder.
When the enable input of the decoder is 0, all of its four outputs are 0, and the bus line is in a
high-impedance state because all four buffers are disabled. When the enable input is active,
one of the three-state buffers will be active, depending on the binary value in the select inputs
of the decoder.
To construct a common bus for four registers of n bits each using three state buffers, we need
n circuits with four buffers in each. Each group of four buffers receives one significant bit
from the four registers. Each common output produces one of the lines for the common bus
for a total of n lines. Only one decoder is necessary to select between the four registers.
Register organization:
User-visible registers
Control and status registers
Condition codes
A final category of registers, which is at least partially visible to the user, holds condition
codes (also referred to as flags). Condition codes are bits set by the processor hardware as the
Compiled by‐ Mukesh Raj Page 33
result of operations. For example, an arithmetic operation may produce a positive, negative,
zero, or overflow result
Compiled by‐ Mukesh Raj Page 34
GENERAL REGISTER ORGANIZATION
When a large number of registers are included in the CPU, it is most efficient to connect them
through a common bus system. The registers communicate with each other not only for direct
data transfers, but also while performing various microoperations. Hence it is necessary to
provide a common unit that can perform all the arithmetic, logic, and shift microoperations in
the processor.
A bus organization for seven CPU registers is shown in the following figure:
Steps:
1. The output of each register is connected to two multiplexers (MUX A and MUX B) to
form the two buses A and B. [Each Mux have 8 inputs: 7 Registers and 1 Input]
2. The selection lines in each multiplexer select one register or the input data for the
particular bus.
The three bits of SELA select a source input for the A input of the ALU.
The three bits of SELB select a source input for the B input of the ALU.
Compiled by‐ Mukesh Raj Page 35
3. The A and B buses form the inputs to a common arithmetic logic unit (ALU). The
operation selected in the ALU determines the arithmetic or logic microoperation that
is to be performed. The five bits of OPR select one of the operations in the ALU.
4. The result of the microoperation is available for output data and also goes into the
inputs of all the registers.
5. The register that receives the information from the output bus is selected by a 3*8
decoder.
6. The decoder activates one of the register loads inputs, thus providing a transfer path
between the data in the output bus and the inputs of the selected destination register.
The three bits of SELD select a destination register.
The control unit that operates the CPU bus system directs the information flow through the
registers and ALU.
Control Word:
Control word specifies the binary selection inputs in the unit. For this example of 8 inputs(7
register one external input) and given 5 operation bits, the control word has been shown
below.
The length of control word = 3+3+3+5= 14 bits
Question:
A bus organized CPU which has 64 Registers with 8 bits in each, an ALU, and a destination
decoder. Solve the following:
a. How many multiplexers are there in a common bus?
b. What is the size of each multiplexer?
c. How many selection inputs are needed for MUX A and MUX B?
d. How many inputs and outputs are in decoder?
Formulate the control word for the system assuming the ALU has 127 operations.
Compiled by‐ Mukesh Raj Page 37
Compiled by‐ Mukesh Raj Page 38
STACK ORGANIZATION
What is Stack?
A stack is a list of data elements, usually words, with the accessing restriction that elements
can be added or removed at one end of the list only. This end is called the top of the stack,
and the other end is called the bottom.
The following figure shows the example stack of 4 books.
A stack is a storage device that stores information in such a manner that the item stored
last is the first item retrieved.
Last-in–First-out (LIFO) Principle: The last data item placed on the stack is the first one
removed when retrieval begins. In other way, we may call it as First-in-Last out (FILO)
principle; the first data item placed on the stack will be removed in the last.
The structure is sometimes referred to as a pushdown stack.
Compiled by‐ Mukesh Raj Page 39
A register is used to store the address of the topmost element of the stack which is known as
Stack pointer (SP). The stack pointer register SP contains a binary number whose value is
equal to the address of the element that is currently on top of the stack.
REGISTER STACK:
A stack can be placed in a portion of a large memory or it can be organized as a
collection of a finite number of memory words or registers.
Two one-bit registers namely FULL and EMPTY will be used to get the status of
stack such as whether the stack if full (containing all the elements according to the
capacity) or empty (containing no element).
Numbering for N registers in a register stack: 0 to (N-1).
Example: the registers will be number from 0 to 7 in 8-register stack.
Overflow: An error condition occurs during insertion a new element when stack is full.
This condition is called overflow)
Underflow: An error condition occurs during removal of an element when stack is
empty. This condition is also called underflow)
Compiled by‐ Mukesh Raj Page 40
FULL is a one-bit flag register for showing the status of stack whether it is Full (containing
all 64 elements) or not.
FULL=0 (Stack is not full)
FULL=1 (Stack is full)
EMPTY is also a one-bit flag register for showing the status of stack whether it is Empty
(containing no element) or not
EMPTY =0 (Stack is Not empty)
EMPTY = 1 (Stack is Empty)
DR is the data register that holds the binary data to be written in to or read out of the stack.
Initially:
FULL=0
EMPTY=1
SP=0
The above figure shows the organization of a 64-word register stack. The stack pointer
register SP contains a binary number whose value is equal to the address of the element that
is currently on top of the stack.
2k = N
K= ⌊log2 (N) ⌋ + 1
Example: In a 64-word stack, the stack pointer contains 6 bits because 26 =64
Initially, SP is cleared to 0, Empty is set to 1, and Full is cleared to 0, so that SP points to the
word at address 0 and the stack is marked empty and not full. If the stack is not full, a new
item is inserted with a push operation.
Compiled by‐ Mukesh Raj Page 41
PUSH Operation: The push operation is implemented with the following sequence of micro-
operations.
Note:
The first item stored in the stack is at address 1.
The second last (or prior to last) item stored in the stack is at address 63.
The last item is stored at address 0
Initially, SP points to 0. The first item stored in the stack is at address 1. The last item is
stored at address 0, if SP reaches 0; the stack is full of item, so FULL is set to 1. This
condition is reached if the top item prior to the last push was in location 63 and after
increment SP, the last item stored in location 0. Once an item is stored in location 0, there are
no more empty register in the stack. If an item is written in the stack, obviously the stack
cannot be empty, so EMTY is cleared to 0.
Compiled by‐ Mukesh Raj Page 42
The following figure shows the Stack after inserting item ‘A’
The following figure shows the Stack after inserting item ‘B’
Compiled by‐ Mukesh Raj Page 43
The following figure shows the Stack after inserting item ‘C’
Three items are placed in the stack: A, B, and C in the order. Item C is on the top of the stack
so the SP points to address 3.
How does a stack pointer move across the ends of the stack?
The subtraction in digital computer system will be done using 2’s complement method. So, the
subtraction will be converted into binary addition like
SP = SP + (-1)
SP = SP + 2’s complement (+1)
= 000000 + 111111
= 111111
=63
Compiled by‐ Mukesh Raj Page 44
Compiled by‐ Mukesh Raj Page 45
POP Operation: The pop operation is implemented with the following sequence of micro-
operations.
DR← M [SP] (Read item from the top of stack)
SP ← SP-1 (Decrement stack Pointer)
If (SP=0) then (Empty ← 1) (Check if stack is empty)
FULL ← 0 (Mark the stack not full)
The top item is read from the stack into DR. The stack pointer is then decremented. If its
value reaches zero, the stack is empty, so Empty is set to 1. This condition is reached if the
item read was in location 1. Once this item is read out, SP is decremented and reaches the
value 0, which is the initial value of SP.
Note that if a pop operation reads the item from location 0 and then SP is decremented, SP
changes to 111111, which is equal to decimal 63. In this configuration, the word in address 0
receives the last item in the stack. Note also that an erroneous operation will result if the stack
is pushed when FULL=1 or popped when EMTY =1.
Example of removal of an element or pop operation:
1. To remove the top item, the stack is popped by reading the memory word at address 3 and
decrementing the content of SP. Item B is now on top of the stack since SP holds address
2. Note that item C has read out but not physically removed. But it is logically out of the
stack. This does not matter because when the stack is pushed, a new item is written in its
place.
MEMORY STACK:
A stack can exist as a stand-alone unit or can be implemented in a random access memory
attached to CPU. The implementation of a stack in the CPU is done by assigning a portion of
memory to a stack operation and using a processor register as a Stack Pointer.
Compiled by‐ Mukesh Raj Page 46
Figure given below shows a portion of computer memory partitioned in to three segments
program, data and stack.
The Program Counter PC points at the address of the next instruction in the program.
The Address Register AR points at an array of data.
The Stack Pointer SP points at the top of the stack.
The three register are connected to a common address bus, and either one can provide an
address for memory. PC is used during the fetch phase to read an instruction. AR is used
during the execute phase to read an operand. SP is used to push or POP items into or from the
stack.
The initial value of SP is 4001 and the stack grows with decreasing addresses. Thus the first
item stored in the stack is at address 4000, the second item is stored at address 3999, and the
last address that can be used for the stack is 3000. No provisions are available for stack limit
checks. We assume that the items in the stack communicate with a data register DR.
Push Operation:
A new item is inserted with the push operation as follows.
SP← SP-1 (Decrement stack Pointer)
M [SP] ← DR (Write item on top of the stack)
Most computers do not provide hardware to check for stack overflow (FULL) or underflow
(Empty). The stack limit can be checked by using two processor register:
One to hold upper limit and other hold the lower limit. After the pop or push operation SP is
compared with lower or upper limit register.
Note:
In case of memory stack, stack may grow in direction of increasing addresses or decreasing
addresses of memory. It depends on the design of the system.
Compiled by‐ Mukesh Raj Page 48
Addressing Modes:
The operation field of an instruction specifies the operation to be performed. This operation
will be executed on some data which is stored in computer registers or the main memory.
The way any operand is selected during the program execution is dependent on the
addressing mode of the instruction. The purpose of using addressing modes is as follows:
To give the programming versatility to the user.
To reduce the number of bits in addressing field of instruction.
The addressing mode specifies a rule for interpreting or modifying the address field of
the instruction before the operand is actually referenced.
Simple instruction format:
Auto-decrement
NOTE: EffectiveAddressing
Address Mode
is the location where operand is present.
( ) parentheses denotes “the content of ”
Register Mode
In this mode the operand is stored in the register and this register is present in CPU. The
instruction has the address of the Register where the operand is stored.
The content of register will be operand in the register addressing mode
If the content of the register address field in an instruction is 5, then register R5 is intended
address, and the operand value is contained in R5.
Advantages
Shorter instructions and faster instruction fetch.
Faster memory access to the operand
No memory reference
Disadvantages
Very limited address space