CONotes
CONotes
Consider an instruction: 𝑅0←𝑅1+𝑅2. The following steps are used to execute it over the given data path. Assume
that PC is incremented appropriately. The subscripts 𝑟 and 𝑤 indicate read and write operations, respectively.
1.𝑅2𝑟, TEMP1𝑟,𝐴𝐿𝑈add, TEMP2𝑤
2.𝑅1𝑟, TEMP1𝑤
3.𝑃𝐶𝑟, MAR𝑤, MEM𝑟
4.TEMP2𝑟, R0𝑤
5. MDR𝑟, IR𝑤
Which one of the following is the correct order of execution of the above steps?
A. 2,1,4,5,3
B. 1,2,4,3,5
C. 3,5,2,1,4
D. 3,5,1,2,4
3-store content of pc into memory address register and issue memory read
5-store the data from memory data register into instruction register.
2-store the content of R1 into temporary register TEMP1
1-add contents of R2 and TEMP1 and store result in TEMP2.
4- store contents of TEMP2 into R0
3. A processor has 40 distinct instruction and 24 general purpose registers. A 32-bit instruction word has an
opcode, two registers operands and an immediate operand. The number of bits available for the immediate
operand field is___16____.
5. A processor that has the carry, overflow and sign flag bits as part of its program status word (PSW) performs
addition of the following two 2′𝑠 complement numbers 01001101 and 11101001. After the execution of this
addition operation, the status of the carry, overflow and sign flags, respectively will be:
A. 1,1,0
B. 1,0,0
C. 0,1,0
D. 1,0,1
Carry =1
Overflow = 0 (In 2′𝑠 complement addition Overflow happens only when: Sign bit of two input numbers is 0,
and the result has sign bit 1 OR Sign bit of two input numbers is 1, and the result has sign bit 0.)
Sign bit = 0.
6. A CPU has 24-𝑏𝑖𝑡 instructions. A program starts at address 300 (in decimal). Which one of the following is a
legal program counter (all values in decimal)?
A. 400
B. 500
C. 600 24 bits 3 bytes instructions. So, PC will have multiples of 3 in it.
D. 700
7. The main difference(s) between a CISC and a RISC processor is/are that a RISC processor typically
A. has fewer instructions
B. has fewer addressing modes
C. has more registers
D. is easier to implement using hard-wired logic
8. Suppose a processor does not have any stack pointer registers, which of the following statements is true?
A. It cannot have subroutine call instruction
B. It cannot have nested subroutines call
C. Interrupts are not possible
D. All subroutine calls and interrupts are possible
17. Which of the following addressing modes permits relocation without any change whatsoever in the code?
A. Indirect addressing
B. Indexed addressing
C. Base register addressing
D. PC relative addressing
18. A certain processor supports only the immediate and the direct addressing modes. Which of the following
programming language features cannot be implemented on this processor?
A. Pointers
B. Arrays
C. Records
D. Recursive procedures with local variable
21. Arrange the following configuration for CPU in decreasing order of operating speeds:
Hard wired control, Vertical microprogramming, Horizontal microprogramming.
A. Hard wired control, Vertical microprogramming, Horizontal microprogramming.
B. Hard wired control, Horizontal microprogramming, Vertical microprogramming.
C. Horizontal microprogramming, Vertical microprogramming, Hard wired control.
D. Vertical microprogramming, Horizontal microprogramming, Hard wired control.
23. A micro program control unit is required to generate a total of 25 control signals. Assume that during any
micro instruction, at most two control signals are active. Minimum number of bits required in the control word
to generate the required control signals will be:
A. 2
B. 2.5
C. 10 log225 = 5 *2 10
D. 12
29. Which one of the following facilitates transfer of bulk data from hard disk to main memory with the highest
throughput?
A. DMA based I/O transfer
B. Interrupt driven I/O transfer
C. Polling based I/O transfer
D. Programmed I/O transfer
30. Consider a computer system with DMA support. The DMA module is transferring one 8-bit character in
one CPU cycle from a device to memory through cycle stealing at regular intervals. Consider
a 2 MHz processor. If 0.5% processor cycles are used for DMA, the data transfer rate of the device is
_80,000_________ bits per second. 1/2MHz * 0.5%
31. For the daisy chain scheme of connecting I/O devices, which of the following statements is true?
A. It gives non-uniform priority to various devices
B. It gives uniform priority to all devices
C. It is only useful for connecting slow devices to a processor device
D. It requires a separate interrupt pin on the processor for each device
Daisy chaining approach tells the processor in which order the interrupt should be handled by providing priority to the
devices.
In daisy-chaining method, all the devices are connected in serial. The device with the highest priority is placed in the
first position, followed by lower priority devices. The interrupt pin is common to all.
32. An instruction format has the following structure:
Instruction Number: Opcode destination reg, source reg-1, source reg-2
Consider the following sequence of instructions to be executed in a pipelined processor:
I 1: DIV R3, R1, R2
I 2: SUB R5, R3, R4
I 3: ADD R3, R5, R6
I 4: MUL R7, R3, R8
33. Consider a 5-stage pipelined processor with Instruction Fetch (IF), Instruction Decode (ID), Execute (EX),
Memory Access (MEM), and Register Writeback (WB) stages. Which of the following statements about
forwarding is/are CORRECT?
A. In a pipelined execution, forwarding means the result from a source stage of an earlier instruction is
passed on to the destination stage of a later instruction
B. In forwarding, data from the output of the MEM stage can be passed on to the input of the EX stage of
the next instruction
C. Forwarding cannot prevent all pipeline stalls
D. Forwarding does not require any extra hardware to retrieve the data from the pipeline stages
34. Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first,
second, and the third stages, respectively. Assume that there is no other delay and the processor does not suffer
from any pipeline hazards. Also assume that one instruction is fetched every cycle.
The total execution time for executing 100 instructions on this processor is _____2040________
delays = 10𝑛𝑠,20𝑛𝑠,14𝑛𝑠
total instruction (n) = 100
We take pipeline delay as 𝑡𝑝=𝑚𝑎𝑥(10,20,14)=20
number of stages (𝑘) =3
So,
Total execution time =(𝑘+(𝑛–1))×𝑡𝑝
⟹(3+100−1)×20𝑛𝑠 2040 ns
35. Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero
latency.
P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns.
P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.
P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns.
P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.
Which processor has the highest peak clock frequency?
A. P1
B. P2
C. P3 frequency = 1/ max (time in stages)
D. P4
36. Register renaming is done in pipelined processors:
A. as an alternative to register allocation at compile time
B. for efficient access to function parameters and local variables
C. to handle certain kinds of hazards
D. as part of address translation
37. For a pipelined CPU with a single ALU, consider the following situations
I. The 𝑗+1𝑠𝑡 instruction uses the result of the 𝑗𝑡ℎ instruction as an operand
II. The execution of a conditional jump instruction
III. The 𝑗𝑡ℎ and 𝑗+1𝑠𝑡 instructions require the ALU at the same time.
Which of the above can cause a hazard
A. I and II only
B. II and III only
C. III only
D. All the three 1) Data Hazard 2) Control Hazard & 3) Structural Hazard
39. Comparing the time T1 taken for a single instruction on a pipelined CPU with time T2 taken on a non-
pipelined but identical CPU, we can say that
A. T1 ≤ T2
B. T1 ≥ T2
C. T1 < T2
D. T1 and T2 plus the time taken for one instruction fetch cycle
40. The chip select logic for a certain DRAM chip in a memory system design is shown below. Assume that the
memory system has 16 address lines denoted by 𝐴15 to 𝐴0. What is the range of address (in hexadecimal) of
the memory system that can get enabled by the chip select (CS) signal?
A. C800 to CFFF
B. CA00 to CAFF According to question:
C. C800 to C8FF 𝐴15=1,𝐴14=1,𝐴13=0,𝐴12=0,𝐴11=1
D. DA00 to DFFF So the possible range in binary:
(1100100000000000) to (1100111111111111)
Converting to Hexadecimal:
(𝐶800) to (𝐶𝐹𝐹𝐹)
41. How many 32𝐾×1 RAM chips are needed to provide a memory capacity of 256𝐾 bytes?
A. 8
B. 32
C. 64 Total size/ 1 RAM size 256 K bytes / 32 * 1 RAM 64
D. 128
42. DMA I/O Disk
Cache High speed RAM
Interrupt I/O Printer
Condition Code Register ALU
43. A processor takes 12 cycles to complete an instruction I. The corresponding pipelined processor uses 6 stages
with the execution times of 3,2,5,4,6 and 2 cycles respectively. What is the asymptotic speedup assuming that
a very large number of instructions are to be executed?
A. 1.83
B. 2
C. 3
D. 6
Speed Up= Time without Pipeline / Time with Pipeline
Time without Pipeline =12 cycle
Time with Pipeline = 6 cycle take maximun one
Speed up =12/6=2
45. The main memory of a computer has 2cm blocks while the cache has 2c blocks. If the cache uses the set
associative mapping scheme with 2 blocks per set, then block 𝑘 of the main memory maps to the set:
A. (𝑘mod𝑚) of the cache
B. (𝑘mod𝑐) of the cache
C. (𝑘mod2𝑐) of the cache
D. (𝑘mod2𝑐𝑚) of the cache
Cache set no=(Main memory block no.) mod (Total sets in cache)
total sets in cache=(total blocks in cache)/(total blocks in set)=(2c)/(2)=c
cache se no=(k) mod (c)=k mod c
47. A 32-bit wide main memory unit with a capacity of 1GB is built using 256M×4-bit DRAM chips. The number
of rows of memory cells in the DRAM chip is 214. The time taken to perform one refresh operation
is 50nanoseconds. The refresh period is 2milliseconds. The percentage (rounded to the closest integer) of the
time available for performing the memory read/write operations in the main memory unit is _________.
% Time spent in refresh =Total time to Refresh all Rows / Refresh period∗100
=0.8192ms / 2.0ms∗100 = 40.96%
% Time spent in Read/Write =100 − 40.96=59.04%
49. Consider a set-associative cache of size 2KB (1KB=210 bytes) with cache block size of 64 bytes. Assume that
the cache is byte-addressable and a 32 -bit address is used for accessing the cache. If the width of the tag field
is 22 bits, the associativity of the cache is ____2_____
bit address is used for accessing the cache.
It is given that cache is Set-Associative.
The address bits get split as follows:
50. Consider a computer system with a byte-addressable primary memory of size 232 bytes. Assume the computer
system has a direct-mapped cache of size 32 KB (1 KB = 210 bytes), and each cache block is of size 64 bytes.
The size of the tag field is ______17____ bits.
51. A direct mapped cache memory of 1 MB has a block size of 256 bytes. The cache has an access time of 3 ns
and a hit rate of 94%. During a cache miss, it takes 20 ns to bring the first word of a block from the main
memory, while each subsequent word takes 5 ns. The word size is 64 bits. The average memory access time in
ns (round off to 1 decimal place) is___ 13.3 0r 13.5 ___.
Block size is 256 Bytes,word size is 64 bits or 8 bytes. So Block size in words is 8 words.
Number of words per block=32
Time to fetch a word from main-memory to cache is: 20+31×5=175ns because first word takes 20ns and rest each
subsequent words take 5ns each.
So average Memory acces time is
0.94(3)+0.06(3+175)=13.5 ns
52. A certain processor uses a fully associative cache of size 16 kB, The cache block size is 16 bytes. Assume that
the main memory is byte addressable and uses a 32-bit address. How many bits are required for the Tag and
the Index fields respectively in the addresses generated by the processor?
A. 24 bits and 0 bits
B. 28 bits and 4 bits
C. 24 bits and 4 bits
D. 28 bits and 0 bits
Fully Associative Cache has fields: Tag, Offset.
Direct Mapped Cache has fields: Tag, Line No., Offset
Set associative cache has fields: Tag, Set No., Offset
As you can see, in fully associative cache, there's no index field. Hence index bits = 0.
Now, Offset = 4 bits.
=> Tag =32−4=28 bits.
53. Consider a two-level cache hierarchy with 𝐿1 and 𝐿2 caches. An application incurs 1.4 memory accesses per
instruction on average. For this application, the miss rate of 𝐿1 cache is 0.1; the 𝐿2 cache experiences, on
average, 7 misses per 1000 instructions. The miss rate of 𝐿2 expressed correct to two decimal places is
____0.05____.
Since , it is given in question that for 1 instruction it takes 1.4 memory access(ma)
So, for 1000 instr. it will take =1000* 1.4 ma= 1400 ma
Now , it is given for l1 cache miss rate(mr) = 0.
and since , we know mr=no. of misses/total no. of ma
so, 0.1=no. of misses/1400
thus, no. of misses of l1 =140
As , we know when there is miss in l1 , we search for data in l2
so, now for l2 cache total no. of ma=140, and it is given there is 7 miss
so , mr for l2 cache=7/140=1/20=0.05
54. Consider a machine with a byte addressable main memory of 220 bytes, block size of 16 bytes and a direct
mapped cache having 212 cache lines. Let the addresses of two consecutive bytes in main memory
be (E201F)16 and (E2020)16. What are the tag and cache line addresses (in hex) for main memory
address (E201F)16?
A. E, 201
B. F, 201
C. E, E20
D. 2, 01F
E20 is common to both hex numbers, so ignore it.
1𝐹=0001 1111=31 (𝑑𝑒𝑐𝑖𝑚𝑎𝑙)
20=0010 0000=32 (𝑑𝑒𝑐𝑖𝑚𝑎𝑙)
So, difference between two consecutive memory locations = 1 𝐵 Hence, the memory is byte addressable.
First 4 bits would be tag bits, and next 12 bits would be index bits.
So, for (𝐸201𝐹)16
Tag = 𝐸; Line = 201
56. In a 𝑘-way set associative cache, the cache is divided into 𝑣 sets, each of which consists of 𝑘 lines. The lines
of a set are placed in sequence one after another. The lines in set 𝑠 are sequenced before the lines in set (𝑠+1).
The main memory blocks are numbered 0 onwards. The main memory block numbered 𝑗 must be mapped to
any one of the cache lines from
A. (𝑗 mod 𝑣)∗𝑘 to (𝑗 mod 𝑣)∗𝑘+(𝑘−1)
B. (𝑗 mod 𝑣) to (𝑗 mod 𝑣)+(𝑘−1)
C. (𝑗 mod 𝑘) to (𝑗 mod 𝑘)+(𝑣−1)
D. (𝑗 mod 𝑘)∗𝑣 to (𝑗 mod 𝑘)∗𝑣+(𝑣−1)
Number of sets in cache =𝑣.
The question gives a sequencing for the cache lines. For set 0, the cache lines are numbered 0,1,..,𝑘−1. Now for
set 1, the cache lines are numbered 𝑘,𝑘+1,...𝑘+𝑘−1 and so on.
So, main memory block 𝑗 will be mapped to set (𝑗 mod 𝑣), which will be any one of the cache lines
from (𝑗 mod 𝑣)∗𝑘 to (𝑗 mod 𝑣)∗𝑘+(𝑘−1).
(Associativity plays no role in mapping- 𝑘-way associativity means there are 𝑘 spaces for a block and hence reduces
the chances of replacement.)
57. Consider a 4-way set associative cache consisting of 128 lines with a line size of 64 words.
The CPU generates a 20−𝑏𝑖𝑡 address of a word in main memory. The number of bits in the TAG, LINE and
WORD fields are respectively:
A. 9,6,5
B. 7,7,6
C. 7,5,8
D. 9,5,6
59. A computer system has a 4 𝐾 word cache organized in block-set-associative manner with 4 blocks per
set, 64 words per block. The number of bits in the SET and WORD fields of the main memory address format
is:
A. 15,40 Number of sets =4𝐾 / (64×4) = 16
B. 6,4 So, we need 4-bits to identify a set ⇒ SET =4 bits.
C. 7,2 64 words per block mean WORD is 6-bits.
D. 4,6
60. More than one word are put in one cache block to:
A. exploit the temporal locality of reference in a program
B. exploit the spatial locality of reference in a program
C. reduce the miss penalty
D. none of the above
61. What is the minimum size of ROM required to store the complete truth table of an 8−𝑏𝑖𝑡×8−𝑏𝑖𝑡 multiplier?
A. 32𝐾×16 bits
B. 64𝐾×16 bits Multiplying 2 8-bit digits will give result in maximum 16 bits
C. 16𝐾×32 bits Total number of multiplications possible =28×28
D. 64𝐾×32 bits Hence, space required =64𝐾×16 bits
62. The capacity of a memory unit is defined by the number of words multiplied by the number of bits/word. How
many separate address and data lines are needed for a memory of 4𝐾×16?
A. 10 address, 16 data lines
ROM memory size =2𝑚×𝑛
B. 11 address, 8 data lines 𝑚= no. of address lines 𝑛= no. of data lines
C. 12 address, 16 data lines Given, 4𝐾×16
D. 12 address, 12 data lines =22×210×16 =212×16
64. The main memory unit with a capacity of 4 megabytes is built using 1M×1-bit DRAM chips. Each DRAM
chip has 1K rows of cells with 1K cells in each row. The time taken for a single refresh operation
is 100nanoseconds. The time required to perform one refresh operation on all the cells in the memory unit is
A. 100 nanoseconds
B. 100×210 nanoseconds similar to 47 ques
C. 100×220 nanoseconds
D. 3200×220 nanoseconds
65. A dynamic RAM has a memory cycle time of 64 nsec. It has to be refreshed 100 times per msec and each
refresh takes 100 nsec . What percentage of the memory cycle time is used for refreshing?
A. 10
B. 6.4
C. 1
D. 0.64 Time for refresh = 100ns
So, percentage of time spent for refresh = (64 * 10-2 / 64) *100 = 1%
68. Using a larger block size in a fixed block size file system leads to
A. better disk throughput but poorer disk space utilization
B. better disk throughput and better disk space utilization
C. poorer disk throughput but better disk space utilization
D. poorer disk throughput and poorer disk space utilization
70. The data transfer rate of a double-density floppy disk system is about:
A. 5𝐾 bits/sec
B. 50𝐾 bits/sec
C. 500𝐾 bits/sec
D. 5000𝐾 bits/sec
71. Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors per track. 512 bytes of data are
stored in a bit serial manner in a sector. The capacity of the disk pack and the number of bits required to
specify a particular sector in the disk are respectively:
A. 256 Mbyte, 19 bits
B. 256 Mbyte, 28 bits Disk capacity = total number of surfaces * no. of tracks per surface *
amount of data per track
C. 512 Mbyte, 20 bits
D. 64 Gbyte, 28 bits 16 surfaces (4 bit) * 128 tracks per surface (7 bit) * 256 sectors per track
(8 bit) *512 bytes of data 256MB