Computer Organization and Architecture (COA) 2017 May - June Old Solved Question Paper
Computer Organization and Architecture (COA) 2017 May - June Old Solved Question Paper
Computer Organization and Architecture (COA) 2017 May - June Old Solved Question Paper
ORGANISATION AND
ARCHITECTURE
2017 MAY – JUNE OLD QUESTION PAPER
FACULTY OF ENGINEERING
Note: Answer all questions from Part - A and answer any five questions from Part-B.
11. a) Draw the flow chart for signed addition/subtraction and also draw the hardware required for that
7M
b)What are the difficulties of floating point representation? 3M
12. a) Explain timing and control unit of the general purpose computer. 5M
b) What is the program interrupt? Explain interrupt cycle in the computer. 5M
13. a) Draw the space time diagram for a four-segment pipeline showing the time it takes to process five
tasks. 6M
b) Explain various addressing modes in the general purpose computer. 4M
14. a) What are the different modes in DMA transfer? Explain operation of each mode. 5M
b) Explain CPU-IOP communication. 5M
15. Explain various address mapping techniques of the cache memory. 10M
16. a) Draw the flow chart for fixed point division algorithm. 5M
b) Explain Daisy-chain interrupt priority scheme. 5M
1|P ag e
COA QP (OLD MAY-JUNE 2017)
2|P ag e
COA QP (OLD MAY-JUNE 2017)
Clear E
Complement E
3|P ag e
COA QP (OLD MAY-JUNE 2017)
A)
SUBROUTINUE INTERRUPT
Initiated by execution of some Initiated by some external or
instruction. Internal signal.
Address of subroutine determined Address of the interrupt service
from the address part of the routine determined by the hardware.
instruction. Interrupt procedure stores all
Only the value of the PC stored before information to describe the state of
branching to the subroutine. the CPU.
Call occurs at the specific and Can ask for notice without prior
predetermined locations in the main Notice.
routine.
Software initiated. Hardware initiated.
each instruction).
4|P ag e
COA QP (OLD MAY-JUNE 2017)
used
Cycles Per Instruction Single cycle for all instructions and CPI between 2 and 15.
5|P ag e
COA QP (OLD MAY-JUNE 2017)
Thus, n = 16
Therefore total number of chips required to provide the storage capacity of 2048 Bytes is
16 Chips
1. RAM stands for Random Access It stands for Content Addressable Memory.
Memory.
2. In RAM, the user supplies a In associative memory, the user supplies data
memory address and RAM word and associative memory searches its entire
address.
compared to Associative
6|P ag e
COA QP (OLD MAY-JUNE 2017)
memory.
applications(programs) and
operation.
6. If the data word is found, RAM If the data word is found, It returns the list of
returns the data word. addresses where that data word was located.
7|P ag e
COA QP (OLD MAY-JUNE 2017)
Minuend is A Augend is A
Subtrahend is B Addend is b
=0 =1 =1 =0
As+Bs As+Bs
As=Bs As=Bs As=Bs
As=Bs
EA A+B+1
AVF 0 EA A+B
=0 =1
E Avf e
A<B A>B
=0 =0
A A
A
A A+1
As As
As 0
HARDWARE DESIGN
Bs B Register
Mode Control
Complementer
AVF
Input
S
Output Load
A Register
As Carry Sum
We designate the magnitude of the two numbers by A and B. Where the signed numbers are
added or subtracted, we find that there are eight different conditions to consider, depending
on the sign of the numbers and the operation performed
When the signs of A and B are same, add the two magnitudes and attach the sign of result is
that of A. When the signs of A and B are not same, compare the magnitudes and subtract the
smaller number from the larger. Choose the sign of the result to be the same as A, if A > B or
the complement of the sign of A if A < B. If the two magnitudes are equal, subtract B from A and
make the sign of the result will be positive
The signs use an exclusive OR gate where if the output is 0, then the signs are the same.
Hence , add the magnitude of the same signed numbers . If the sum is an overflow, then
a carry is stored in E where E=1 and transferred to the flip-flop AVF, add-overflow.
Otherwise, the signs are opposite and subtraction is initiated and stored in A.
NO overflow is occurred with subtraction so AVF is cleared.
If E=1 , then A >/ B.
9|P ag e
COA QP (OLD MAY-JUNE 2017)
A)
1)You can only represent numbers of the form y + x / 2 i .
4)IEEE Floating Point has Clear Mathematical Properties Represents numbers of the form ±M ×
2E .
10 | P a g e
COA QP (OLD MAY-JUNE 2017)
• In this organization, if the design has to be modified or changed, requires changes in the
wiring among the various components. Thus the modification of all the combinational circuits
may be very difficult.
• An instruction read from memory is placed in the instruction register (IR).
• The instruction register is divided into three parts: the I bit, operation code, and address part.
• First 12-bits (0-11) to specify an address, next 3-bits specify the operation code (opcode) field
of the instruction and last left most bit specify the addressing mode I. I = 0 for direct address I =
1 for indirect address
INSTRUCTION REGISTER (YR)
15 14 13 12 11 - 0 Other Inputs
15 14 ……………………2 1 0
4 * 16 Decoder
4 – bit Increment(INR)
Sequence Clear(CLR)
Counter(SC) Clock
• First 12-bits (0-11) are applied to the control logic gates. • The operation code bits (12 – 14)
are decoded with a 3 x 8 decoder.
• The eight outputs ( D0 through D7) from a decoder goes to the control logic gates to perform
specific operation.
• Last bit 15 is transferred to a I flip-flop designated by symbol I
11 | P a g e
COA QP (OLD MAY-JUNE 2017)
• The 4-bit sequence counter SC can count in binary from 0 through 15.
• The counter output is decoded into 16 timing pulses T0 through T15. • The sequence counter
can be incremented by INR input or clear by CLR input synchronously.
• For example: Consider the case where SC is incremented to provide timing signals T0, T1, T 2 ,
T3, and T4 in sequence. At time T4 , SC is cleared to 0 if decoder output D3 is active. This is
expressed symbolically by the statement: D3 T4 : SC ← 0
• The timing diagram shows the time relationship of the control signals.
T0 T1 T2 T3 T4 T0
CLOCK
T0
T1
T2
T3
T4
D3
CLR
SC
12 | P a g e
COA QP (OLD MAY-JUNE 2017)
ADVANTAGES:
• Hardwired Control Unit is fast because control signals are generated by combinational
circuits.
• The delay in generation of control signals depends upon the number of gates.
DISADVANTAGES:
• More is the control signals required by CPU; more complex will be the design of control unit.
• Modifications in control signal are very difficult. That means it requires rearranging of wires in
the hardware circuit.
• It is difficult to correct mistake in original design or adding new feature in existing design of
control unit.
Interrupt Cycle:
An instruction cycle (sometimes called fetch-and-execute cycle, fetch-decode-execute cycle, or
FDX) is the basic operation cycle of a computer. It is the process by which a computer retrieves
a program instruction from its memory, determines what actions the instruction requires, and
carries out those actions. This cycle is repeated continuously by the central processing unit
(CPU), from bootupto when the computer is shut down.
Check the
Fetch Next Execute interrupt ;process
START Instruction Instruction the interrupt
HALT
13 | P a g e
COA QP (OLD MAY-JUNE 2017)
START
LOAD PC CONTENT
TO THE MAR
UPDATE PC TO NEXT
ADDRESS
LOAD DATA
REQUIRED TO MDR
MAR CONTENTS TO
CIR
DECODE CIR
CONTENTS
YES
SET PC TO VALUE FROM
JUMP JUMP INSTRUCTION
NO
EXECUTE INSTRUCTION
NO YES SERVICE
INTERRUPT INTERRUPT
14 | P a g e
COA QP (OLD MAY-JUNE 2017)
After the execute cycle is completed, a test is made to determine if an interrupt was
enabled (e.g. so that another process can access the CPU)
If not, instruction cycle returns to the fetch cycle
If so, the interrupt cycle might performs the following tasks: (simplified...)
move the current value of PC into MBR
move the PC-save-address into MAR
move the interrupt-routine-address into PC
move the contents of the address in MBR into indicated memory cell
continue the instruction cycle within the interrupt routine
after the interrupt routine finishes, the PC-save-address is used to reset the value of PC
and program execution can continue
A)
CLOCK
INPUT
S 1
R1
S 2
R2
S 3
R3
S 4
R4
15 | P a g e
COA QP (OLD MAY-JUNE 2017)
1 2 3 4 5 6 7 8
FI DA FO EX
No
FI DA FO EX
Of
Task FI DA FO EX
FI DA FO EX
FI DA FO EX
NO Of Segments
16 | P a g e
COA QP (OLD MAY-JUNE 2017)
OPCODE OPERAND
2)a) Direct Addressing Mode:
Direct Addressing Mode is also known as “Absolute Addressing Mode”.In this mode the address
of data(operand) is specified in the instruction itself.That is, in this type of mode, the operand
resides in memory and its address is given directly by the address field of the instruction.
17 | P a g e
COA QP (OLD MAY-JUNE 2017)
Addressing Mode, the only difference is that the address field refers to a register instead of
memory location. i.e., EA=R
INSTRUCTION
OPCODE R REGISTER
R OPERAND
INSTRUCTION
REGISTER
OPCODE R
REGISTER MEMORY
1000 OPERAND
R 1000
18 | P a g e
COA QP (OLD MAY-JUNE 2017)
the value in other address field is R, which refers to a register whose contents are to be added
to produce effective address.
19 | P a g e
COA QP (OLD MAY-JUNE 2017)
o After transferring one byte, it disables HOLD signal and enters into slave mode.
o The microprocessor then gains control of the system bus and executes next
machine cycle. If the count is not zero and next data is available then the DMA
controller sends HOLD signal to the microprocessor and transfers next byte of
data block.
3. Transparent or Hidden DMA Transfer-
o The microprocessor executes some states during which it floats the address and
data buses.
o During these states, the microprocessor is isolated from the system bus.
o The DMA controller transfers data between memory and I/O devices during
these states. This operation is transparent to microprocessor.
o This is the slowest DMA transfer. In this mode, the instruction execution speed
of microprocessor is not reduced. But the transparent DMA requires logic to
detect the states when the microprocessor is floating the buses.
The IOP is interfaced to the 8086 system bus using a bus interface unit,as shown in Fig.
6.39. There is a 20-bit arithmetic-logic unit (ALU) that isused for address computations and an
assemble/disassemble unit that isused to change a 16-bit data unit into two 8-bit units and vice
versa, duringthe 8- and 16-bit data transfers. In Fig. 6.39, the IOP is attached to a 20-bit
Input/Output 33 data/address bus onto which all the other peripheral devices and
systemmemory are attached. The address and data are time-multiplexed on the20-bit
data/address bus. It is possible to configure a system with a separate I/O bus between the IOP
and the peripheral devices as shown in Fig. 6.40,thereby reducing the traffic on the system bus.
If such a local I/O bus is used, the IOP programs can be stored in the local memory attached to
the localbus, thereby further reducing the traffic on the system bus.
20 | P a g e
COA QP (OLD MAY-JUNE 2017)
Figure 6.41 shows the memory organization needed for the CPU/IOP communications.
Corresponding to each DMA channel in the IOP, there is a channel control block (CB) consisting
of a pointer to that channel’s para-meter block (PB), a channel status word, and a channel
command word. The PB pointer points to the PB of the channel, which contains a pointer to the
I/O program and all the required parameters for the I/O program. These parameterscorrespond
to the device addresses, memory buffer addresses, and so on.
The CPU first tests the channel through the status word, establishes
the command word and parameters in the PB, and commands the channelto start the I/O
through the ATTENTION CHANNEL signal. The336 Chapter 6 CHANNEL SELECT is used to select
one of the two channels. Once the I/O is complete, the channel produces an interrupt for the
CPU.
21 | P a g e
COA QP (OLD MAY-JUNE 2017)
CHANNEL SELECT
BUS
CONTROLLER
SYSTEM I/O
BUS DEVICES
MEMORY
IOP BUS
The CPU uses its IN and OUT (if the IOP is configured in the I/Oaddress space) or MOVE
instructions (if the IOP is configured for memorymapped I/O) to establish command word and
PB to sense the status of theIOP. The IOP instruction set consists of mainly data transfer
instructionsthat move data between its internal registers and the system bus. It can
Input/Output 337 perform fixed-point arithmetic (add, increment, and decrement) and has a
limited set of program control instructions. The IOP supports memory to memory block
transfers in addition to the data transfer between I/O devices and the memory.
22 | P a g e
COA QP (OLD MAY-JUNE 2017)
23 | P a g e
COA QP (OLD MAY-JUNE 2017)
where
i=cache line number
j= main memory block number
m=number of lines in the cache
For purposes of cache access, each main memory address can be viewed as consisting of three
fields. The least significant w bits identify a unique word or byte within a block of main
memory. In most contemporary machines, the address is at the byte level. The remaining s bits
specify one of the 2s blocks of main memory. The cache logic interprets these s bits as a tag of
s-r bits (most significant portion) and a line field of r bits. This latter field identifies one of the
m=2r lines of the cache.
CACHE MEMORY
TAG LINE-OFFSET WORD-OFFSET
SET(0)
CONTROL
SET((S-1)
LOGIC
CPU
24 | P a g e
COA QP (OLD MAY-JUNE 2017)
2)Associative Mapping –
In this type of mapping, the associative memory is used to store content and addresses of the
memory word. Any block can go into any line of the cache. This means that the word id bits are
used to identify which word in the block is needed, but the tag becomes all of the remaining
bits. This enables the placement of any word at any place in the cache memory. It is considered
to be the fastest and the most flexible mapping form.
MAIN MEMORY
SET(0)
BLOCK FRAME
………
BLK(0) BLK(1) ……. BLK(N-1)
CACHE
CPU
CONTROL
LOGIC
3)Set-associative Mapping –
This form of mapping is an enhanced form of direct mapping where the drawbacks of direct
mapping are removed. Set associative addresses the problem of possible thrashing in the direct
mapping method. It does this by saying that instead of having exactly one line that a block can
map to in the cache, we will group a few lines together creating a set. Then a block in memory
can map to any one of the lines of a specific set..Set-associative mapping allows that each word
that is present in the cache can have two or more words in the main memory for the same
index address. Set associative cache mapping combines the best of direct and associative cache
mapping techniques.
In this case, the cache consists of a number of sets, each of which consists of a number of lines.
The relationships are
m=v*k
25 | P a g e
COA QP (OLD MAY-JUNE 2017)
i= j mod v
where
i=cache set number
j=main memory block number
v=number of sets
m=number of lines in the cache number of sets
k=number of lines in each set
CACHE MEMORY
TAG SET-OFFSET WORD-OFFSET
MAIN MEMORY
BLK(N-1)
………..
SET(0) ………..
………..
………..
……….. SET(N-1)
………..
CACHE CPU
CONTROL
LOGIC
26 | P a g e
COA QP (OLD MAY-JUNE 2017)
AC DIividend
=0
BR
=0
Divide by
=0
0
AC
=0
QR 0 QS AS+BS
Q 0
SC N-1
EA A+B +1
1 E
0
A>=B A<B
A A+B A A+B
Shr A
A a+1
a a+b +1
a a + bias
q a
To Next Device
P1 P1 P0 P1 P0
P0
CPU
Interrupt Request
INT
Interrupt Acknowledge
INT ACK
28 | P a g e
COA QP (OLD MAY-JUNE 2017)
WORKING:
There is an interrupt request line which is common to all the devices and goes into the CPU.
When no interrupts are pending, the line is in HIGH state. But if any of the devices raises an
interrupt, it places the interrupt request line in the LOW state.
The CPU acknowledges this interrupt request from the line and then enables the interrupt
acknowledge line in response to the request.
If the device has not requested the interrupt, it passes this signal to the next device through its
PO(priority out) output. (PI = 1 & PO = 1)
The device consumes the acknowledge signal and block its further use by placing 0 at its
PO(priority out) output.
The device then proceeds to place its interrupt vector address(VAD) into the data bus of CPU.
The device puts its interrupt request signal in HIGH state to indicate its interrupt has been taken
care of.
NOTE: VAD is the address of the service routine which services that device.
If a device gets 0 at its PI input, it generates 0 at the PO output to tell other devices that
acknowledge signal has been blocked. (PI = 0 & PO = 0)
Hence, the device having PI = 1 and PO = 0 is the highest priority device that is requesting an
interrupt. Therefore, by daisy chain arrangement we have ensured that the highest priority
interrupt gets serviced first and have established a hierarchy. The farther a device is from the
first device, the lower its priority.
A)a)
STACK ORGANISARION:
Stack is a storage structure that stores information in such a way that the last item stored is the
29 | P a g e
COA QP (OLD MAY-JUNE 2017)
first item retrieved. It is based on the principle of LIFO (Last-in-first-out). The stack in digital
computers is a group of memory locations with a register that holds the address of top of
element. This register that holds the address of top of element of the stack is called Stack
Pointer.
Stack Operations:
1. Register Stack
2. Memory Stack
Register Stack:
A stack can be organized as a collection of finite number of registers that are used to
store temporary information during the execution of a program. The stack pointer (SP) is
a register that holds the address of top of element of the stack.
Memory Stack:
A stack can be implemented in a random access memory (RAM) attached to a CPU. The
implementation of a stack in the CPU is done by assigning a portion of memory to a stack
operation and using a processor register as a stack pointer. The starting memory location of
the stack is specified by the processor register as stack pointer.
30 | P a g e
COA QP (OLD MAY-JUNE 2017)
31 | P a g e
COA QP (OLD MAY-JUNE 2017)
only suitable for numerical problems that can be expressed in vector or matrix form and
they are not suitable for other types of computations.
PE1 m1
Master Control
Unit
PE2 m2
MAIN
MEMORY
PEn mn
Registers:
32 | P a g e
COA QP (OLD MAY-JUNE 2017)
Usually, the register is a static RAM or SRAM in the processor of the computer which is used for
holding the data word which is typically 64 or 128 bits. The program counter register is the most
important as well as found in all the processors. Most of the processors use a status word
register as well as an accumulator.
Register
Memory
Cache
Memory
Main Memory
Magnetic Disks
Magnetic Tape
Cache Memory
Cache memory can also be found in the processor, however rarely it may be another IC
(integrated circuit) which is separated into levels. The cache holds the chunk of data which are
frequently used from main memory. When the processor has a single core then it will have two
(or) more cache levels rarely. Present multi-core processors will be having three, 2-levels for
each one core, and one level is shared.
Main Memory
33 | P a g e
COA QP (OLD MAY-JUNE 2017)
The main memory in the computer is nothing but, the memory unit in the CPU that
communicates directly. It is the main storage unit of the computer. This memory is fast as well
as large memory used for storing the data throughout the operations of the computer. This
memory is made up of RAM as well as ROM
Magnetic Disks
The magnetic disks in the computer are circular plates fabricated of plastic otherwise metal by
magnetized material. Frequently, two faces of the disk are utilized as well as many disks may be
stacked on one spindle by read or write heads obtainable on every plane. All the disks in
computer turn jointly at high speed. The tracks in the computer are nothing but bits which are
stored within the magnetized plane in spots next to concentric circles. These are usually
separated into sections which are named as sectors.
Magnetic Tape
This tape is a normal magnetic recording which is designed with a slender magnetizable
covering on an extended, plastic film of the thin strip. This is mainly used to back up huge data.
Whenever the computer requires to access a strip, first it will mount to access the data. Once
the data is allowed, then it will be unmounted. The access time of memory will be slower within
magnetic strip as well as it will take a few minutes for accessing a strip.
34 | P a g e