Coa Unit2
Coa Unit2
CONTENTS
Objectives
Introduction
An Overview of the CPU
General Register Organization
Stack Organization
Register Stack
Memory Stack
Instruction Format
Summary
Keywords
Self Assessment
Review Questions
Further Readings
Objectives
Did u know? CPU is an old term that was used for processor or multiprocessor.
Modern CPUs are called as integrated chips. It is so called because several
types of components such as execution core, Arithmetic Logic Unit (ALU),
registers, instruction memory, cache memory, and the input/output controller
111
Keerti Thakur
112
Keerti Thakur
Notes
Example: Intel makes Pentium series of processors, whereas AMD makes the
Athlon and Duron processors.
An Overview of the CPU
Central Processing Unit (CPU) is the most important unit in a computer system. It
is the component which controls all internal and external devices as well as
performs arithmetic and logic operations to execute the set of instructions
stored in the computer’s memory.
A CPU comprises three major components. They are:
• Register Set
• ALU
• Control Unit (CU)
Register Set
The register set differs from one system to another. The register set
comprises many registers which include general purpose registers and special
purpose registers. The general purpose registers do not perform any specific
function. They store the temporary data that is required by a program. The
special purpose registers perform specific functions for the CPU.
113
Unit 7: Central Processing Unit
Notes
Figure 1 illustrates the components of the CPU.
As shown in figure .1, the CPU consists of the register set, ALU, and CU.
The CPU interacts with the main memory and input/output devices. The
CPU reads and writes data to and from the memory system and transfers data
to and from the I/O devices.
A simple execution cycle in the CPU can be described as below:
1. The CPU fetches the instruction to be executed from the main memory
and stores it in the Instruction Register (IR).
2. The instruction is decoded.
3. The operands are fetched from the memory system and stored in the CPU
registers.
4. The instructions are then executed.
5. The results are transferred from the CPU registers to the memory system.
113
Unit 7: Central Processing Unit
Notes Operand is the part of a computer instruction that is manipulated and operated.
In the addition of 5 + x, ‘5’ and ‘x’ are operands and ‘+’ is the operator.
If there are more instructions to be executed, the execution cycle repeats. Any
pending interrupts are also checked during the execution cycle.
Example: Suppose you need to execute an instruction that moves the contents
of register A to register B. If both the registers are connected to data bus C,
then the control unit issues a micro- order (control signal) to register A to
place its contents on the data bus C. Another micro-order is sent to register B
to read from data bus C. The control signals are activated either through
hardwired control or microprogramming.
Thus, CPU is the primary element of a computer system, which carries out
each instruction of a program to perform basic arithmetical, logical, and
input/output operations.
General Register Organization
A group of flip-flops form a register. A register is a special high speed storage
area in the CPU. They comprise combinational circuits that perform data
processing. The data is always represented in a register before processing.
The registers speed up the execution of programs.
Registers perform two important functions in the CPU operation. They are:
1. Providing a temporary storage area for data. This helps the currently
executing programs to have a quick access to the data, if needed.
2. Storing the status of the CPU as well as information about the currently
executing program.
Example: Address of the next program instruction, signals received from
the external devices and error messages, and such other information is stored
in the registers.
We know that referring to memory locations is considered difficult and time
consuming. Hence, storing the pointers, return addresses, temporary results,
and program counters into the register is more efficient than the memory. The
number of registers varies from one computer system to another.
114
Unit 7: Central Processing Unit
As observed in figure 2, the CPU bus system is operated by the control unit.
The control unit directs the information flow through the ALU by selecting
the function of the ALU as well as components of the system.
Consider R1 R2 + R3, the following are the functions performed within the CPU:
115
Unit 7: Central Processing Unit
Notes
The encoding of register selection fields are specified in table 1.
Table 1: Encoding of Register Selection Field
116
Unit 7: Central Processing Unit
Micro- SE SETable SE
7.3: ALU Micro-Operations
OP Control
oper ation LA LB LD R Word
R1 R2 – R2 R3 R1 SUB 010 011 001 001
R3 01
R4 R4 R4 R5 R4 OR 100 101 100 010
R5 10
R6 R6 + R6 - R6 INC 110 000 110 000
1 A 01
R7 R1 R7 - R1 TSF 001 000 111 000
A 00
Output R2 - Non TSF 010 000 000 000
R2 e A 00
Output Input - Non TSF 000 000 000 000
Input e A 00
R4 shl R4 - R4 SHL 100 000 100 110
R4 A 00
R5 0 R5 R5 R5 XO 101 101 101 011
R 00
117
Unit 7: Central Processing Unit
Types of Registers
There are many different types of register available in the market.
Some of them are:
1. Data Register: It is used to store data.
2. Accumulator Register: It is considered as a special data register.
3. Address Register: It holds the memory address.
4. Index Register: It holds the index of the memory address.
5. Condition Register: It determines whether the instruction should be
executed or not.
6. General Purpose Register: It stores data and addresses.
7. Special Purpose Register: It stores the status of the programs.
8. Floating Point Register: It is a kind of data register that stores the floating
point numbers.
9. Constant Register: It stores read-only values.
General purpose registers are also called as processor registers. These
processor registers provide the fastest means to access data.
Did u know? Processor register is mostly found at the top of the memory
hierarchy.
7.1 Stack Organization
Stack, also called as Last In First Out (LIFO) list, is the most useful feature in
the CPU. It stores information such that the item stored last is retrieved first.
Stack is a memory unit with an address register. This register holds the
address for the stack, which is called as Stack Pointer (SP). The stack pointer
always holds the address of the item that is placed at the top of the stack.
You can insert an item into or delete an item from the stack. The insertion
operation is called as push operation and the deletion operation is called as pop
operation. In a computer stack, these operations are simulated by incrementing
or decrementing the SP register.
7.1.1 Register Stack
Stack can be organized as a collection of memory words or registers. Consider a
64-word register stack organized as shown in figure 3.
The stack pointer register contains a binary number, which is the address of the
item present at the top of the stack. The three items A, B, and C are placed in
the stack. The item C is at the top of the stack and the stack pointer holds the
address of C that is, The top item is popped from the stack by reading memory
word at address 3 and decrementing the stack pointer by 1. Now, B is at the
top of the stack and the SP holds the address of B that is, 2. To insert a new
word, the stack is
118
Unit 7: Central Processing Unit
119
Unit 7: Central Processing Unit
Here, the stack pointer contains 6 bits, since 26 = 64, and the SP cannot exceed 63
(111111 in binary) because if 63 is incremented by 1, then the result is 0(111111
+ 1= 1000000). SP holds only the six least significant bits. If 000000 is
decremented by 1 then the result is 111111. Thus, when the stack is full, the
one bit register ‘FULL’ is set to 1. If the stack is empty, then the one bit
register ‘EMTY’ is set to 1. The data register DR holds the binary data
which is written into or read out of the stack.
First the SP is set to 0, EMTY is set to 1, and FULL is set to 0. Now, as the
stack is not full (FULL = 0), a new item is inserted using the push operation.
The push operation is performed as below:
SP SP + 1, stack pointer is incremented
K[SP] DR, place an item on the top of
the stack If (SP = 0) then (FULL 1),
check if stack is full
EMTY 0, if stack is full, then mark the stack as not empty
The stack pointer is incremented by 1 and the address of the next higher word
is stored in the SP. The word from DR is inserted into the stack using the
memory write operation. As per figure 5.3, the first item is stored at address 1
and the last item is stored at address 0. If the stack pointer is at 0, then the
stack is full and ‘FULL’ is set to 1. This is the condition when the SP was in
location 63 and after incrementing SP , the last item is stored at address 0. Once
an item is stored at address 0, there are no more empty registers in the stack.
The stack is full and the ‘EMTY’ is set to 0.
You can perform pop operation (deletion) only if the stack is not empty. To
delete an item from the stack, the following micro-operations are performed.
DR K[SP], an item is read from the top
120
Unit 7: Central Processing Unit
121
Unit 7: Central Processing Unit
Notes
! If stack is pushed when FULL = 1 or popped when EMTY = 1, you get an erroneous
Caution
result.
7.1.2 Memory Stack
Stack can be implemented in the CPU by allotting a portion of the computer
memory to a stack operation and using a processor register as a stack pointer.
In this case, it is implemented in a random access memory attached to the
CPU.
In figure 7.4, a portion of the computer memory is divided into three
segments: program, data and stack. The address of the next instruction in the
program is stored in the pointer Program Counter (PC). The Address Register
(AR) points to an array of the data. SP always holds the address of the item
present at the top of the stack. The three registers that are connected to the
common bus are PC, AR, and SP. PC is used to read the instruction during
fetch phase. An operand is read during execute phase using address register.
An item is pushed into or popped from the stack using stack pointer. Figure
4 depicts the memory stack.
In figure 4, the SP points to an initial value ‘2001’. Here, the stack grows
with decreasing addresses. The first item is stored at address 2000, the next
item is stored at address 1999 and the last item is stored at address 1000.
As we already know, data register is used to read an item into or from the stack.
122
Unit 7: Central Processing Unit
You use push operation to insert a new item into the stack.SP SP -1 K[SP] DR
123
Unit 7: Central Processing Unit
Notes To insert another item into the stack, the stack pointer is
decremented by 1 so that it points at the address of the next
location/word. A word from DR is inserted into the top of the
stack using memory write operation.
To delete an item from the stack, you need to use the pop operation:
DR K[SP]
SP SP + 1
The top item is read into the DR and then the stack pointer
is decremented to point to the next item in the stack.
Here, two processor registers are used to check the stack
limits. One processor register holds the upper limit (1000) and
the other holds the lower limit (2001). During push operation,
the SP is compared with the upper limit to check if the stack
is full. During pop operation, the SP is compared with the
lower limit to check if the stack is empty.
An item in the stack is pushed or popped using two micro-
operations. They are:
1. Accessing the memory through SP
2. Updating SP
A stack pointer is initially loaded with the bottom address of
the stack in memory. Thereafter, SP is automatically
incremented or decremented depending on the operation
performed (push or pop). As the address is automatically
updated in the stack pointer, the CPU can refer to the memory
stack without specifying the address.
7.2 Instruction Format
An instruction consists of a combination of operation codes
and operands that deal with the operation codes. Instruction
format basically provides the layout of bits in an instruction.
It includes fields such as opcode, operands, and addressing
mode. The instruction length is usually kept in multiples of
the character length, which is 8 bits. When the instruction
length is fixed, a number of bits are allocated to opcode,
operands, and addressing modes. The bits are distributed such
that if more number of bits is allocated to the opcode field,
then less number of bits are allocated to the operands and
addressing. The task of allocating bits in the instruction can be
simplified by considering the following factors:
1. Number of addressing modes
2. Number of operands
3. Number of CPU registers
124
Unit 7: Central Processing Unit
4. of register sets
Number of address lines
Figure 5 shows the general IA-32 (Intel Architecture- 32 bits)
instruction format. IA-32 is the instruction format that is used in
Intel’s most successful microprocessors. This instruction format
consists of four fields, namely opcode field, addressing mode
field, displacement field, and immediate field.
1 or 2 1 or 2 1 or 4 1 or
4 bytes bytes bytes
bytes
As shown in figure 7.5, the opcode field has 1 or 2 bytes. The addressing
mode field also includes 1 or 2 bytes. In the addressing mode field, an
instruction needs only one byte if it uses only one register to generate the
effective address of an operand. The field that immediately follows the
addressing mode field is the displacement field. If an effective address for a
memory operand is calculated using the displacement value, then it uses either
one or four bytes to encode. If an operand is an immediate value, then it is
placed in the immediate field and it occupies either one or four bytes.
Instructions in a computer can be of different lengths with varying number of
addresses. The number of address fields in the instruction format of a
computer varies according to the organization of its registers. Based on the
number of address fields the instruction can be classified as three address
instructions, two address instructions, one address instruction, and zero address
instruction.
125
Unit 7: Central Processing Unit
s
o
u
r
c
e
,
d
e
s
t
126
Unit 7: Central Processing Unit
ination ADD A,
Notes
B
where A and B are the two variables that are assigned to a distinct location
in the memory. ‘ADD’ is the operation that is performed on the operands. This
instruction adds the content of the variables A and B and stores the result in
variable B. Here, ‘A’ is the source operand and ‘B’ is considered as both source
and destination operands.
Here, bits are required to specify the two operands. n bit is required to specify one
operand (one memory address). Similarly, 2n bits are required to specify two
operands (two memory addresses). Bits are also required to specify the ADD
operation.
One Address Instruction
The general format of one address instruction is represented as:
operation source
ADD A
where A is the variable that is assigned to a distinct location in the memory.
‘ADD’ is the operation that is performed on the operand A. This instruction
adds the content of the variable A into the accumulator and stores the result in
the accumulator by replacing the content of the accumulator.
Some more examples of one address instructions are:
LOAD A: The content of memory location A is stored in the
accumulator. STORE B: The content of accumulator is stored
in the memory location B.
The operand in the instruction can either be the source or the destination,
depending on the instruction.
127
Unit 7: Central Processing Unit
Notes
Zero Address Instructions
The locations of the operands in zero address instructions are defined implicitly.
These instructions store operands in a structure called pushdown stack.
We now know that one address instruction uses less number of bits, whereas three
address instructions are uses more number of bits. Similarly, the three address
instructions require more memory access when compared to one address
instructions. Thus, three address instructions take more time to execute
instructions when compared to one address instructions.
To reduce the execution time of the instructions, it is advised to refer the
operands from the processor registers instead of referring the operands from
the memory.
128
Unit 7: Central Processing Unit
diagram.
Notes
3. “Stack can be implemented in the CPU by allotting a portion of the
computer memory to a stack operation and using a processor register as a
stack pointer.” Explain.
4. “Instruction format basically provides the layout of bits in an instruction”.
Discuss.
5. “The bits of the status register are modified according to the operations
performed in the ALU.” Discuss.
130
Unit 7: Central Processing Unit
Online links
www.mans.edu.eg/faceng/english/computers/PDFS/PDF4
/1.2.pdf www.ehow.com/list_7332165_types-addressing-
modes-computers.html
131
Unit 8: Addressing Modes
Notes
Unit 8: Addressing Modes
Objectives
After studying this unit, you will be able to:
• List the addressing modes
• Explain data transfer and manipulation process
• Discuss program control instructions
• Differentiate between RISC and CISC architecture
Introduction
In almost all CPU designs, addressing modes are a part of the instruction set
architecture. Various addressing modes are defined in a given instruction set
architecture. These addressing modes describe the procedure by which language
instructions in instruction set architecture identify the operands of each
instruction. We can specify how to calculate the effective memory address of an
operand by using addressing modes. This is done by using information held in
registers and/or constants contained within a machine instruction or elsewhere.
RISC and CISC are the two most commonly used instruction sets, which are discussed in this
unit.
8.1 Need for Addressing Modes
The operands of the instructions can be located either in the main memory or
the CPU registers. If the operand is placed in the main memory, then the
instruction provides the location address in the operand field. Many methods
are followed to specify the operand address. The different methods/modes for
specifying the operand address in the instructions are known as addressing
modes. The exact addressing mode used in the instruction can be specified to
the control unit by using any of the following two methods:
1. The opcode explicitly specifies the addressing mode in the instruction.
2. A separate addressing mode field is specified in the instruction.
125
Unit 8: Addressing Modes
Notes Some of the most common addressing modes used by the computers are:
1. Direct Addressing Mode
2. Indirect Addressing Mode
3. Register Addressing Mode
4. Immediate Addressing Mode
5. Index Addressing Mode
Figure 8.1 depicts the addressing mode field.
126
Unit 8: Addressing Modes
Notes Instruction cycle is the process in which the computer retrieves an instruction from its
memory, determines the actions, and performs those actions.
127
Unit 8: Addressing Modes
The register addressing mode provides faster operand fetch without memory
access. However, the number of registers is limited. Hence, the programmers
must effectively utilize the registers.
Immediate Addressing Mode
In immediate addressing mode, the operand is a part of the instruction. Hence,
memory reference is not required to retrieve the operand. This mode is used to
127
Unit 8: Addressing Modes
define constants and set initial values to the variable. The below assembly
language statements illustrate the immediate addressing mode:
MOVE #14, R1 or MVI R1, 14 //The binary equivalent of 14 is loaded in the register R1
ADD #14, R1 //The binary equivalent of 14 and the
contents of R1 are added and the result is stored in register R1
CMP #14, R1 //The binary equivalent if 14 is compared with
the contents of R1.
The ‘#’ sign indicates that the constant following the sign is the immediate operand.
128
Unit 8: Addressing Modes
Once the instruction is fetched, the operand is also fetched in the instruction.
This reduces the instruction cycle time. However, the value of the operand is
limited because this mode is limited to the size of the address field.
Index Addressing Mode
Figure 8.6 depicts index addressing mode.
130
Unit 8: Addressing Modes
Notes
Data transfer instructions transfer data from one location to another without
causing any change in the content present in the binary form. Data
manipulation instructions perform arithmetic, logic, and shift operations.
Program control instructions provide decision making abilities and are able
to change the execution sequence. The program control instructions are
explained in the next section.
Data Transfer Instructions
Data transfer instructions move the data between memory and processor registers,
processor registers and I/O devices, and from one processor register to
another. There are eight commonly used data transfer instructions. Each
instruction is represented by a mnemonic symbol. Table 8.1 shows the eight data
transfer instructions and their
Tablerespective mnemonic
8.1: Data Transfer Instructions symbols.
131
Unit 8: Addressing Modes
132
Unit 8: Addressing Modes
Notes
Data Manipulation Instructions
Data manipulation instructions have computational capabilities. They perform
arithmetic, logic, and shift operations on data. There are three basic types of
data manipulation instructions:
1. Arithmetic Instructions
2. Logical and Bit Manipulation Instructions
3. Shift Instructions
During execution of the instruction, each instruction goes through the fetch
phase, where it reads the binary code of the instruction from the memory.
According to the rules of the instruction addressing mode, the operands are
brought in processor registers. Finally, the instruction in the processor is
executed.
Arithmetic Instructions
Arithmetic operations include addition, subtraction, multiplication and
division. Some computers provide instructions only for addition and
subtraction operations, and generate multiplication and division operations
from these two operations. Each instruction is represented by a mnemonic
symbol. Table 8.2 illustrates some of the arithmetic instructions and their
Table 8.2: Arithmetic Instructions
respective mnemonic symbols.
Name Mnem
onic
Increment INC
Decrement DEC
Add ADD
Subtract SUB
Multiply MUL
Divide DIV
Add with ADDC
Carr y
Subtract SUBB
with
Borrow
Negation NEG
A flip-flop is used to store the carry from an addition operation. The add with
carry instruction performs the addition of two numbers along with the value of
carry from the previous computation. Similarly, the subtract with borrow
instruction performs the subtraction of two numbers and a borrow if any, from
the previous computation. The negation instruction represents the 2’s
complement of a number.
134
Unit 8: Addressing Modes
Notes Boolean variable is a numerical variable that can hold a single binary bit (0 or 1).
Table 8.3 illustrates some of the logical instructions andtheir respective mnemonic symbols.
Name Mnemoni
c
Clear CLR
Complement COM
AND AND
OR OR
Exclusive- XOR
OR
Clear carry CLRC
Set carry SETC
Complement COMC
carry
Enable EI
interrupt
Disable DI
interrupt
The clear instruction replaces the specific operand by 0’s. The complement
instruction inverts all the bits of the operand and produces 1’s complement.
The AND, OR, and XOR instructions perform logical operations on each bit
or group of bits of the operand.
Logical instructions can also manipulate individual bits or group of bits. The bit
manipulation operation can clear a bit to 0, can set a bit to 1, or can
complement a bit.
The AND instruction can clear a bit or group of bits of an operand. For Boolean
variable a, the relationship ‘ab0 = 0’ and ‘ab1 = a’ indicates that the binary
variable when ANDed with 0 changes the value to 0. However, the variable
when ANDed with 1 does not change the value. Thus, bits of an operand can
be cleared by ANDing the operand with another operand that has to clear all 0
bits in its position. It is also known as mask because it masks 0s in selected
bit positions of an operand.
The OR instruction can set a bit or group of bits of an operand. For Boolean
variable a, the relationship ‘a + 1 =1’ and ‘a + 0 = a’ indicates that the binary
variable when ORed with 1, changes the value to 1. However, the variable when
135
Unit 8: Addressing Modes
ORed with 0 does not change the value. Thus, OR instruction is used to set the
bits to 1 by ORing the bits of an operand with another operand that has 1s in
its bit positions.
The XOR instruction can complement bits of an operand. For Boolean
variable a, the relationship ‘a + 1 = a’ and ‘a + 0 = a’ indicates that the binary
variable is complemented when XORed with 1. However, the variable does
not change value when XORed with 0.
The carry bits can be cleared, set, or complemented with appropriate instructions.
The bit manipulation instructions can also enable or disable the interrupt
facility, which is controlled by the flip-flops.
Shift Instructions
Shift instruction helps to shift the bits of an operand to the right or to the
left. The direction of shift is based on specific instructions. The operand is
first loaded into the accumulator and then the shift operation is performed bit
by bit.
136
Unit 8: Addressing Modes
Notes The shift-left operation shifts the zero into low-order vacated position.
137
Unit 8: Addressing Modes
Number1 ADD
AL,
Number2 MOV
AH, 00H
ADC AH, 00H
MOV Result,
AX END
START
138
Unit 8: Addressing Modes
Name Mnemonic
Branch BR
Jump JMP
Skip SKP
Call CALL
Return RET
Compare (by CMP
subtraction)
Test (by TST
ANDing)
139
Unit 8: Addressing Modes
140
Unit 8: Addressing Modes
141
Unit 8: Addressing Modes
142
Unit 8: Addressing Modes
Thus, when the status condition is true, the program control is transferred to
the address specified in the instruction, otherwise the control continues with the
instructions that are in the subsequent locations. The conditional instructions are
also associated with the program control instructions such as jump, call, or
return.
The zero status bit checks if the result of the ALU is zero or not. The carry bit
checks if the most significant bit position of the ALU has a carry out. It is also
used with rotate instruction to check whether or not the bit is shifted from the
end position of a register into a carry position. The sign bit indicates the state
of the most significant bit of the output from the ALU (S = 0 denotes positive
sign and S = 1 denotes negative sign). The branch if plus and branch if minus are
143
Unit 8: Addressing Modes
used to check whether the value of the most significant bit represents a sign or
not. The overflow and underflow instructions are used in conjunction with
arithmetic operations performed on signed numbers. The higher and lower
words are used to denote the relations between unsigned numbers, whereas the
greater and lesser words are used to denote the relations between signed
numbers.
144
Unit 8: Addressing Modes
Notes
Example: Consider two numbers M = 11110000 and N = 00010100.
When we perform M - N operation, the result obtained
is
M: 11110000
N: 00010100
M-N: 11011100
The compare instruction updates the
status bits: C =1: Carry out of the last
stage
S = 1: Left most bit is 1
Z = 0: Last two carries are
equal to 1 V = 0: Result is
not equal to 0
Consider the numeric value, where M = 60 and B =10
(unsigned numbers). Here, M > N and M N. Therefore,
the instructions that will cause branch are BHI, BHE and
BNE.
If M = -8 and N = 10, then we have M < N and M N.
Therefore, the instructions that will cause branch are BLT,
BLE, and BNE
145
Unit 8: Addressing Modes
instruction code. Thus, CISC has variable length encoding of instructions and
the execution of instructions may take varying number of clock cycles. The
CISC processor provides direct manipulation of operands that are in memory.
146
Unit 8: Addressing Modes
Notes
Example: The IBM 370 computer uses the CISC architecture.
147
Unit 8: Addressing Modes
AD R1, R1, R2 R1 R1 +
D R2
AD R3, R3, R4 R3 R3 +
D R4
MU R1, R1, R3 R1 R1 +
L R3
STO X, R1 M[ R1
RE X]
The LOAD instructions transfer the operand P, Q, R and S
from memory to CPU registers R1, R2, R3, and R4
respectively. The ADD and MUL instructions execute the
addition and multiplication operations with the data in the
registers without referring to the memory. The STORE
instruction stores the result of the computation in the memory
(M[X]).
148
Unit 8: Addressing Modes
RISC CISC
Few instructions Many instructions
Few addressing modes. Many addressing modes
Most instructions have
register to
register addressing modes
Includes simple instructions Includes complex instructions
and and
takes one cycle takes multiple cycles
Some of the instructions Most of the instructions refer to
refer to memory
memory
Hardwar e executes the Microprogram executes the
instructions instructions
Fixed format instructions Var iable format instructions
Easier to decode as Difficult to decode as
instructions instructions
have fixed for mat have variable format
Multiple register sets are Single register set is used
used
RISC is highly pipelined CISC is not pipelined or less
pipelined
Load and store functions Load and store functions are
are found
separate instructions in a single instruction
Today, RISC and CISC architectures are becoming more alike. Many RISC chips
now support instructions of CISC chips also. Similarly, CISC chips are using
many techniques associated with RISC chips.
8.5 Summary
• Addressing modes provide different methods for specifying operand address in the instruction.
• Some of the commonly used addressing modes are direct addressing mode,
indirect addressing mode, register addressing mode, immediate addressing
mode, and index addressing mode.
• Data transfer instructions help to move the data from one location to another.
Data manipulation instructions perform arithmetic, logic, and shift
operations on data.
• Program control instructions specify the conditions for data processing operations.
• The Complex Instruction Set Computer (CISC) consists of many complex instruction sets.
• The Reduced Instruction Set Computer (RISC) consists of less instruction
149
Unit 8: Addressing Modes
150
Unit 8: Addressing Modes
Notes
8.7 Self Assessment
1. State whether the following statements are true or false:
(a) The number of address fields in the instruction format of a computer
varies according to the organization of the stack.
(b) In direct addressing mode, the register holds the operand.
(c) The store instruction transfers data from processor register to memory.
(d) Data transfer and manipulation instructions specify the conditions
that can alter the content of the program counter.
(e) Complex Instruction Set Computer (CISC) incorporates variable
length instruction format.
2. Fill in the blanks:
(a) The different methods/modes for specifying the operand address in
the instructions are known as .
(b) The push and pop instructions transfer data between a processor
register and
.
(c) In conditional branch instruction, when the condition is met, the
branch address is loaded in the .
(d) RISC has small set of instructions, which generally include operations.
3. Select a suitable choice for every question:
(a) In register addressing mode, the register holds the
(i) Operand
(ii) Opcode
(iii) Address
(iv) Register number
(b) A flip-flop is used to store the carry from operation.
(i) Addition
(ii) Subtraction
(iii) Comparison
(iv) Division
(c) The test instruction performs the logical operation on
two operands and updates the status bits.
(i) SUB
(ii) OR
(iii) XOR
(iv) AND
151
Unit 8: Addressing Modes
pro
(d) The conditional branch instruction checks the conditions for ces
branching using the sor.
. ”
Pro
(i) Clock cycles vid
(ii) Registers e
the
(iii) Instruction codes
diff
(iv) Status bits ere
nce
Answers: Self Assessment
s.
1. (a) False
(b) False
(c) True
(d) False
(e) True
2. (a) Addressing modes
(b) Memory stack
(c) Program counter
(d) Register-to-register
3. (a) Operand
(b) Addition
(c) AND
(d) Status bits
8.8 Review Questions
1. “In direct addressing mode, the operand address is explicitly specified
in the instruction.” Explain with examples.
2. “Data manipulation instructions have computational capabilities.”
Comment.
3. “Data transfer and manipulation instructions specify the conditions for
data processing operations.” How?
4. “The conditional branch instruction checks the conditions for branching
using the status bits.” How?
5. “Complex Instruction Set Computer (CISC) comprises complex
instruction set.” Justify
6. “RISC instruction set includes simpler instructions.” Explain with an
example.
7. “There are some significant differences between RISC and CISC
152
Unit 8: Addressing Modes
Notes
153
Unit 8: Addressing Modes
Notes 8.9 Further Readings
Online links
www.mans.edu.eg/faceng/english/computers/PD
FS/PDF4/1.2.pdf
www.ehow.com/list_7332165_types-addressing-
modes-computers.html
154