COA Unit I Question Bank
COA Unit I Question Bank
3. How much memory the CPU can address with the following instruction format?
A. 4 KB
A. PC PC + 1
14. If a system follows the below instruction format, how many different opcodes it uses?
A. 64
18. A computer uses a memory unit with 256K words of 32 bits each. A binary
instruction code is stored in one word of memory. The instruction has four parts: an
indirect bit, an operation code, a register code part to specify one of 64 registers, and
an address part. How many bits are there in the operation code, the register code
part and the address part?
A. In a basic computer architecture, several special purpose registers play specific roles
in facilitating the operation of the CPU and the execution of instructions. These
registers are:
1. Program Counter (PC): The program counter keeps track of the memory address
of the next instruction to be fetched and executed.
2. Instruction Register (IR): The instruction register holds the current instruction
being executed. The CPU used this register to decode and execute the instruction.
3. Memory Address Register (MAR): The memory address register stores the
address of the location in memory that the CPU wants to read from or write to. It
is used during memory operations.
4. Memory Data Register (MDR): The memory data register holds the data that is
either read from memory or is about to be written to memory.
5. Accumulator (AC): The accumulator is used for arithmetic and logic operations. It
stores intermediate results during calculations.
6. Temporary Register (TR): The temporary register will be used as a second
accumulator and is used to store the second operand in binary operations
calculated by ALU.
7. Status Register (Flag Register): The status register contains various flags that
indicate the current state of the CPU, as zero flag (ZF), overflow flag (OF), Sign
flag (SF) etc. These flags are set or reset based on the results of arithmetic and
logic operations.
8. Stack Pointer (SP): The stack pointer points to the top of the stack in memory. It is
used in managing the program stack, especially during subroutine calls and
returns.
9. Input Register (INPR): This register is used during input operation to store the
address of the input device.
10. Output Register (OUTR): This register is used during output operation to store the
address of the output device.
4. Evaluate the expression X=A + (B*C) - (D*E) using zero address, one address and
two address instruction formats.
A. i) Two address instructions are:
MUL B, C
MUL D, E
SUB B, D
ADD A, B
STORE X, A
ii) One address instruction is:
LOAD D
MUL E
STORE T
LOAD B
MUL C
SUB T
ADD A
STORE X
iii) Zero address instructions are:
PUSH E
PUSH D
MUL
PUSH C
PUSH B
MUL
SUB
PUSH A
ADD
POP X
5. An instruction is stored at address 300 with its address field at location 301. Address
field has the value 400. Processor R1 contains 200. Evaluate Effective Address for
the following. a. Immediate b. Direct c. Register Indirect d. Relative
e. Auto Increment f. Auto Decrement
A.
S. No. Addressing Mode Effective Address
1. Immediate 301
2. Direct 400
3. Register Indirect 200
4. Relative 702
5. Auto Increment 200
6. Auto Decrement 199
6. For the following memory, the two-word instruction at address 200 and 201 is a
“load to AC” instruction with an address field equal to 500. The first word of the
instruction specifies the operation code and mode, and the second word specifies the
address part. PC has the value 200. The content of the processor register R1 is 400
and the content of an index register XR is 100. What is the content of the AC after
executing the instruction with various addressing modes.
500 900
600 325
702 300
800
A.
Addressing Mode Effective Address Content of AC
8. What is the difference between a direct and indirect address instruction? How many
references to memory are needed for each type of instruction to bring an operand
into a processor register?
A. Direct Addressing:
In direct addressing, the address of the operand (the data) is explicitly stated in the
instruction itself.
The CPU reads the memory address directly from the instruction and accesses the
operand at that memory location.
Example: If an instruction specifies LOAD R1, 5000, the value stored at memory
address 5000 will be loaded into register R1.
Indirect Addressing:
In indirect addressing, the instruction provides the address of a memory location that
contains the effective address of the operand.
The CPU first reads the address from the specified memory location, then accesses
the operand using this effective address.
Example: If an instruction specifies LOAD R1, (5000), the CPU first goes to memory
address 5000, retrieves the value stored there (say 6000), and then uses 6000 as the
address to fetch the actual operand.
9. List the Basic Computer Instruction Formats. Explain them with Suitable
Examples.
A. 1. Memory reference instruction
2. Register Reference Instructions
3. Input-Output Instructions.
10. Differentiate Memory Reference instructions and Register Reference instructions.
A.
Memory Reference Instructions vs. Register Reference Instructions
Memory reference instructions and register reference instructions are two types of
instructions used in computer systems to perform operations involving data access. The key
difference lies in the location from which the operand is accessed: memory or registers.