Problem Set 5
Course: COA-CSN201/CSF201
Session: ODD, 2025-26
Semester: III
Batch: BTCSE/IT
Topic Covered: Instruction Format, Addressing Modes, Status Bits, Call-Return concept
1. A computer uses a memory unit with 1K words of 16 bits each. A binary instruction is stored in one
word of memory. Instruction has 04 parts: an indirect bit, an operation code, a register code to
specify one of the 8 registers and an address part
(a) How many bits are there in the operation code, register code and address part?
(b) Draw the instruction word format and indicate the no. of bits in each part.
(c) How many bits are there in data and address inputs of the memory?
An instruction is stored at location 100 with its address field at location 101. The address field has
2. the value 200. A processor register Rl contains the number 300. Evaluate the effective address if
the addressing mode of the instruction is (a) direct; (b) immediate; (c) relative; (d) register indirect;
(e) index with Rl as the index register.
The contents of PC in a basic computer is 3AF. The content of AC is 7EC3. The contents of memory
3. at address 3AF is 932E. The contents of memory at address 32E is 09AC. Contents of memory at
9AC is 8B9F
(a) What is the instruction that will be fetched and executed?
(b) Give the values of registers PC, AR, DR, AC and IR
[Note: All values above are represented in hexadecimal format]
A two-word instruction is stored in memory at an address designated by the symbol W. The
4. address field of the instruction (stored at W + 1) is designated by the symbol Y. The operand used
during the execution of the instruction is stored at an address symbolized by Z. An index register
contains the value X. State how Z is calculated from the other addresses if the addressing mode of
the instruction is
a. direct
b. indirect
c. relative
d. indexed
An 8-bit computer has a register R containing initial data 72. Determine the value of bits C, S, Z and
5. V after each instruction
(i) Add immediate operand C6 to R
(ii) AND immediate operand 8D to R
[Note: Use the initial value of R in each case. Also all numbers are in hexadecimal format]
6. A relative mode branch type of instruction is stored in memory at an address
equivalent to decimal 750. The branch is made to an address equivalent to decimal 500.
a. What should be the value of the relative address field of the instruction (in decimal)?
b. Determine the relative address value in binary using 12 bits. (Why must the number be in 2's
complement?)
c. Determine the binary value in PC after the fetch phase and calculate the binary value of 500. Then
show that the binary value in PC plus the relative address calculated in part (b) is equal to the binary
value of 500.
7. What are the basic differences between a branch instruction, a call subroutine instruction, and
program interrupt?
8. An 8-bit computer has a register R. Determine the values of status bits C, S, Z, and V (Fig. 8-8) after
each of the following instructions. The initial value of register R in each case is hexadecimal 72. The
numbers below are also in hexadecimal.
a. Add immediate operand C6 to R.
b. Add immediate operand IE to R.
c. Subtract immediate operand 9A from R.
d. AND immediate operand 8D to R.
e. Exclusive-OR R with R.