DPCO Unit 4 2mark Q&A
DPCO Unit 4 2mark Q&A
DPCO Unit 4 2mark Q&A
Ans.: The complete instruction cycle involves three operations: Instruction fetching, opcode decoding
and instruction execution.
Ans.: In this cycle, the instruction is fetched from the memory location whose address is in the PC. This
instruction is placed in the Instruction Register (IR) in the processor.
Ans.: In this cycle, the opcode of the instruction stored in the instruction register is decoded/examined
to determine which operation is to be performed.
Ans.: In this cycle, the specified operation is performed by the processor. This often involves fetching
operands from the memory or from processor registers, performing an arithmetic or logical operation
and storing the result in the destination location.
During the instruction execution, PC contents are incremented to point to the next instruction. After
completion of execution of the current instruction, the PC contains the address of the next instruction
and a new instruction fetch cycle can begin.
Ans.: Datapath is an unit used to operate on or hold data within a processor. Its elements include the
instruction and data memories, the register file, the ALU and adders.
Ans.: All general purpose registers are combined into a single block called the register file.
Use of several smaller control units may also potentially increase the speed of the control unit.
1. It is inefficient. Because the longest possible path in the processor determines the clock cycle.
Remember that the clock cycle must have the same length for every instruction in single-cycle design.
2. The overall performance of a single-cycle implementation is likely to be poor, since the clock cycle is
too long.
3. The penalty for using the single-cycle design with a fixed clock cycle is significant. Single-cycle designs
for floating-point unit or an instruction set with more complex instructions do not work well at all.
4. It do not improve the worst-case cycle time. Thus it violates the great idea of making the common
case fast.
Ans.:•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.
• It has greater chip area efficiency since its uses less area on-chip.
Q.17 State the disadvantages of hardwired control unit.
Ans.: • More 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.
Ans.: A memory that is part of a control unit is referred to as a control memory. It stores the sequences
of micro-operations to be performed to execute microinstructions.
Ans.: Determining the address of the next microinstruction to be executed using microprogram
sequencer is called microprogram sequencing.
Ans.:Each computer instruction has its own microprogram routine in control memory to generate the
micro-operations that execute the instruction. To execute a particular computer instruction, accessing a
corresponding microinstruction routine, sequencing the microinstructions within the routine and if
necessary branching from one routine to another is known as address sequencing.
Ans.: Each word in the control memory is a microinstruction which specifies the control signals to be
activated to perform one or more micro-operations.
Ans.: The translation of symbolic microprogram to binary produces a binary microprogram called
microcode.
Ans.: A sequence of one or more micro-operations designed to perform specific operation, such as
addition, multiplication is called a microprogram.
Ans.: The control data register holds the present microinstruction while the next address is computed
and read from memory. This data register is sometimes called a pipeline register. It allows the execution
of micro-operations specified by the control word and the generation of the next microinstruction
simultaneously.
7.8 Pipelining
Q.27 Define pipelining.
Ans.: Pipelining is a technique of decomposing a sequential process into sub operations with each sub
process being executed in a special dedicated segment that operates concurrently with all other
segments.
S2- Decode (D): Decode the opcode and fetch source operand (s) if necessary.
Q.31 What is the ideal speed-up expected in a pipelined architecture with 'n' stages? Justify your
answer.
• The performance of pipelined processor depends on whether the functional units are pipelined and
whether they are multiple execution units to allow all possible combination of instructions in the
pipeline. If for some combination, pipeline has to be stalled to avoid the resource conflicts then there is
a structural hazard.
• In other words, we can say that when two instructions require the use of a given hardware resource at
the same time, the structural hazard occurs.
• The most common case in which this hazard may arise is in access to memory. One instruction may
need to access memory for storage of the result while another instruction or operand needed is being
fetched. If instructions and data reside in the same cache unit, only one instruction can proceed and the
other instruction is delayed. To avoid such type of structural hazards many processors use separate
caches for instruction and data.
Q.32 What is meant by hazard in pipelining?AU: May-13, 17
Ans.: Any reason that causes the pipeline to stall is called a hazard.
1. Structural hazards.
2. Data or Data dependent hazards.
3. Instruction or Control hazards.
Ans.: The hazard due to pipelining branch and other instructions that change the contents of program
counter is called instruction or control hazard.
Ans.: Rather than allowing the pipeline to stall, the compiler can rearrange instructions to avoid data
hazard. It is called pipeline scheduling.
Ans.: A load which requires that the following instruction do not use its result is said to be delayed load
and the pipeline slot after load instruction is called delayed slot.
Q.38 How addressing modes affect the instruction pipelining?AU : May-14Ans.: Degradation of
performance is an instruction pipeline may be due to address dependency where operand address
cannot be calculated without available information needed by addressing mode for e.g. an instructions
with register indirect mode cannot proceed to fetch the operand if the previous instructions is loading
the address into the register. Hence operand access is delayed degrading the performance of pipeline.
Ans.: A compiler translates a high level language program into a sequence of machine instructions. The
number of cycles required to execute program is dependent not only on the choice of instruction, but
also on the order in which they appear in the program. The compiler may rearrange program instruction
to achieve better performance of course, such changes must not affect of the result of the computation.
Q.41 Draw the structure of two stage instruction pipe line. AU: Dec.-07
Ans.: The Fig. 7.1 shows the structure of two stage instruction pipe line.
Q.42 What would be the effect, if we increase the number of pipelining stages? AU: Dec.-11
Ans.: As the number of pipeline stages increases, the probability of the pipeline being stalled also
increases because more instructions are being executed concurrently. Thus, dependencies between
instructions that are far apart may still cause the pipeline to stall.
As the number of pipeline stages increase, the branch penalties may become more significant.
Ans.: 1. The instruction cycle time of the processor is reduced increasing, instruction throughput.
2. Increase in pipeline stages increase number of instructions that can be processed at once which
reduces delay between completed instructions.
Ans.: Pipeline bubble or pipeline stall is a delay in execution of an instruction in an instruction pipeline in
order to resolve a hazard.
Ans.: Datapath element is unit used to operate on or hold data within a processor. In the MIPS
implementation, the datapath elements include the instruction and data memories, the register file, the
ALU, and adders.
Q.46 Name the control signals required to perform arithmetic operation. AU: May - 17
Ans.: Control signals RegDst, RegWrite and ALUop1 are required to perform arithmetic operation.
Q.47 What is data hazard in pipelining? What are the solutions ? AU: Dec.-07, May-12, 13
Ans.: When either the source or the destination operands of an instruction are not available at the time
expected in the pipeline and as a result pipeline is stalled, we say such a situation is a data hazard.
1. The easiest way to handle data hazards is to stall the pipeline.
2. The second simple hardware technique which can handle data hazard is called forwarding or register
by passing.
Ans.: The dispatch unit dispatches the instructions in the order in which they appear in the program. But
their execution may be completed in the different order because of data dependency among the
instructions. Such situation is called out-of order execution.
Ans.: The instruction throughput is the number of instructions executed per second. For sequential
execution, it is given by,
=R/S. where R is a clock rate measured in clocks per second and S is the average number of steps
needed to execute one machine instruction.
Ans.: The buffer in which the recent branch information is stored is called branch target buffer.
Ans.: The instruction fetch unit has executed the branch instruction concurrently with the execution of
other instructions. This technique is referred to as branch folding.
Ans.: A technique called delayed branching can minimize the penalty incurred as a result of conditional
branch instructions. The idea is simple. The instructions in the delay slots are always fetched. Therefore,
we would like to arrange for them to be fully executed whether or not the branch is taken. The objective
is to be able to place useful instructions in these slots. If no useful instructions can be placed in the delay
slots, these slots must be filled with NOP instructions.
Ans.: Speculative execution means that instructions are executed before the processor is certain that
they are in the correct execution sequence. Hence, care must be taken that no processor registers or
memory locations are updated until it is confirmed that these instructions should indeed be executed. If
the branch decision indicates otherwise, the instructions and all their associated data in the execution
units must be purged, and the correct instructions fetched and executed.
Q.59 What is called static and dynamic branch prediction ? or Differentiate between the static and
dynamic techniques. AU: May-13
Ans.: The branch prediction decision is always the same every time a given instruction is executed. Any
approach that has this characteristic is called static branch prediction. Another approach in which the
prediction decision may change depending on execution history is called dynamic branch prediction.
Q.60 What is the role of cache in pipelining? AU: Dec.-11.
Ans.: Each pipeline stage is expected to complete in one clock cycle. The clock period should be long
enough to let the slowest pipeline stage to complete. Faster stages have to wait for the slowest one to
complete. Since main memory is very slow compared to the execution, if each instruction needs to be
fetched from main memory, pipeline is almost useless. The cache memory reduces the memory access
time and makes pipelining useful.