Professional Documents
Culture Documents
COA Answer Key-15cs303-May'18
COA Answer Key-15cs303-May'18
PART A
MAR:
MAR are used to handle the data transfer between the main memory and the processor. The MAR holds the
address of the main memory to or from which data is to be transferred.
MDR:
MDR are used to handle the data transfer between the main memory and the processor. The MDR contains
the data to be written into or read from the addressed word of the main memory.
2. X=1010100 Y=1000011-Perform
a) X = 1010100
Answer: X - Y = 0010001
b) Y = 1000011
---------------
Sum = 1101111
There is no end carry, Therefore the answer is Y-X = - (2's complement of 1101111) = -0010001
Hardwired:
Micro programmed:
6. Delayed Branching
Delayed branch allows one or more instructions following the branch to be executed in the
pipeline whether the branch is taken or not.
A synchronous bus transmits bits of data by using a shared clock signal to synchronize the timing of both
the sender and the receiver. That's why it's called “synchronous". An asynchronous bus, on the other
hand, does not require a common clock signal to be shared between sender and receiver in order to work.
PART B
Multiplication requires the addition of several summands. A technique called carry-save addition (CSA)
can be used to speed up the process. Instead of letting the carries ripple along the rows, they can be “saved”
and introduced into the next row, at the correct weighted positions.
Explanation: (2 marks)
This frees up an input to each of three full adders in the first row. These inputs can be used to introduce the
third summand bits m2q2, m1q2, and m0q2. Now, two inputs of each of three full adders in the second row
are fed by the sum and carry outputs from the first row. The third input is used to introduce the bits m2q3,
m1q3, and m0q3 of the fourth summand. The high-order bits m3q2 and m3q3 of the third and fourth
summands are introduced into the remaining free full-adder inputs at the left end in the second and third
rows. The saved carry bits and the sum bits from the second row are now added in the third row, which is a
ripple-carry adder, to produce the final product bits.
Problem (2 marks)
A) M=101011 Q=101101
ANS: 11110001111
B) M=110101 Q=100011
ANS: 11100110111
The physical and logical structure of computers is normally described in reference manuals
provided with the system. Such manuals explain the internal construction of the CPU, including the
processor registers available and their logical capabilities.
ADD R1, R2, R3 To denote the operation R1 ← R2 + R3. The number of address fields in the
instruction can be reduced from three to two if the destination register is the same as one of the source
registers. Thus the instruction ADD R1, R2 Would denote the operation R1 ← R1 + R2. Only register
addresses for R1 and R2 need be specified in this instruction.
11.b.(i) A=110011
B=010101
Definition (2 marks)
A technique called bit-pair recoding of the multiplier results in using at most one summand for
each pair of bits in the multiplier. It is derived directly from the Booth algorithm.
Explanation (1 mark)
The pair (+1 −1) is equivalent to the pair (0 +1). That is, instead of adding −1 times the
multiplicand M at shift position i to +1 ×M at position i + 1, the same result is obtained by adding
+1 ×M at position i.
Problem: (5 marks)
ANS: 10000101111
Explanation-5 marks
Register Indirect: —The effective address of the operand is the contents of a register.
Indirection and pointers:
Register, absolute, and immediate modes directly provide the operand or address.
Other modes provide information from which the effective address of operand is derived
For program that adds numbers in a list, use register as pointer to next number.
Load R2, (R5)
Indexing:
Consider index mode in: Load R2, X(R5) Effective address is given by [R5] + X
assume operand address is 1020, 4 words (20 bytes) from start of array at 1000 Can put
start address in R5 and use X=20 Alternatively, put offset in R5 and use X=1000
Auto increment mode: effective address given by register contents; after accessing
operand, register contents incremented to point to next Useful for adjusting pointers in
loop body:
Add SUM, (Ri)+
MoveByte (Rj)+, Rk
Stores the contents of register R6 into memory location X + [R8]. It can be implemented as
follows:
1. Fetch the instruction and increment the program counter.
2. Decode the instruction and read registers R6 and R8.
3. Compute the effective address X + [R8].
4. Store the contents of register R6 into memory location X + [R8].
5. No action.
ALU
Datapath
PC_UPDATE:
Operand Forwarding
Pipeline stalls due to data dependencies can be alleviated through the use of operand forwarding.
Consider the pair of instructions discussed above, where the pipeline is stalled for three cycles to enable the
Subtract instruction to use the new value in register R2. The desired value is actually available at the end of
cycle 3, when the ALU completes the operation for the Add instruction. This value is loaded into register
which is a part of interstage buffer B3.
Rather than stall the Subtract instruction, the hardware can forward the value from register RZ to where it
is needed in cycle 4, which is the ALU input. The arrow shows that the ALU result from cycle 3 is used as
an input to the ALU in cycle 4. Modification needed in the datapath of to make this forwarding possible.
A new multiplexer, MuxA, is inserted before input In A of the ALU, and the existing multiplexer MuxB is
expanded with another input. The multiplexers select either a value read from the register file in the normal
manner, or the value available in register RZ.
Forwarding can also be extended to a result in register RY. This would handle a data dependency such as
the one involving register R2 in the following sequence of instructions:
Add R2, R3, #100
Or R4, R5, R6
Subtract R9, R2, #30
When the Subtract instruction is in the Compute stage of the pipeline, the Or instruction is in the Memory
stage (where no operation is performed), and the Add instruction is in the Write stage. The new value of
register R2 generated by the Add instruction is now in register RY. Forwarding this value from register RY
to ALU input InA makes it possible
When the Subtract instruction is in the Compute stage of the pipeline, the Or instruction is in the
Memory stage (where no operation is performed), and the Add instruction is in the Write stage.
The new value of register R2 generated by the Add instruction is now in register RY. Forwarding
this value from register RY to ALU input InA makes it possible
13.b Pipelining in CISC:
For pipelining in CISC processors, complications arise due to instructions that are variable in size,
have multiple memory operands and complex addressing modes, and use condition codes.
Instructions that occupy more than one word may take several cycles to fetch. Furthermore,
variability in instruction size and format complicates both decoding and operand access, as well as
management of the dispatch queue in a superscalar processor.
Instruction Move R5, (R8)+ has a side effect. Not only is the destination register R5 affected, but
source register R8 is also affected by the autoincrement operation.
.Compare R7, R8 Branch>0 TARGET the result of the Compare instruction affects the condition
code flags as a side effect. The Branch instruction, in turn, implicitly depends on this side effect.
The first Move instruction requires two operand accesses to the memory, while the second Move
instruction requires only one. Executing these instructions in a pipeline requires additional
hardware to stall the second Move instruction so that the first Move instruction can complete its
two operand accesses to the memory.
Definition-(2 marks)
A special control unit is provided to manage the transfer, without continuous intervention by the processor.
This approach is called direct memory access, or DMA.
Typical registers in DMA controllers with explanation: (3 marks)
To address
SET=
WORD =
If a program does not completely fit into the main memory, the parts of it not currently being executed are
stored on a secondary storage device, typically a magnetic disk. As these parts are needed for execution,
they must first be brought into the main memory, possibly replacing other parts that are already in the
memory. These actions are performed automatically by the operating system, using a scheme known as
virtual memory.
Explanation: 3 marks
Static RAMs are fast, but their cells require several transistors. Less expensive and higher density
RAMs can be implemented with simpler cells. But, these simpler cells do not retain their state for
a long period, unless they are accessed frequently for Read or Write operations. Memories that use
such cells are called dynamic RAMs (DRAMs).
Information is stored in a dynamic memory cell in the form of a charge on a capacitor, but this
charge can be maintained for only tens of milliseconds. Since the cell is required to store
information for a much longer time, its contents must be periodically refreshed by restoring the
capacitor charge to its full value. This occurs when the contents of the cell are read or when new
information is written into it.
To store information in this cell, transistor T is turned on and an appropriate voltage is applied to
the bit line. This causes a known amount of charge to be stored in the capacitor. After the
transistor is turned off, the charge remains stored in the capacitor, but not for long. The capacitor
begins to discharge.
This is because the transistor continues to conduct a tiny amount of current, measured in
picoamperes, after it is turned off. Hence, the information stored in the cell can be retrieved
correctly only if it is read before the charge in the capacitor drops below some threshold value.
The HDMI ports are found either on the video card or motherboard on the back of the computer. It
is important to note that not all computers and video cards have HDMI connects, and your computer may
only have a Display Port, DVI, or VGA connector. In the picture to the right is an example of some of these
connectors with an example of the HDMI connector.
B) PCI
Features: 2 marks
The PCI (Peripheral Component Interconnect) bus was developed as a low-cost, Processor-
independent bus. The peripheral components interconnect (PCI) bus is designed for multiprocessor
systems and high-performance peripherals, including audio and video systems and network adapters. It
is housed on the motherboard of a computer and used to connect I/O interfaces for a wide variety of
devices.
Device Configuration:
PCI incorporates in each I/O device interface a small configuration ROM memory that stores information
about that device. The PCI initialization software reads these ROMs and determines whether the device is a
printer, a keyboard, an Ethernet interface, or a disk controller.
15.b) i) Interrupts:
Definition: 2 marks
The program enters a wait loop in which it repeatedly tests the device status. During this period, the
processor is not performing any useful computation. There are many situations where other tasks can be
performed while waiting for an I/O device to become ready. To allow this to happen, we can arrange for the
I/O device to alert the processor when it becomes ready. It can do so by sending a hardware signal called an
interrupt request to the processor. Since the processor is no longer required to continuously poll the status
of I/O devices, it can use the waiting period to perform other useful tasks. Indeed, by using interrupts, such
waiting periods can ideally be eliminated.
Scenario: 2 marks
Definition: 2 marks
A simple way of implementing this task is to write a program that performs all functions needed to realize
the desired action. This method is known as program-controlled I/O.