Basics of COA: 1. (MCQ) (GATE-2023: 2M)
Basics of COA: 1. (MCQ) (GATE-2023: 2M)
CHAPTER
1
Basics of COA c = 20
1. [MCQ] [GATE-2023 : 2M] d=a+b
e=c+d
Consider the IEEE-754 single precision floating
point numbers f=c+e
P = 0xC1800000 and Q = 0x3F5C2EF4. b=c+e
Which one of the following corresponds to the e=b+f
product of these numbers d= 5 + e
(i.e., P × Q), represented in the IEEE-754 single return d + f
precision format? Assuming that all operations take their operands
(a) 0x404C2EF4 (b) 0x405C2EF4 from registers, what is the minimum number of
(c) 0xC15C2EF4 (d) 0xC14C2EF4 registers needed to execute this program without
spilling?
2. [MCQ] [GATE-2014 : 2M] (a) 2 (b) 3
The value of a float type variable is represented using (c) 4 (d) 6
the single-precision 32-bit floating point format of
IEEE-754 standard that uses 1 bit for sign, 8 bits for 5. [MCQ] [GATE-2008 : 1M]
biased exponent and 23 bits for mantissa. A float A processor that has carry, overflow and sign flag
type variable X is assigned the decimal value of bits as part of its program status word (PSW)
−14.25. The representation of X in hexadecimal performs addition of the following two 2’s
notation is complement numbers 01001101 and 11101001.
(a) C1640000H (b) 416C0000H After the execution of this addition operation, the
(c) 41640000H (d) C16C0000H status of the carry, overflow and sign flags,
respectively will be:
3. [MCQ] [GATE-2012 : 1M] (a) 1, 1, 0 (b) 1, 0, 0
The amount of ROM needed to implement at 4 bit (c) 0, 1, 0 (d) 1, 0, 1
multiplier is
(a) 64 bits (b) 128 bits 6. [MCQ] [GATE-2008 : 2M]
(c) 1Kbits (d) 2 Kbits The use of multiple register windows with overlap
causes a reduction in the number of memory
accesses for:
Registers and its Types
1. function locals and parameters
4. [MCQ] [GATE-2010 : 2M] 2. register saves and restores
The program below uses six temporary variables 3. instruction fetches
a, b, c, d, e, f. (a) 1 only (b) 2 only
a=1 (c) 3 only (d) 1, 2 and 3
b = 10
4.1
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.2
GATE Wallah CS & IT Topic wise PYQs
Machine Instruction and Addressing Modes
4.3
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.4
GATE Wallah CS & IT Topic wise PYQs
Machine Instruction and Addressing Modes
23. [MCQ] [GATE-2008 : 2M] calculated; EA =-(X) is the effective address equal to
Which of the following is/are true of the auto- the contents of location X, with X decremented by
increment addressing mode? one word length before the effective address is
1. It is useful in creating self-relocating code. calculated; EA = (X)- is the effective address equal
2. If it is included in an instruction Set to the contents of location X, with X decremented by
Architecture, then an additional ALU is required one word length after the effective address is
for effective address calculation calculated. The format of the instruction is (opcode,
3. The amount of increment depends on the size of source, destination), which means (destination ←
the data item accessed. source op destination). Using X as a stack pointer,
(a) 1 only (b) 2 only which of the following instructions can pop the top
(c) 3 only (d) 2 and 3 only two elements from the stack, perform the addition
operation and push the result back to the stack.
24. [MCQ [GATE-2008 : 1M] (a) ADD (X)–,(X)
Assume that EA = (X)+ is the effective address equal (b) ADD (X), (X)–
to the contents of location X, with X Incremented by (c) ADD –(X), (X)+
one word length after the effective address is (d) ADD –(X), (X)
❑❑❑
4.5
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.6
GATE Wallah CS & IT Topic wise PYQs
Machine Instruction and Addressing Modes
e = +3 bias = 127
E or BE = e + bias 3 + 127
= 130
E = 130
(C15C2EF4 H)
M = 10111 → 10000010
2nd Approach.
Alternate Approach. P = C1800000 S = 1 –ve
4.7
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
S=1 R1 = 1(a)
R2 = 10(b)
E = 130 10000010 R3 = 20(c)
M : 11001
I R1 R1 + R2 [R1[d] = a + b]
II R1 R3 + R1 [R1[e] = c + d]
III R2 R3 + R1 [R2[f] = c + e]
IV R2 R3 + R1 [R2[b] = c + e]
V R1 R2 + R2 [R1[e] = b + f]
[C1640000H] VI R3 R1 + 5 R3[d] = 5 + e
VII return R2 + R3
Minimum 3 register required
OR
a = 1, b = 10, c = 20
R1 R1 + R2 I. d = a + b
3. (d) R1 R3 + R1 II. e = c + d
When we multiply two 4 bit number then each result R2 R3 + R1 III. f = c + e
is 8 bit R3 R3 + R1 IV b = c + e
4 bit 4 bit R1 R2 + R3 V e=b+f
R3 R1 + 5 VI d = 5 + e
↓ ↓ return R2 + R3 VIII return d + f
Combination 24 24
Total ROM size = 24 × 24 × 8 bit
⇒ 28 × 8 bit
⇒ 28 × 23 bit ⇒ 211 bit
5. (b)
⇒ 2 × 210 bit
Cin
= 2k bits Cout Cin
01001101
+11101001
00110110
Overflow
C in + cout = 1
1+1=0
Carry = 1, Sign = 0
Overflow flag = 0
4.8
GATE Wallah CS & IT Topic wise PYQs
Machine Instruction and Addressing Modes
6. (a) U2 = 4
1. Function, Local parameter, memory Access U3 = 4
L08 Jmp U4 U4 = L01
Because at L01 condition checking.
7. (a)
A15, A14, A11 is enabled (1), A13 and A12 = 0
9. (50 to 50)
4.9
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
R2 m [3001] = R 2 = 50
R2 9 + 50 = R 2 = 59
M [R3] R2 → m [3001] = 59
R3 3001 + 1 R3 = 3002
R1 9 – 1 R1 = 8
2nd Part Total number of operations in I type = free opcode
R2 m [3003] R2 = 50 × 2 increment bit in opcode
R2 R1 + R2 7 + 50 R 2 = 57 = (16 – x) × 26–4 ⇒ (16 – x) × 22
M [3003] = 57 I type (Given) = 8
R3 = 3003 + 1 R 3 = 3004 8 = (16 – x) × 4
2 = 16 – x
Simiarly execute
x = 16 – 2
R1 = 7 R1 = 6
x = 14
In the last R1 = 0 so, m [3010] will not change
[update]
4.10
GATE Wallah CS & IT Topic wise PYQs
Machine Instruction and Addressing Modes
FR= 6 bit
TYPE -4
Instruction size = 16 bit (2 byte)
TYPE: 3 OP CODE IR FR
Total number of operations in type 4 = Free
14 Instructions
opcode × 2Increment bit in opcode.
TYPE: 4 OP CODE FR (N) 2 × 210–6
N Instructions 2 × 24
32
TYPE:- 1 N= 32
TYPE -3
13. (500 to 500)
64 Register, Instruction set size = 12
Total number of operations in type 3 = free opcode
× 2 Increment bit in opcode 5 Fields = Opcode, Source Reg1, S Reg2, D Reg2, 12
bit Immediate field
4 × 26 – 4 = 4 ×22
64 Register Reg. AF = 6bit
= 16 operation/ Instruction
4.11
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
Memory operand
Or
Instruction size = 4 + 6 + 6 + 6 +12 Register operand
= 34 bits 5 Byte But Accumulator is a special purpose Register
Program having = 100 Inst.
Program size = 100 × 5B = 500 byte.
16. (d)
Given
Current SP value is = (016E)16
PC = 2 Byte, PSW = 2 byte
(1) Store the current value of PC into the stack.
Here PC is 2 byte so stack pointer to increased
by 2 bytes
(016E)2 + 2 = [0170]16
24 Register Reg.AF= 5bit (2) Store the value of PSW in the stack
Here PSW is also 2 byte long. So SP increased
32 bits Instruction
by 2 byte
(0170)16 + 2 = (0172)16
SP = (0172)16
(3) Load the starting address of the subroutine in
Immediate field = 32 – (5 + 5 + 6) the PC.
= 32 – 16
PC ISR
Immediate field = 16bit
SP = ( 0172 )16
4.12
GATE Wallah CS & IT Topic wise PYQs
Machine Instruction and Addressing Modes
Immediate field = 32 – (6 + 6 + 6)
= 32 – 18 = 14 bit
n bit unsigned Range = 0 to 2n –1
Immediate field Range = 0 to 214 –1 = 16,383
X(R1) M [X + R1]
Minimum 3 Registers required
4.13
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
❑❑❑
4.14
GATE Wallah CS & IT Topic wise PYQs
Design of springs
CHAPTER
2
Micro-Operation and Micro Program Consider an instruction: R0 ← R1 + R2. The
1. [MCQ] [GATE-2013 : 2M] following steps are used to execute it over the given
Consider the following sequence of micro - data path. Assume that PC is incremented
operations. appropriately. The subscripts r and w indicate read
MBR ← PC and write operations, respectively.
MAR ← X 1. R2r TEMP1R, ALUadd, TEMP2W
PC ← Y 2. R1r TEMP1W,
Memory ← MBR 3. PCr, MARW, MEMr
Which one of the following is a possible operation 4. TEMP2R,R0W
performed by this sequence 5. MDRr, IRW
(a) Instruction fetch
Which one of the following is the correct order of
(b) Operand fetch
execution of the above steps?
(c) Conditional branch
(d) Initiation of interrupt service (a) 3, 5, 1, 2, 4
(b) 2, 1, 4, 5, 3
ALU Data Path (c) 3, 5, 2, 1, 4
2. [NAT] [GATE-2020 : 1M] (d) 1, 2, 4, 3, 5
A multiplexer is placed between a group of 32
registers and an accumulator to regulate data Microprogrammed Control
movement such that at any given point in time the 4. [MCQ] [GATE-2008 : 2M]
content of only one register will move to the Consider a CPU where all the instructions require 7
accumulator, the minimum number of select lines clock cycles to complete execution. There are 140
needed for the multiplexer is _____ instructions in the instruction set. It is found that 125
control signals are needed to be generated by the
3. [MCQ] [GATE-2020 : 1M] control unit. While designing the horizontal micro-
Consider the following data path diagram programmed control unit, single address field format
is used for branch control logic. What is the
minimum size of the control word and control
address register?
(a) 125, 7
(b) 125, 10
(c) 135, 9
(d) 135, 10
4.15
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
RISC and CISC Which of the characteristics above are used in the
5. [MCQ] [GATE-2018 : 1M] design of a RISC processor?
Consider the following processor design (a) I and II only
characteristics: (b) II and III only
I. Register-to-register arithmetic operations only.
(c) I and III only
II. Fixed-length instruction format.
III. Hardwired control unit. (d) I, II and III
❑❑❑
4.16
GATE Wallah CS & IT Topic wise PYQs
ALU and Control Unit
1. (d)
MBR PC
MAR X
PC Y
Memory MBR
(a) Instruction fetch
PC → MAR → Memory → MBR → IR
(Mem to CPU (IR))
PC value stored in Memory then PC is updated
(b) Operand fetch
IR (AF) → MAR → Memory → MBR → ALU
(c) Conditional branch
Not store the PC value in the memory
(d) Initiation of Interrupt service 3. (c)
R0 ← R1 + R2
Fetch cyle (Mem to CPU (IR))
PC → M [MAR] → MBR → IR
3. PCR MARw MBRr
4.17
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4. (d) CW = 135
Total number of instructions = 140 CAR = 10 bit
Each intruction requires = 7 cycle
Total number of micro operations = 140 × 7
= 980 instn | operations|cw
CAR = 10 bit
Horizontal program
125 CS = 125 bits required
125 + 10 = 135
❑❑❑
4.18
GATE Wallah CS & IT Topic wise PYQs
Design of springs
CHAPTER
3
Basics of Pipelining pipelining force you to operate the pipelined
processor at 2 GHz. In a given program, assume that
1. [NAT] [GATE-2014 : 2M]
30% are memory instructions, 60% are ALU
Consider two processors P1 and P2 executing the
instructions and the rest are branch instructions. 5%
same instructions set. Assume that under identical
of the memory instructions cause stalls of 50 clock
conditions, for the same input, a program running on
cycles each due to cache misses and 50% of the
P2 takes 25% less time but incurs 20% more CPI
branch instructions cause stalls of 2 cycles each.
(clock cycles per instruction) as compared to the Assume that there are no stalls associated with the
program running on P1. If the clock frequency of P1 execution of ALU instructions. For this program, the
is 1GHZ, then the clock frequency of P2 (in GHZ) is speedup achieved by the pipelined processor over
________. the non-pipelined processor (round off to 2 decimal
2. [MCQ] [GATE-2008 : 2M] places) is _________.
In an instruction execution pipeline, the earliest that
the data TLB (Translation Look a side Buffer) can 5. [NAT] [GATE-2018 : 2M]
be accessed is
The instruction pipeline of a RISC processor has the
(a) Before effective address calculation has started
following stages. Instruction Fetch (IF), Instruction
(b) During effective address calculation
Decode (ID), Operand Fetch (OF), Perform
(c) After effective address calculation has Operation (PO) and Writeback (WB) The IF, ID, OF
completed and WB stages take 1 clock cycle each for every
(d) After data cache lookup has completed instruction. Consider a sequence of 100 instructions,
In the PO stage, 40 instructions take 3 clock cycles
Performance Evaluation of Pipeline each, 35 instructions take 2 clock cycles each, and
3. [NAT] [GATE-2023 : 1M] the remaining 25 instructions take 1 clock cycle
Consider a 3-stage pipelined processor having a each. Assume that there are no data hazards and no
delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for control hazards.
the first, second, and the third stages, respectively. The number of clock cycles required for completion
Assume that there is no other delay and the processor of execution of the sequence of instructions is
does not suffer from any pipeline hazards. Also ______.
assume that one instruction is fetched every cycle.
The total execution time for executing 100 6. [NAT] [GATE-2017 : 2M]
instructions on this processor is __________ ns. Instruction execution in a processor is divided into 5
4. [NAT] [GATE-2020 : 2M] stages. Instruction Fetch (IF), Instruction Decode
Consider a non-pipelined processor operating at 2.5 (ID), Operand Fetch (OF), Execute (EX) and Write
GHz. It takes 5 clock cycles to complete an Back (WB). These stages take 5, 4, 20, 10 and 3
instruction. You are going to make a 5-stage pipeline nanoseconds (ns) respectively. A pipelined
out of this processor. Overheads associated with implementation of the processor requires buffering
4.19
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
between each pair of consecutive stages with a delay 10. [NAT] [GATE-2015 : 2M]
of 2 ns. Two pipelined implementations of the Consider a non-pipelined processor with a clock rate
processor are contemplated: of 2.5 gigahertz and average cycles per instruction
(I) a naive pipeline implementation (NP) with 5 of four. The same processor is upgraded to a
stages and (II) an efficient pipeline (EP) where the pipelined processor with five stages; but due to the
OF stage is divided into stages OF1 and OF2 with
internal pipeline delay, the clock speed is reduced to
execution times of 12 ns and 8 ns respectively.
2 gigahertz. Assume that there are no stalls in the
The speedup (correct to two decimal places)
pipeline. The speed up achieved in this pipelined
achieved by EP over NP in executing 20 independent
processor is______.
instructions with no hazards is _____.
4.20
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
13. [MCQ] [GATE-2013 : 2M] What is the number of cycles needed to execute the
Consider an instruction pipeline with five stages following loop? For (i = 1 to 2) {I1; I2; I3; I4;}
without any branch prediction: Fetch Instruction (a) 16 (b) 23
(FI), Decode Instruction (DI), Fetch Operand (FO), (c) 28 (d) 30
Execute Instruction (EI) and Write Operand (WO).
The stage delays for FI, DI, FO, EI and WO are 5 ns, 16. [MCQ] [GATE-2008 : 2M]
7 ns, 10 ns, 8 ns and 6 ns, respectively. There are A non-pipelined single cycle processor operating at
intermediate storage buffers after each stage and the 100 MHZ is converted into a synchronous pipelined
delay of each buffer is 1 ns. A program consisting of processor with five stages requiring 2.5 nsec, 1.5
12 instruction I1, I2, I3, ….I12 is executed in this nsec, 2 nsec, 1.5 nsec and 2.5 nsec, respectively. The
pipelined processor. Instruction I4 is the only branch delay of the latches is 0.5 nsec. The speedup of the
instruction and its branch target is I9. If the branch is pipeline processor for a large number of instructions
taken during the execution of this program, the time is:
(in ns) needed to complete the program is (a) 4.5 (b) 4.0
(a) 132 (b) 165 (c) 3.33 (d) 3.0
(c) 176 (d) 328
14. [MCQ] [GATE-2011 : 2M] Pipelining Dependencies
Consider an instruction pipeline with four stages (S1, 17. [NAT] [GATE-2022: 2M]
S2, S3 and S4) each with combinational circuit only. A processor X1 operating at 2 GHz has a standard
The pipeline registers are required between each stage
5-stage RISC instruction pipeline having a base CPI
and at the end of the last stage. Delays for the stage
(cycles per instruction) of one without any pipeline
and for the pipeline registers are as given in the
hazards. For a given program P that has 30% branch
instructions, control hazards incur 2 cycles stall for
Pipe line Registe r (Delay 1 ns)
4.21
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.22
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
❑❑❑
4.23
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
1. (1.6 to 1.6)
Total execution time = Number of Instruction × CPI
× cycle time
But in the Question number of Instruction are same
for processor P1 & P2 2. (c)
ETP1 = CPI × cycle time1 Effective adress (EA) →: Actual address of the object
= CPI × 1 nsec.
4.24
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
ET NONPIPE 2
S= = = 2.16
ETPIPE 0.925 6. (1.49 to 1.52)
Naïve pipeline [NP]
5 stages: IF, ID, OF, EX, WB.
K = 5 5ns, 4ns, 20ns, 10ns, 30ns
Buffer Delay = 2ns
4.25
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
Number of Instruction = 20 n = 20 1
Clock Frequency
Max (stage Delay + Buffer Delay) cycle time
NP P3 having lowest time
tp = max (5, 4, 20, 10, 3) + Buffer Delay = 20 + 2 P3 having highest clock frequency
tp NP = 22 ns
ETNP = [k + n –1] tpNP
[5 + (20 – 1)] × 22 ns 24 × 22 ns
8. (3.9 to 4.1)
ETNP = 528 nsec 3
1 = 2 2T3
Efficient pipe line [EP] 4
6 Stages IF, ID, OF1 OF2 EX WB 3τ 3τ
τ1 = 2 & 2 = 2τ3
k =6 (5, 4, 12, 8, 10, 3) n sec. 4 4
1 3 6 T2 8
Buffer Delay = 2 nsec. = or =
2 4 8 T3 3
EP
tp = max (stage Delay + Buffer Delay) 1: 2 : 3 6 : 8 : 3
max (5, 4, 12, 8, 10, 3) + 2ns = 12 + 2 Let x is time
1 = 6x, 2 = 8x, 3 = 3x
tpEP = 14 nsec.
tp = max (6x, 8x, 3x)
n = 20 tp = 8x
EPEP = k + ( n − 1) tp EP 1 1
Frequency = = Frequency
6 + ( 20 − 1) 14 = 25 14 tp 8x
1
ETNP = 350 nsec 3GHz =
8x
Perfomance of EP 1 / ETEP 1
Speed up factor = = = 24 GHZ
Perfomance of NP 1 / ETNP x
ETEP 528 New Design
= =
ETNP 350
4.26
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
9. (33 to 34) 1 1
Cycle time = sec. 10−9 sec.
OLD Design: 2 2
4 Stage, (800, 500, 400, 300) 1 Inst. ET in pipeline = 0.5 nsec.
tpOLD = max (800PS, 500PS, 400PS, 300 PS) Speed up factor =
Performance of pipeline 1 / ETpipeline
tpOLD Desgin = 800 PS =
Performance of Non-pipeline 1 / ETnon-pipeline
Instruction takes = 800PS
ET in non-pipeline tn 1.6
In 1 sec. how many # of Inst. = = =
ET in pipeline tp 0.5
1
tp OLD = = Speed up factor = 3.2
800
New Design:-
5 stages Delay = (600, 350, 500, 400, 300) PS
tp New = max. (600, 350, 500, 400, 300)
tp New = 600PS
Instruction takes = 600 PS 11. (1.54 to 1.54)
Ins.1 sec. how many number of instruction Old Design
1
trp new =
600
New – OLD
% of throughput increase in pipeline = tpOLD = max(1, 2.2, 2, 1, 0.75)
OLD
1 1 1 1 8−6 tpOLD = 2.2n sec. & OLD Design ‘Ex’ Stage
− − 28 2
600 800 6 8 48 = = Branch Penalty = 3–1
1 1 1 48 6
B.P = 2
800 8 8
1 Branch Frequency = 20%
= 33.33%
3 Number of stalls / Inst. = .20×2 = 0.4
Average Inst. ETOLD = (1+Number of stalls/Ins.)
tpOLD
(1 + 0.4) × 2.2
1.4 ×2.2
ETOLD[p] = 3.08 n sec.
10. (3.2 to 3.2)
New Design
Non pipelined processer
I Instruction takes 4 cycle
1 1
Cycle time = sec. × 10–9 sec.
2.5 G 2.5
Cycle time = 0.4 n sec.
2.2 2.2 2.2
In non-pipelined tp new = max 1, , , ,1,1,1,0.75 ns
I Instruction execution time = 4 × 0.4 sec. = 1.6 n sec.
3 3 3
Pipelined Processer: tpnew = 1 n sec.
5 stage
Branch Penalty = 6 – 1 = 5
1 Instn takes = 1 cycle
4.27
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
Without stalls
ETPIPE = [K + (n + 1)] cycle.
= [5 + 8 –1)] cycle. = 12 cycle
Total Instn = 12
4.28
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
S4 I3 I3 I3 I4 I4 I1 I2 I2 I3 I3
S3 I4 I1 I2 I2 I3 I4 I4 17. (1.42 to 1.42)
S2 I2 I2 I2 I3 I4 I4 X1 : 5 stage RISC pipeline, 30% branch instruction
S1 I3 I4 2GHz clock frequency
11 12 13 14 15 16 17 18 19 20
1
Cycle Time = sec Cycle Time = 0.5ns.
2G
S4 I3 I4 I4
Number stalls/instruction = Branch frequency ×
S3 Branch penalty.
S2 = .70 × 0 + .30 × 2
S1 The number stalls/Instruction = 0.6
21 22 23 24 25
23 cycles.
16. (c)
Non pipe line processor X1: Avg Instn ET = (1 + number of stells/instn) ×
Frequency = 100 MHZ Cycle time
1 (1 + 0.6) × 0.5ns 1.6 × 0.5 ns
Cycle time non-pipe = = 10–8 sec.
100 106
ETX1 = 0.8ns
10
= 10 –8 = 10 10 –9 sec.
10 New version X2 with Branch Prediction.
ETnon-pipe = 10 nsec. Cycle time = 0.5 nsec.
4.29
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
performance of X 2 1 / ETX 2
SPEED UP =
performance of X1 1 / ETX1 Or
ETX1 No extra cycle (stall) Due to Data Dependency
0.8
Each instn takes total 2 cycles 4 MUL Instn takes
ETX2 0.56
1extra cycle
S = 1.42 Stall = 4 × 1 = 4 cycles
ETPIPE = [k + (n –1)] tp + stalls [5 + (8 –1)] × 1+
4 = 16 cycles
With operand forwards ETPIPE = 16 cycle
Without opened forwarding
Extra cycle (stalls) due to data Dependency
18. (17160 to 17160) Or
Stage Delays = [150, 120, 150, 160, 140 ns] Additional cycle (stall) Required to fetch the opened
Buffer delay = 5ns from the previous Instruction.
n = 100
k = 5 stage
4.30
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
Instr. No Instruction
4000 – 4003 i add R2, R3, R4
4004 – 4007 i +1 sub R5, R6, R7
IF
4008 – 4011 i+2 cmp R1, R9, R10
OF
4012 – 4015 i+3 beq R1, Offset
PO
4016 –
WB
PC = 4016
WB I1
Target address = i
PO I1 I1 I1 I2 I2 I2 I2 I2
PC denotes the starting address of the next Instn
OF I1 I2 I3
In PC Relative Addressing (AM) Target address =
Current PC value + OFFSET IF I1 I2 I3 I4
4000 = 4016 + OFFSET 1 2 3 4 5 6 7 8 9 10
OFFSET= –16
WB I2 I3 I4
PO I3 I4
OF I4
IF
21. (b)
OP Ri Rj Rk 11 12 13 14 15 16 17 18 19
Ri Rj any operation Rk 13 clock cycle.
S1: Anti Dependency between I2 & I5 : Alternate approach:
I2 : MUL R7 R1 R3 : R7 R1 × R3 Stall (extra cycles)
I5 : MUL R7 R8 R9 : R7 R8 × R9 I1 MUL 3 →2
False because its output Dependency.
I2 DIV 5 →4
S2: Anti Dependency between I2 & I4 :
I3 ADD 1 → 6 extra cycle stalls
I2 : MUL R7 R2 R3 : R7 R1 × R3
I4 : ADD R3 R2 R4 : R3 R2 × R4 I4 SUB 1
True n = 4, k = 4
Anti Dependency & output Dependency ET = [K + (n –1)] tp + t stalls
Sol. Register Remaining = [4 + (4 – 1)] ×1 + 6 = 7 + 6= 13 cycle
4.31
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
24. (b)
25. (d)
WB I0
PO I0 I0 I0 I1 I1 I1 I1 I1
OF I0 I1
ID I0 I1 I2 I3
Branch to level if R1 = = 0
IF I 0 I1 I2 I3
(a) I1 : R2 R7 + R8
1 2 3 4 5 6 7 8 9 10 11
Used in I3 result of I1 (R2) used as operand.
(b) I2 : ?
WB I1 I2 I3
R4 R5 – R6
PO I1 I2 I3 I4 is used as memory [R4] for memory store
OF I2 I3 purpose
ID (c) I3 : R1 R2 + R3
Used in Branch to total if R1 = 0
IF
Not proper working
12 13 14 15 16 17 18 19 20 21
(d) I4: memory [R4] store
15 clock cycle
PO
I0 3
I1 6
I2 1
I3 1
OR 26. (a)
Alternate apporach
PO stage Extra cycle
I0 MUL 3 → 2
I1 DIV 6 → 5
7 extra cycle (stalls)
I2 ADD 1
I3 SUB 1
n = 4, number of stage = 5
4.32
GATE Wallah CS & IT Topic wise PYQs
Instruction Pipelining
❑❑❑
4.33
GATE Wallah CS & IT Topic wise PYQs
Design of springs
CHAPTER
4
Cache Memory and Cache Organisation Mapping Techniques
1. [NAT] [GATE-2017 : 1M] 4. [NAT] [GATE-2023 : 2M]
Consider a two-level cache hierarchy with L1 and L2 An 8-way set associative cache of size 64 KB (1 KB
caches. An application incurs 1.4 memory accesses = 1024 bytes) is used in a system with 32-bit
per instruction on average. For this application, the address. The address is sub-divided into TAG,
miss rate of L1 cache is 0.1; the L2 cache experiences INDEX, and BLOCK OFFSET. The number of bits
on average, 7 misses per 1000 instructions. The miss in the TAG is ______________.
rate of L2 expressed correct to two decimal places is
______. 5. [NAT] [GATE-2021 : 1M]
2. [MCQ [GATE-2017 : 2M] Consider a computer system with a byte-addressable
In a two-level cache system, the access times of L1 primary memory of size 232 bytes. Assume the
and L2 caches are 1 and 8 clock cycles, respectively. computer system has a direct-mapped cache of size
The miss penalty from the L2 cache to main memory 32 KB (1 KB = 210 bytes), and each cache block is
is 18 clock cycles. The miss rate of L1 cache is twice of size 64 bytes.
that of L2. The average memory access time The size of the tag field is _______bits.
(AMAT) of this cache system is 2 cycles. The miss
rates of L1 and L2 respectively are: 6. [NAT] [GATE-2021 : 1M]
(a) 0.111 and 0.056 (b) 0.056 and 0.111 Consider a set-associative cache of size 2 KB (1 KB
(c) 0.0892 and 0.1784 (d) 0.1784 and 0.0892 = 210 bytes) with cache block size of 64 bytes.
Assume that the cache is byte - addressable and a 32-
3. [MCQ] [GATE-2014 : 2M] bit address is used for accessing the cache. If the
width of the tag field is 22 bits, the associativity of
In designing a computer’s cache system, the cache
the ache is _____.
block (or cache line) size is an important parameter.
Which one of the following statements is correct in
this context? 7. [MCQ] [GATE-2020 : 2M]
(a) A Smaller block size implies better spatial A computer system with a word length of 32 bits has
locality a 16 MB byte-addressable main memory and a 64
KB, 4-way set associative cache memory with a
(b) A Smaller block size implies a smaller cache tag
block size of 256 bytes. Consider the following four
and hence lower cache tag overhead
physical addresses represented in hexadecimal
(c) A Smaller block size implies a larger cache tag
notation.
and hence lower cache hit time
A1 = 0 × 42C8A4, A2 = 0 × 546888, A3 = 0 ×
(d) A Smaller block size incurs a lower cache miss 6A289C, A4 = 0 × 5E4880
penalty
Which one of the following is TRUE?
4.34
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
(a) A1 and A3 are mapped to the same cache set. 12. [MCQ] [GATE-2016 : 2M]
(b) A2 and A3 are mapped to the same cache set. The width of the physical address on a machine is 40
(c) A3 and A4 are mapped to the same cache set. bits. The width of the tag field in a 512 KB 8-way
(d) A1 and A4 are mapped to different cache sets. set associative cache is ______bits.
(a) 24 (b) 20
8. [MCQ] [GATE-2019 : 1M] (c) 30 (d) 40
A certain processor uses a fully associative cache of
size 16 kB. The cache block size is 16 bytes. Assume 13. [MCQ] [GATE-2015 : 1M]
that the main memory is byte addressable and uses a Consider a machine with a byte addressable main
32-bit address. How many bits are required for the memory of 220 bytes, block size of 16 bytes and a
Tag and the Index fields respectively in the direct mapped cache having 212 cache lines. Let the
addresses generated by the processor? addresses of two consecutive bytes in main memory
(a) 24-bits and 0-bits (b) 28-bits and 4-bits be (E201F)16 and (E2020)16. What are the tag and
(c) 24-bits and 4-bits (d) 28-bits and 0-bits cache line address (in hex) for main memory address
(E201F)16?
(a) E, 201 (b) F, 201
9. [MCQ] [GATE-2018 : 2M]
(c) E, E20 (d) 2, 01F
The size of the physical address space of a processor
is 2p bytes. The word length is 2wbytes. The capacity
14. [NAT] [GATE-2014 : 1M]
of cache memory is 2n bytes. The size of each cache
A 4-way set-associative cache memory unit with a
block is 2m words. For a K-way set-associative cache
capacity of 16 KB is built using a block size of 8
memory, the length (in number of bits) of the tag
words. The word length is 32 bits. The size of the
field is
physical address space is 4 GB. The number of bits
(a) P – N – log2 K
for the TAG field is _______.
(b) P – N + log2 K
(c) P – N – M – W – log2 K
15. [MCQ] [GATE-2014 : 2M]
(d) P – N – M – W + log2 K
If the associativity of a processor cache is doubled
while keeping the capacity and block size
10. [MCQ] [GATE-2017 : 2M] unchanged, which one of the following is guaranteed
Consider a machine with a byte addressable main to be NOT affected?
memory of 232 bytes divided into blocks of size 32 (a) Width of tag comparator
bytes. Assume that a direct mapped cache having (b) Width of set index decoder
512 cache lines is used with this machine. The size (c) Width of way selection multiplexer
of the tag field in bits is _____. (d) Width of processor to main memory data bus
(a) 12 (b) 16
(c) 18 (d) 24 16. [MCQ] [GATE-2013 : 1M]
In a k-way set associative cache, the cache is divided
11. [NAT] [GATE-2017 : 2M] into v sets, each of which consists of k lines. The
A cache memory unit with capacity of N words and lines of a set are placed in sequence one after
block size of B Words is to be designed. If it is another. The lines in set s are sequenced before the
designed as a direct mapped cache, the length of the lines in set (s + 1). The main memory blocks are
TAG field is 10 bits. If the cache unit is now numbered 0 onwards. The main memory block
designed as a 16-way set-associative cache, the numbered ‘j’ must be mapped to any one of the
length of the TAG field is _____ bits. cache lines from
4.35
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.36
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
4.37
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
block at the rate of 1 word per cycle. The maximum The smallest cache size required to ensure an
bandwidth for the memory system when the average read latency of less than 6 ms is ______MB.
program running on the processor issues a series of
read operations is _______×106 bytes/sec. 33. [NAT] [GATE-2015 : 1M]
31. [NAT] [GATE-2017 : 2M] Assume that for a certain processor, a read request
The read access times and the hit ratios for different
takes 50 nanoseconds on a cache miss and 5
caches in a memory hierarchy are as given below:
nanoseconds on a cache hit. Suppose while running
cache Read access time (in Hit ratio a program, it was observed that 80% of the
nano seconds) processor’s read requests result in a cache hit. The
I-cache 2 0.8 average read access time in nanoseconds is _______.
D-cache 2 0.9
L2- 8 0.9
cache 34. [NAT] [GATE-2014 : 2M]
The memory access time is 1 nanosecond for a read
The read access time of main memory is 90 operation with a hit in cache, 5 nanoseconds for a
nanoseconds. Assume that the caches use the
read operation with a miss in cache, 2 nanoseconds
referred word-first read policy and the write back
for a write operation with a hit in cache and 10
policy. Assume that all the caches are direct mapped
nanoseconds for a write operation with a miss in
caches. Assume that the dirty bit is always 0 for all
cache. Execution of a sequence of instructions
the blocks in the caches. In execution of a program,
involves 100 instruction fetch operations, 60
60% of memory reads are for instruction fetch and
memory operand read operations and 40 memory
40% are for memory operand fetch. The average
read access time in nanoseconds (up to 2 decimal operand write operations. The cache hit-ratio is 0.9.
places) is ________. The average memory access time (in nanoseconds)
32. [NAT] [GATE-2016 : 2M] in executing the sequence of instructions is _____.
A file system uses an in-memory cache to cache disk
blocks. The miss rate of the cache is shown in the Common Data for next two questions:
figure. The latency to read a block from the cache is A Computer has a 256 Kbyte, 4-way set associative, write
1 ms and to read a block from the disk is 10 ms. back data cache with block size of 32 Bytes. The processor
Assume that the cost of checking whether a block sends 32-bit addresses to the cache controller. Each cache
exists in the cache is negligible. Available cache tag directory entry contains, in addition to address tag, 2
sizes are in multiples of 10 MB. valid bits, 1 modified bit and 1 replacement bit.
4.38
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
4.39
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
❑❑❑
4.40
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
4.41
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
32
Number of lines = =8
4
Case III: Block size = 16 byte
3. (d)
(a) Incorrect because:
Spatial locality: Adjacent word (Data)
If block size 4B
32
Number of lines = =2
16
But in fully associative :
Case I : Block size = 2bytes
4.42
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
=
64KB
1B
( )
= 64K 216 Line
4.43
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
cm Size
# LINES [#CM blocks] =
Block size
211 B
⇒ 6
= 25 = 32 lines
2 B
#Lines A1 and A4 mapped to the same cache set
# Set = A2 and A3 are mapped to the same cache set
N − way
32
16 =
N − way
32
N-way = =2
16
8. (d)
Physical address = 32 bit
Cache size = 16 kB
Block size = 16 byte
7. (b) Word offset = [log2 block size] ⇒[log216]
Main memory = 16 MB = 224 byte Word offset = 4bit
16
Cache size = 64 MB = 2 Byte Fully associative cache
Block size = 256 B = 28 Byte
4 way set associative
A1 : Ox 42C 8A4
A2 Ox 546 888
A3: Ox 6A2 89C
TAG: 28 bit word offset = 4 bit
A4: Ox 5E4 880
Index: 0 bit
Physical address = 24 bit
Word offset = log2 (block size)
= [log2 256] ⇒ 8 bit
4.44
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
4.45
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
13. (a)
Main memory = 220 byte
cache size = N word, block size = B word Block size = 16 bytes
Tag = 10 bits Number of lines = 212
Word offset = log2B
Mm size = 220 Byte
CM size N
Number of line = = P.A = 20 bit
Block size B
Word offset = [log216]
L.O = log2 N
B Word offset = 4bit
# lines = 212
4.46
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
29
= 2
= 27 = 128 set
2
Set offset = 7bit
Note: A : 10
B : 11
C : 12 TAG = 32 – (7 + 5)
D : 13 TAG = 20 bit
E : 14
F : 15
Main memory address = (E2021F)16
4.47
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
0 to 7
0 × 8 to 0 × 8 + (8 – 1)
1 × 8 to 1 × 8 + (8 – 1)
8 to 15
16. (a)
Number of sets = each set consit ‘k’ lines
Set associative mapping
K mod S or mm request (mod) # set
(J mod V)
Find first Line of any set
Each set contiant 4 lines (k = 4)
Set 0 ⇒ 0 × 4 = 0
Set 1 = 1 × 4 = 4
Set 2 = 2 × 4 = 8
Set 3 = 3 × 4 = 12 (j mod v) × k to
(j mod v) × k + (k – 1)
For first Line, set number × k
0 × 4 to 0 × 4 + (4 – 1) = 0 to 3
1 × 4 to 1 × 4 + (4 – 1) = 4 to 7x × k to x × k + (k – 1)
17. (a)
4.48
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
18. (d)
Main memory size = 1 MB (220 B)
Cache size = 8 KB
1 word size = 1 byte
Block size = 128 words
Block size = 128 ×1 B = 128 bytes
Word offset = log2 128 = 7 bits
cm size 8 KB
Number of lines = = = 26
Block size 128 B
26 20. (b)
Number of sets = 2 = 24 = 16 sets
2 Page size = 4 KB
Set offset = log2 16 = 4 Page offset(d) = [log2 page size] = [log2 4KB]
d = 12 bit
Start address = (FF000)16
V.A = 32 bit
1413121110 9 8 7 6 5 4 3 21 0
11 bit
Row Major
4.49
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
APR[0][4] = 5th element of the Ist row, i.e [0] [0], [0] Match APR [4] [0]
[1], [0, 2] [0, 3]
Ist row 5th element (i.e already 4 element passed)
4 × 8 = 32
21. (d)
2 way set associative, block size = 16 B, VA = 32 bit
Cache size = 64 KB
Block size = 16 Byte
Row Major Block offset = [log2 block size] = log216 = 4 bit
APR[4][0] = Ist element of the 5th row [Row No 0, 1,
cm size 64 KB
2, 3] Number of lines = =
block size 16B
And each row 1024 element
4 × 1024 × 8 216
= 4
= 212 lines
2
22 × 210 × 23= 215
OR Number of lines 212 11
Number of set = = = 2 set
4 × 1024 × 8 N- way 2
22 × 210 × 8 Set offset = 11 bit
2
21 × 8 = 4k × 8 VIVT
…. 217 216 215 214 213 212 211 210 29 28 27 26 25 24 23 22 Virtual Index and virtually Tag
21 20 32 bit
TAG Set offset Block 1 word offset
17 bit 11 bit 4 bit
2 way set associative
TAG = 32 – (11 + 4)
Row Major Tag memory size = number of lines × Tag bits
= 212 × 17 bit = 22 × 17 × 210 bit
APR[0][5] = First row, 6th element
= 68 k bits
[[0][0], 0.1, 0.2, 0.3, 0.4] OR
5 element Tag memory size = Number of set × Block per set ×
Tag bit
5 × 8 = 40 ( )16
= 211 × 2 × 17 bit = 2 × 2 × 17 × 210 bit
Tag memory size = 68 k bits
4.50
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
TAG(5bit) Line Word offset mapped to the same cache line number.
offset (6bit)
4.51
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
K MODS = i
K MOD128 = i
K : mm block number
S : Number of cm set
i = cache set number
1st time
24. (a)
A≥k
1 2 3 1 2 5 1 4 6 ⇒ N=9
124156189178253⇒ N = 15
Worst case: 71 3 6 7
51 2 4 5
At most k [k =3]
Associativity A k
4.52
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
Number of SETS=4
K MOD S = i
Or
Cache set address = mm block mod number of cm set
k MOD 4 = i
Case II: If that unique address repeated
k=3
At most k unique = 3 address
1, 2, 4
No other extra miss
4.53
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.54
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
Block size = 4 Bytes Tavgread acceesstime = frequency of instn fetch × Tavgread instn
fetch + frequency of operand fetch × Tavg operand fetch
Block size = 8 × 4 byte = 32 Byte
= 0.60 × 5.4 + – 0.40 × 3.7
Total time taken to
Tavgread = 4.72 n sec
Transfer cache block = access time
4.55
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.56
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
Total time taken to perform write operation = 40 × 2.8 = 23 × 20 × 210 bits = 160 k bits
= 112 nsec
Total time taken for 200 instructions = 224 + 112 =
336 nsec
336
Average memory access time = = 1.68 n sec
200
37. (d)
Physical address = 32 bit 1 valid bit
Cache size = 8 kB 1 modified bit
Block size = 32 byte
35. (c) Word offset = [log2 Block size] ⇒ [log232]
Tag = 16 bit Word offset = 5 bit
Physical address = 32 bit CM size 8kB 213
# lines = = = = 28 lines
Cache size = 256 k byte Block size 32byte 2 5
4.58
GATE Wallah CS & IT Topic wise PYQs
Memory Hierarchy
Refresh period = 2 msec In every 100 ns, initiate 1 word data to the bus.
Time available for read/write operationi = 2 – 0.8192 bus→ initate one request (1 word request)
⇒ 1.1808 msec For 1 milli second number of words we can initate
%time available for read/write operation = 1 millisec 10 –3
1.1808 ⇒ = –9
= 104 = 10,000
= 59.04% 100 n sec 100 10
2
45. (b)
43. (31 to 31)
Main memory size = 4 GB [232 byte] RAM CHIP size = 1 k × 8 (1024 word, 8 bit)
1 word size = 2 Byte Wants to contruct RAM of size = 16 k × 16
Memory is word addressable
16 k 16
1 word = 2Byte Number of RAM chip requried =
1k ×8
4 G Byte → 4 G Byte Word → 2 G word ⇒ 16 × 2 RAM chip ⇒ 16 lines
2 Byte
Word addressable Decoder (4 × 16) required
Mm size = 2G word
⇒ 21230 word = 231 words
4.59
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
47. (c)
Memory capcity = 256 k Byte
Each ram chip size = 32 k × 1 bit
Numer of ram chip required = MM size
4 m Byte 4 m 8bit RAM chip size
Number of RAM chip = =
1m 1bit 1m 1bit 8
256 k Byte 256 k × 88 Bi t
= = = 64
= 32 RAM chip 32k 1bit 32k 1 bit
Note: Dram chip one refresh ⇒ one row is refresh
(one row cells)
Total number of rows = 210
In 1 chip, total number of refresh required = 210 refresh
operations
❑❑❑
4.60
GATE Wallah CS & IT Topic wise PYQs
Design of springs
CHAPTER
5
Modes of Data Transfer 4. [NAT] [GATE-2016 : 2M]
The size of the data count register of a DMA
1. [MCQ] [GATE-2022: 1M] controller is 16 bits. The processor needs to transfer a
Which one of the following facilitates transfer of bulk file of 29, 154 kilobytes from disk to main memory.
data from hard disk to main memory with the highest The memory is byte addressable. The minimum
number of times the DMA Controller needs to get the
throughput?
control of the system bus from the processor to
(a) DMA based I/O transfer transfer the file from the disk to main memory
(b) Interrupt driven I/O transfer is_____.
(c) Polling based I/O transfer 5. [MCQ] [GATE-2011 : 2M]
(d) Programmed I/O transfer On a non-pipelined sequential processor, a program
2. [NAT] [GATE-2021 : 1M] segment, which is a part of the interrupt service
routine, is given to transfer 500 bytes from an I/O
Consider a computer system with DMA support. The
device to memory.
DMA module is transferring one 8-bit character in one
Initialize the address register
CPU cycle from a device to memory through cycle
Initialize the count to 500
stealing at regular intervals. Consider a 2 MHZ
processor. If 0.5% processor cycles are used for LOOP: Load a byte from device
DMA, the data transfer rate of the device is _____ bit Store in memory at address given by address register
per second. Increment the address register
Decrement the court
3. [MCQ] [GATE-2020 : 1M]
If count! = 0 go to LOOP
Consider the following statements:
Assume that each statement in this program is
I. Daisy chaining is used to assign priorities in equivalent to a machine instruction which takes one
attending interrupts. clock cycle to execute if it is a non-load/store
II. When a device raises a vectored interrupt, the instruction. The load-store instructions take two clock
CPU does polling to identify the source of cycles to execute.
interrupt. The designer of the system also has an alternate
III. In polling, the CPU periodically checks the status approach of using the DMA controller to implement
bits to know if any device needs its attention. the same transfer. The DM controller requires 20
clock cycles for initialization and other overhead.
IV. During DMA, both the CPU and DMA controller
Each DMA transfer cycle takes two clock cycles to
can be bus masters at the same time.
transfer one byte of data from interrupt driven
Which of the above statements is/are TRUE? program-based input-output?
(a) I, II only (b) I and IV only (a) 3.4 (b) 4.4
(c) I and III only (d) III only (c) 5.1 (d) 6.7
4.61
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
4.62
GATE Wallah CS & IT Topic wise PYQs
I/O Interface
❑❑❑
4.63
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
1. (a) 0.5
2 106 = 10000 cycle
In DMA bulk amount of data transferred from Hard 100
disk (secondary Memory) to main memory with the Total number of cycle taken by the DMA for data
highest through put. transfer = 10, 000 cycle
In 1 cycle – 8 bit data transfer
In programmed I/O transfer CPU Time is depend on
speed of I/O device, so utilization is very less & not In 10,000 cycle = 10000 × 8 = 80000
used for bulk amount of data transfer. Data transfer rate = 80000
4.64
GATE Wallah CS & IT Topic wise PYQs
I/O Interface
4.65
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
7. (6.1 to 6.2) 600 sector /track each sector capcity = 512 Byte
Average disk access time or average read/write time 10000 rpm
= Average S.T + Average R.T + D.T.T + overhead (if 10000 rotation in 60 second
any given)
60
15000 RPM 1 rotation …..
10000
15000 rotation in 60 sec
2 ⇒ 6 × 10–3 sec
60 1 1000
In 1 rotation = = sec
15000 500 250 1000 1 rotation takes = 6 msec
4.66
GATE Wallah CS & IT Topic wise PYQs
I/O Interface
85594
Number of cylinders required to cross =
16 64
= 83 cylinder.
In 83 cylinder the number of sector = 83×16 ×64
= 84992
Number of sector remaining = 85594 – 84992
= 602 sector
602
Surface number = = 9 Surface.
64
(1 more cylinder required)
Number of cylinder = 83 + 1 = 84
Starting = 1200 + 84 = 1284
File size = 42,797 kB & each sector capacity = 512
byte.
Total number of sector needed (Required) to store the
42797 KB
file = = 85594 Sector
512 Byte 10. (b)
Range [o to 85593] Total 100 libraries
Starting (first) sector Address of the file = 1229416 Seek time = 10 msec
Last sector number of the file = 1229416 + 85594 – 1 D.T.T (neglected)
= 1315009
Rotational speed = 6000 rpm
Last Sector number = 1315009
<c, h, s > Average disk access time = S.T + Average R.T +
D.T.T
1315009
Cylinder number = = 1284.188 1
64 6 Average R.T = × rotational time
2
1284 cyclinder number
6000 rotation in 60 second
Number of sectors covered = 1284 × 16 × 64
60
= 1314816 sectors. 1 Rotation = = 10 msec
6000
Remaining sector = 1315009 – 1314816 = 193 sector
1
193 Average R.T = × 10 msec = 5 msec
Surface Number = =3 2
64
Total time 1 library access = S.T + R.L + D.T.T
64 sector per surface 16 Recording surface
⇒ 10 + 5 = 15 msec
c, h , s
Total tme taken for 100 libraries = 100 × 15 msec
= 100 × 5 × 10–3 m sec = 1.5 second
16 64
OR
Alternative Approach
Number of sector required = 85594
Need to cross = 85594 sector
4.67
GATE Wallah CS & IT Topic wise PYQs
Computer Organization and Architecture
12. (c)
63 sector per track
1 cylinder = 10 × 2 × 63 = 1260
13. (b)
Every time the head changes tracks, its speed and
direction change, which is just a change in motion or
the result of inertia.
< c, h, s> <400, 16, 29> Hence option (b) is correct.
400 cylinder = 400 [10 ×2 × 63]
16 surface = 16 × 63
29 sector = 29
Sector Number = 400 [10 ×2 × 63] + 16 × 63 + 29
= 400 × [1260] + 16 × 63 + 29
❑❑❑
4.68
GATE Wallah CS & IT Topic wise PYQs
1. Data Types and Operators ......................................................................................................... 5.1 – 5.3