CO Practice Questions
CO Practice Questions
Computer Organisation
15 14 8 7 0
Ch-1-Computer Arithmetic
Practice Questions
Sign Bit Excess-64 Mantissa
Exponent
01. Booth’s coding in 8 bits for the decimal number
-57 is: 04. Mantissa is a pure fraction in signed magnitude
(a) 0 - 1 0 0 + 1 0 0 0 form. The decimal number 0.239×213 has the
(b) 0 - 1 0 0 + 1 0 0 - 1 following hexadecimal representation without
(c) 0 - 1 + 1 0 0 - 1 0 +1 normalization and rounding off
(d) 0 0 -1 0 + 1 0 0 - 1 (a) 0D 24 (b) 0D 4D
(c) 4D 0D (d) 4D 3D
02. Sign extension is the step in
(a) Floating point multiplication 05. The normalized representation for the above
(b) Signed 16 bit integer addition format is specified as follows. The mantissa has
(c) Arithmetic left shift an implicit preceding the binary (radix) point.
(d) Converting a signed integer from one size Assume that only 0’s are padded in while
to another shifting a field. The normalized representation
of the above (0.239×213) is
03. A 4-bit carry lookahead adder, which adds two (a) 0A 20 (b) 11 34
4-bit numbers, is designed using AND, OR, NOT, (c) 4D D0 (d) 4A E8
NAND, NOR gates only. Assuming that all the
inputs are available in both complemented 06. In a lookahead carry generator, the carry
and un-complemented forms and the delay of generate function Gi and the carry propagate
each gate is one time unit, what is the overall function Pi for inputs, Ai and Bi are given by
propagation delay of the adder? Assume that
Pi = Ai ⊕ Bi and Gi = AiBi.
the carry network has been implemented using
The expression for the sum bit Si and carry bit
two-level AND-OR logic.
Ci+1 of the look ahead carry adder are given
(a) 4 time units
by Si = Pi ⊕ Ci and Ci+1 = Gi + PiCi, where C0 is
(b) 6 time units
the input carry. Consider a two–level logic
(c) 10 time units
implementation of the look–ahead carry
(d) 12 time units
generator.
Assume that all Pi and Gi are available for the
Common Data for Questions 04 & 05.
carry generator circuit and that the AND and
The data is given below. Solve the problems and OR gates can have any number of inputs. The
choose the correct answer. number of AND gates and OR gates needed
to implement the look– ahead carry generator
for a 4-bit adder with S3, S2, S1, S0 and C4 as its
outputs are respectively
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
18 Computer Networks
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
19 Computer Networks
01. A memory has 16-bit address bus. Then how 07. A function table is required in very large
many memory locations are there? numbers. The memory most suitable for this
(b) N×M, where N = no. of bits in each location, (b) Become all one’s
in each location
(d) either a or c Cache Concept
04. The address bus width of a memory of size 01. What is the size (in bits) of the tag field per
2048 × 8 bits is Cache block?
(a) 10 (b) 11 (c) 12 (d) 13 (a) 16 bits (b) 9 bits
(c) 19 bits (d) 12 bits
05. It is desired to have a 64 × 8 memory. The
memory IC’s available is of 16 × 4 size. The 02. From the above question, What is the number
number of ICs required and size of the comparator required for tag
(a) 8 (b) 4 matching?
(c) 6 (d) 2 (a) four 4–bit comparators
(b) sixteen 16–bit comparators
06. The write cycle time of a memory is 200 nsec. (c) four 16–bit comparators
The maximum rate at which data can be (d) one 4-bit comparator
stored.
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
20 Computer Networks
03. The capacity of a memory unit is defined by Statement for Linked Answer Questions 07 and 08:
the number of words multiplied by the number A computer has a 256 K Byte, 4-way set associative,
of bits per word. How many separate address write back data cache with block size of 32 Bytes.
and data lines are needed for a memory of The processor sends 32 bit addresses to the cache
4 K × 16? controller. Each cache tag directory entry contains,
(a) 10 address, 16 data lines in addition to address tag, 2 valid bits, 1 modified bit
(b) 11 address, 8 data lines and 1 replacement bit.
(c) 12 address, 16 data lines
(d) 12 address, 12 data lines 07. The number of bits in the tag field of an address
blocks while the cache has 2c blocks. If the (a) 11 (b) 14 (c) 16 (d) 27
identify the memory block mapped in the 32KB 2-way set associate with 32-byte block size. The
What is the total size of memory needed at the The size of an address is 32 bits in both cases. A
cache controller to store meta-data (tags) for 2-to-1 multiplexer has latency of 0.6 ns while a k-bit
the cache? comparator has a latency of k/10 ns. The hit latency
(a) 4864 bits (b) 6144 bits of the set associative organization is h1 while that of
(c) 6656 bits (d) 5376 bits the direct mapped one is h2.
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
21 Computer Networks
11. The value of h1 is (a) The words 50 and 132 are available in the
(a) 2.4 ns (b) 2.3 ns cache
(c) 1.8 ns (d) 1.7 ns (b) The words 150 and 132 are available in the
cache
12. The value of h2 is (c) The words 178 and 150 are available in the
(a) 2.4 ns (b) 2.3 ns cache
(c) 1.8 ns (d) 1.7 ns (d) The words 35 and 50 are available in the
cache
13. Let the Cache and main memory be divided
16. Consider a fully associative cache blocks
into equi sized partitions having 16 words. If
(numbered 0-7) and the following sequence of
cache has 256 blocks & main memory has 4096
main memory blocks of references are made
blocks and Cache is 4–way set associative the
4,3,25,8,19,6,25,8,16,35,45,22,8,3,16,25,7
number of Tag bits is
If LRU replacement policy is used, which cache
(a) 5 (b) 6 (c) 7 (d) 9
block will have memory block 7?
(a) 4 (b) 5
14. Consider a 4-way set-associative cache
(c) 6 (d) 7
(initially empty) with total 16 cache blocks. The
main memory consists of 256 blocks and the 17. If 2-way set associate cache with LRU cache
request for memory blocks is in the following contains Blocks 4, sets 2, the number of cache
order: misses for the following sequence of block
0, 255, 1, 4, 3, 8, 133, 159, 216, 129, 63, 8, 48, 32, address is
73, 92, 155. 8 12 0 12 8
Which one of the following memory block will (a) 2 (b) 3
NOT be in cache if LRU replacement policy is (c) 4 (d) 5
used?
18. Assume that for a certain processor, a read
(a) 3 (b) 8
request takes 50 nanoseconds on a cache miss
(c) 129 (d) 216 and 5 nanoseconds on a cache hit. Suppose
while running a program, it was observed that
15. A 64 word cache and 256 word main memories 80% of the processor’s read requests result in
are partitioned into 16 word blocks. The tag a cache hit. The average read access time in
information is shown below: (Current values in nanoseconds is ______.
cache)
Block Tag 19. Consider a machine with a byte addressable
0 10 main memory of 220 bytes, block size of 16 bytes
1 10 and a direct mapped cache having 212 cache
2 00 lines. Let the addresses of two consecutive bytes
in main memory be (E201F)16 and (E2020)16.
3 01
What are the tag and cache line address (in
Identify the correct statements with respect to
hex) for main memory address (E201F)16?
the availability of main memory words in the
(a) E, 201 (b) F, 201
cache
(c) E, E20 (d) 2, 01F
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
22 Computer Networks
Common Data Questions for Q20 & Q121 24. A 32-bit wide main memory unit with a capacity
Consider a machine with a byte addressable main of 1 GB is built using 256M × 4 - bit DRAM chips.
memory of 216 bytes. Assume that a direct mapped The number of rows of memory cells in the
data cache consisting of 32 lines of 64 bytes each DRAM chip is 214. The time taken to perform
is used in the system. A 50×50 two-dimensional array one refresh operation is 50 nanoseconds. The
of bytes is stored in the main memory starting from refresh period is 2 milliseconds. The percentage
memory location 1100H. Assume that data cache (rounded to the closest integer) of the time
is initially empty. The complete array is accessed available for performing the memory read/
twice. Assume that the contents of the data cache write operations in the main memory unit
21. Which of the following lines of the data cache the length (in number of bits) of the tag fields is
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
23 Computer Networks
Which of the above can cause a hazard? Fetch (OF), perform Operation (PO) and Write
Operand (WO) stages. The IF, ID, OF and
(a) 1 and 2 only (b) 2 and 3 only
WO stages take 1 clock cycle each for any
(c) 3 only (d) All the three
instruction. The PO stage takes 1 clock cycle
03. Register renaming is done in pipelined for ADD and SUB instructions, 3 clock cycles
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
24 Computer Networks
07. Consider an instruction pipeline with four stages (S1, S2, S3, and S4) each with combinational circuit only.
The pipeline registers are required between each stage and at the end of the last stage. Delays for the
stages and for the pipeline registers are as given in the figure.
What is the approximate speed up of the pipeline in steady state under ideal conditions when
compare to the corresponding non-pipeline implementation?
(a) 4.0 (b) 2.5 (c) 1.1 (d) 3.0
08. Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction (FI),
Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand (WO). The
stage delays for
FI, DI, FO, EI and WO are 5 ns, 7ns, 10 ns, 8 ns and 6 ns, respectively. There are intermediate storage
buffers after each stage and the delay of each buffer is 1 ns. A program consisting of 12 instructions
I1, I2, I3, ...., I12 is executed in this pipelined processor. Instruction I4 is the only branch instruction and its
branch target is I9. If the branch is taken during the execution of this program, the time (in ns) needed
to complete the program is
(a) 132 (b) 165
(c) 176 (d) 328
An instruction pipeline has five stages where each stage takes 2 nano seconds and all instructions use all
five stages. Branch instructions are not overlapped, i.e., the instruction after the branch is not fetched till the
branch instruction is completed. Under ideal conditions.
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
25 Computer Networks
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
26 Computer Networks
The IF, OF and WB stages take 1 clock cycle 16. Consider a 6-stage instruction pipeline, where
each for any instruction. The PO stage takes all stages are perfectly balanced. Assume that
1 clock cycle for ADD and SUB instructions. there is no cycle-time overhead of pipelining.
3 clock cycles for MUL instruction and 5 clock When an application is executing on this
cycles for DIV instruction. The pipelined 6-stage pipeline, the speedup achieved with
processor uses operand forwarding from the respect to non-pipelined execution if 25%
PO stage to the OF stage. The number of clock of the instructions incur 2 pipeline stall cycles
cycles taken for the execution of the above is ________.
sequence of instructions is _________.
17. Consider the following processors (ns stands
15. Consider the following code sequence having for nanoseconds). Assume that the pipeline
five instructions I1 to I5. Each of these instructions registers have zero latency.
has the following format. P1: Four-stage pipeline with stage latencies
OP Ri, Rj, Rk 1 ns, 2 ns, 2 ns, 1 ns.
Where operation OP is performed on contents P2: Four-stage pipeline with stage latencies
of registers Rj and Rk and the result is stored in 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.
register Ri. P3: Five-stage pipeline with stage latencies
0.5 ns, 1ns, 1ns, 0.6 ns, 1ns.
I1: ADD R1, R2, R3 P4: Five-stage pipeline with stage latencies
I2: MUL R7, R1, R3 0.5 ns, 0.5 ns, 1ns, 1ns, 1.1ns.
I3: SUB R4, R1, R5 Which processor has the highest peak clock
I4: ADD R3, R2, R4 frequency?
I5: MUL R7, R8, R9 (a) P1 (b) P2
Consider the following three statements. (c) P3 (d) P4
S1: There is an anti-dependence between 18. An instruction pipeline has five stages namely,
instructions I2 and I5 instruction fetch (IF), instruction decode and
S2: There is an anti-dependence between register fetch (ID/RF), instruction execution
instructions I2 and I4 (EX), memory access (MEM), and register
S3: Within an instruction pipeline an anti- writeback (WB) with stage latencies 1 ns, 2.2 ns,
dependence always creates one or more
2 ns, 1 ns, and 0.75 ns, respectively (ns stands for
stalls
nanoseconds). To gain in terms of frequency,
the designers have decided to split the ID/RF
Which one of above statements is/are correct?
stage into three stages (ID, RF1, RF2) each of
(a) Only S1 is true
latency 2.2/3 ns. Also, the EX stage is spilt into
(b) Only S2 is true
two stages (EX1, EX2) each of latency 1 ns. The
(c) Only S1 and S3 are true
(d) Only S2 and S3 are true new design has a total of eight pipeline stages.
A program has 20% branch instructions which
execute in the EX stage and produce the next
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
27 Computer Networks
pointer is computed. All instructions other than stage is divided into stages OF1 and OF2
with execution times of 12 ns and 8 ns
the branch instruction have an average CPI of
respectively.
one in both the designs. The execution times
The speedup (correct to two decimal places)
of this program on the old and the new design
achieved by EP over NP in executing 20
are P and Q nanoseconds, respectively. The
independent instructions with no hazards
value of P/Q is ___________.
is______.
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
28 Computer Networks
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
29 Computer Networks
04. Assume that the memory is word addressable. 10. Consider a three word machine instruction
After the execution of this program, the content ADD A [R0], @ B
of memory location 2010 is The first operand (destination) “A[R0]” uses
(a) 100 (b) 101 indexed addressing mode with R0 as the index
(c) 102 (d) 110 register. The second operand (source) “@B”
used indirect addressing mode. A and B are
05. Assume that the memory is byte addressable
memory addresses residing at the second
and the word size is 32 bits. If an interrupt
occurs during the execution of the instruction and the third words, respectively. The first
“INC R3”, what return address will be pushed word of the instruction specifies the opcode,
on to the stack? the index register designation and the source
(a)1005 (b) 1020 and destination addressing modes. During
(c) 1024 (d) 1040 execution of ADD instruction, the two operands
are added and stored in the destination (first
06. A system has 13 bit instruction and supports operand).
one address and zero address instructions. The number of memory cycles needed during
If there are 32 one address instructions, how
the execution cycle of the instruction is
many zero address instructions are supported
by the processor (Assume 128– word memory). (a) 3 (b) 4
(a) 2048 (b) 1024 (c) 5 (d) 6
(c) 3072 (d) 4096
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
31 Computer Networks
19. Consider a RISC machine where each 22. The following are some events that occur after
instruction is exactly 4 bytes long. Conditional a device controller issues an interrupt while
and unconditional branch instructions use PC- process L is under execution.
relative addressing mode with Offset specified P. The processor pushes the process status of
in bytes to the target location of the branch L onto the control stack.
instruction. Further the Offset is always with Q. The processor finishes the execution of the
respect to the address of the next instruction in current instruction.
the program sequence. Consider the following R. The processor executes the interrupt
instruction sequence
service routine.
Instr. No. Instruction
S. The processor pops the process status of L
i : add R2, R3, R4
from the control stack.
i+1 : sub R5, R6, R7
T. The processor loads the new PC value
i+2 : cmp R1, R9, R10
based on the interrupt.
i+3: beq R1, offset
If the target of the branch instruction is i, then
Which one of the following is the correct order
the decimal value of the offset is_______.
in which the events above occur?
(a) QPTRS (b) PTRSQ
Common data for Q.20 & Q.21:
(c) TRPQS (d) QTPRS
A computer system has 13 – bit instruction and
support zero address & 1 address instructions. The 23. In PC relative addressing mode
memory contains 128 words. (a) Current PC value is used to compute the
Effective Addressing
20. If there exists 32 one address instructions, how (b) Current PC value is not altered after
many zero address instructions are supported computing the Effective Address
by system. (c) The displacement given in the instruction is
(a) 2048 (b) 1024 added to the current P.C. value and result
(c) 3072 (d) 4096 is placed in P.C
(d) Size of the opcode is minimum when
21. For above system which of the following is valid compared to the opcode size of the
(a) If 32-one address, then 1024 zero address general branch instruction
instructions
(b) If 64-one address, then 1024 zero address
instructions
(c) If 63-one address, then 128 zero address
instructions
(d) If 64-one address, then 256 zero address
instructions
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
32 Computer Networks
Ch-5-Control Unit Design 04. The micro instructions stored in the control
memory of a processor have a width of 26
Practice Questions bits. Each microinstruction is divided into three
01. An instruction set of a processor has 125 signals fields : a micro operation field of 13 bits, a next
which can be divided in 5 groups of mutually address field (X), and a MUX select field (Y).
exclusive signals as follows: There are 8 status bits in the inputs of the MUX.
G1 = 20
G2 = 70
G3 = 2 Load
Control Address
G4 = 10 Register
G5 = 23
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
33 Computer Networks
06. Arrange the following configuration for CPU in 09. Hardwired control unit is
decreasing order of operating speed: (a) Faster than micro-programmed control
Hardwired control, vertical micro– programming, unit
horizontal micro– programming. (b) Costlier technique compared to micro-
(a) Hardwired control, vertical micro– programmed control unit
programming, horizontal micro– (c) Free from control memory of ROM portion
programming (d) Used in R.I.S.C processors
(b) Hardwired control, horizontal micro-
programming, vertical micro– programming
(c) Horizontal micro – programming, vertical
micro – programming, hardwired control
(d) Vertical micro – programming, horizontal
micro – programming, hardwired control
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
34 Computer Networks
Ch-6-I.O Organization 05. Which one of the following is true for a CPU
having a single interrupt request line and single
Practice Questions interrupt grant line?
01. In a vectored interrupt (a) Neither vectored interrupt nor multiple
interrupting devices are possible
(a) The branch address is assigned to a fixed
(b) Vectored interrupts are not possible but
location in memory
multiple interrupting devices are possible
(b) The interrupting source supplies the branch
(c) Vectored interrupts and multiple
information to the processor through an
interrupting devices are both possible
interrupt vector
(d) None of these
(c) The branch address is obtained from a
register in the processor 06. A device with data transfer rate 10 KB/sec is
(d) None of the above connected to a CPU. Data is transferred byte-
wise. Let the interrupt overhead be 4 µsec.
The byte transfer time between the device
02. The size of the data count register of a DMA
interface register and CPU or memory is
controller is 16 bits. The processor needs to
negligible. What is the minimum performance
transfer a file of 29,154 kilobytes from disk to main
gain of operating the device under interrupt
memory. The memory is byte addressable. The
mode over operating it under program
minimum number of times the DMA controller
controlled mode?
needs to get the control of the system bus from (a) 15 (b) 25 (c) 35 (d) 45
the processor to transfer the file from the disk to
main memory is ____. 07. A computer handles several interrupt sources
of which of the following are relevant for this
question.
03. The correct matching of the following pairs is
• Interrupt from CPU temperature sensor
List – I List – II (raises interrupt if CPU temperature is too
(P) DMA I/O 1. High speed RAM high)
(Q) Cache 2. Disk • Interrupt from Mouse (raises interrupt if the
(R) Interrupt I/O 3. Printer mouse is moved or a button is pressed)
(S) Condition code 4. ALU register • Interrupt from Keyboard (raises interrupt
when a key is pressed or released)
Codes: • Interrupt from Hard Disk (raises interrupt
(a) P-4, Q-3, R-1, S-2 when a disk read is completed)
(b) P-2, Q-1, R-3, S-4
(c) P-4, Q-3, R-2, S-1 Which one of these will be handled at the
(d) P-2, Q-3, R-4, S-1 HIGHEST priority?
(a) Interrupt from Hard Disk
(b) Interrupt from Mouse
04. Which of the following devices should get
(c) Interrupt from Keyboard
highest priority in assigning interrupts?
(d) Interrupt from CPU temperature sensor
(a) Hard disk (b) Printer
(c) Keyboard (d) Floppy disk
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
35 Computer Networks
08. On a non-pipelined sequential processor, a program segment, which is a part of the interrupt service
routine, is given to transfer 500 bytes from an I/O device to memory.
Initialize the address register
Initialize the count to 500.
LOOP: Load a byte from device
Store in memory at address given by address register
Increment the Address register
Decrement the count
If count! = 0 go to LOOP
Assume that each statement in this program is equivalent to a machine instruction which takes one
clock cycle to execute if it is a non-load-store instruction. The load-store instructions take two clock
cycles to execute.
The designer of the system also has an alternate approach of using the DMA controller to implement the
same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each
DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory.
What is the approximate speed up when the DMA controller based design is used in place of the
interrupt driven program based input-output?
09. The memory mapped IO technic (used for connecting the IO devices)
(a) Is used for connecting more no. of IO devices compared to I/O mapped I/O technique
(b) Blocks some valuable memory locations
(c) Is used when user/programmer wants to connect less. no. of IO devices
(d) Used IO read and IO write control signals
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
36 Computer Networks
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience
37 Computer Networks
Deep Learn - India’s Best Online Coaching Platform for GATE, ESE, and PSUs
Enjoy a smooth online learning experience in various languages at your convenience