coa module 1 prev year questions solved
coa module 1 prev year questions solved
MODULE 1:
1. Compare auto increment and auto decrement addressing modes with examples (3)
2. Outline the steps involved in the execution of an instruction. (3)
3. Identify the addressing modes that can be used for representing the following
4 . Identify the addressing modes that can be used for representing the following
17. With the help of a neat figure, describe the data path inside the processor?(6)
18. Draw the diagram of single bus organization, write the control sequence for the
instruction ADD [R2],R3 for the above mentioned single bus organization. (8)
19. Explain how the PC, IR, MAR and MDR registers are used during the
instruction execution cycle. (3)
20. What information is conveyed by the addressing mode used in an instruction?
List any four addressing modes. (3)
21. What do you mean by byte addressable memory? Explain the two different types
of byte assignment using diagrams (7)
22. Illustrate processor organisation using a single bus with help of a diagram.
Explain how register transfers and ALU operations are carried out in the single
bus organisation. (7)
23.Describe the following addressing modes. giving an example for each:
i) Indirect Addressing mode
ii) Immediate Addressing mode
iii) Indexed Addressing mode (7)
24. Discuss how instructions are classified based on number of operands or addresses
they use. (7)
ANSWERS
1. Compare auto increment and auto decrement addressing modes with examples (3)
Auto Increment Addressing Mode:
o The operand address is specified by a register. After the operand is
accessed, the register is automatically incremented by the size of the
operand.
o Example: If R1 = 1000, the instruction MOV R2, [R1++] transfers the
value at memory address 1000 to R2, and then increments R1 to 1004.
Auto Decrement Addressing Mode:
o The operand address is specified by a register. Before the operand is
accessed, the register is decremented by the size of the operand.
o Example: If R1 = 1004, the instruction MOV R2, [--R1] decrements
R1 to 1000 and then moves the value from memory address 1000 to
R2.
4. Illustrate the single bus organization of processor unit with diagrams and control
signals. (10)
22. Processor Organization Using Single Bus (7)
Signals:
o Read/Write Control: Directs whether data is being read from or written
to memory.
o Bus Control: Determines which register or memory location will drive
or receive data from the bus.
Uses only one bus for all data Uses multiple buses (e.g., data
Number of
transfers, including address, data, and bus, address bus, control bus),
Buses
control signals. allowing parallel transfers.
Data Lower efficiency because only one Higher efficiency due to parallel
Transfer transfer can happen at a time, causing data transfer, enabling simultaneous
Efficiency potential delays. operations.
No simultaneous access to multiple Simultaneous access to different
Simultaneous
components. All components must share components (e.g., CPU, memory,
Access
the single bus. ALU) through separate buses.
Complexity Lower complexity as only one bus is Higher complexity due to the need
involved. Simple design. for multiple buses, but this
complexity leads to better
performance.
Lower performance because of Higher performance as operations
Performance bottlenecks and delays in data can happen in parallel, reducing
transfer. bottlenecks.
Lower cost due to fewer Higher cost due to more buses and
Cost
components and simpler design. complex components.
Control signals are shared across the Control signals are more specialized and
Control
bus, which can introduce delays when distributed across the multiple buses,
Signals
multiple operations are needed. improving speed and flexibility.
Separate buses for data (Data Bus),
One bus handles transferring data
Example addresses (Address Bus), and control
from registers to memory or ALU.
signals (Control Bus).
More flexible, as different
Less flexible, as it can only
Flexibility operations (e.g., memory read and ALU
perform one operation at a time.
operation) can occur simultaneously.
Number
Format Operand(s) Typical Use
of Addresses
Three- Two source operands and Common in high-level languages
3
Address one destination operand. and systems with powerful ISAs.
One source operand and one
Two- destination operand (usually Used in simpler instruction sets
2
Address the destination is or to save instruction length.
overwritten).
One operand (typically
One- Common in accumulator-based
1 register), result stored in the
Address systems, simpler architectures.
same operand or register.
1. Three-Address Representation
Example Expression:
(A + B) * (C + D)
Step-by-Step Translation: We break the expression into smaller operations.
First, we calculate the sum of A + B and the sum of C + D, and then multiply
the results.
Three-Address Representation:
1. ADD R1, A, B
o Operation: Add A and B and store the result in R1.
Explanation: In this instruction, A and B are the source operands, and
o
R1 is the destination where the result is stored.
2. ADD R2, C, D
o Operation: Add C and D and store the result in R2.
o Explanation: Here, C and D are the operands, and R2 stores the result
of their sum.
3. MUL R3, R1, R2
o Operation: Multiply R1 (the result of A + B) and R2 (the result of C +
D), and store the result in R3.
o Explanation: This performs the final multiplication using the results
stored in R1 and R2, storing the result in R3.
ADD R1, A, B // R1 = A + B
ADD R2, C, D // R2 = C + D
MUL R3, R1, R2 // R3 = R1 * R2
Example Expression:
C <- [A] + [B]
Step-by-Step Translation: We first load the value from A into a register, then
add the value from B, and store the result back in C.
Two-Address Representation:
1. MOV R1, [A]
o Operation: Load the value from memory location A into register R1.
Explanation: [A] is the memory address, and R1 is the register where
o
the value is stored.
2. ADD R1, [B]
o Operation: Add the value from memory location B to R1.
Explanation: [B] is the operand (source) added to R1. The result of
o
R1 + [B] is stored back in R1, overwriting the original value.
3. MOV C, R1
o Operation: Move the value from R1 into memory location C.
o Explanation: The final result stored in R1 is transferred back to
memory location C.
Example in two-address form:
MOV R1, [A] // R1 = A
ADD R1, [B] // R1 = R1 + B
MOV C, R1 // C = R1
3. One-Address Representation
In the one-address format, there is only one operand. The operation is usually
performed on a register, with the result being stored back into the same register or
operand. This format is generally used in machines with very limited instruction sets
or simpler architectures, where operations are often done on registers, and the
operands are implicitly defined.
Example Expression:
C <- A + B
Step-by-Step Translation: We load the value of A into a register, then add B
to it, and store the result back into C.
One-Address Representation:
1. LOAD R1, A
o Operation: Load the value of A into register R1.
o Explanation: The operand A is loaded into R1.
2. ADD R1, B
o Operation: Add the value of B to R1, and store the result in R1.
Explanation: The addition of R1 + B is stored in R1. There is no
o
separate destination operand.
3. STORE C, R1
o Operation: Store the result from R1 into memory location C.
o Explanation: The result, now in R1, is transferred to memory location
C.
The data from R3 (now on the bus) is added to the value stored at the address in
MAR (which was taken from R2).
19. PC, IR, MAR, and MDR Registers in Instruction Execution Cycle (3)
Program Counter (PC): Holds the address of the next instruction.
Instruction Register (IR): Holds the current instruction being executed.
Memory Address Register (MAR): Holds the address of the data or instruction
in memory.
Memory Data Register (MDR): Holds the data read from or written to
memory.
20. Information Conveyed by Addressing Mode (3)
Addressing modes define how the operand of an instruction is accessed.
Examples: Immediate, Direct, Indirect, Register, Indexed addressing modes.
Immediate Addressing: Operand is part of the instruction.
o Example: MOV R1, #10
Direct Addressing: Operand address is explicitly given.
o Example: MOV R1, [1000]
Indirect Addressing: Operand address is stored in a register or memory
location.
o Example: MOV R1, [R2]
Indexed Addressing: The operand address is calculated by adding an index to a
base address.
o Example: MOV R1, [R2 + R3]
Register Addressing: Operand is in a register.
o Example: MOV R1, R2