0% found this document useful (0 votes)
16 views23 pages

unit 3 question bank solution

The document is a question bank solution for a Computer Organization and Architecture course at ABES Engineering College, covering topics such as pipelining performance, control units, microprogramming, and instruction formats. It includes comparisons between hardwired and microprogrammed control units, as well as distinctions between RISC and CISC architectures. Additionally, it details the organization of microprogrammed control units and their operational mechanisms, along with various program control instructions.

Uploaded by

roasterbyte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views23 pages

unit 3 question bank solution

The document is a question bank solution for a Computer Organization and Architecture course at ABES Engineering College, covering topics such as pipelining performance, control units, microprogramming, and instruction formats. It includes comparisons between hardwired and microprogrammed control units, as well as distinctions between RISC and CISC architectures. Additionally, it details the organization of microprogrammed control units and their operational mechanisms, along with various program control instructions.

Uploaded by

roasterbyte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

ABES ENGINEERING COLLEGE, GHAZIABAD

Unit-3
QUESTION BANK SOLUTION
SUBJECT NAME: COMPUTER ORGANIZATION AND ARCHITECTURE (COA)

SUBJECT CODE: BCS302

Q.1 How pipeline performance can be measured? Discuss. Give a space time diagram
for visualizing the pipeline behavior for a four stage pipeline.
Solution: Pipelining: A pipelining is a series of stages ,where some work is done at each stage .The
work is not finished until it has passed through all stages.It is a technique used in advanced
microprocessors where the microprocessor begin executing a second instruction before the first has
been completed
Performance of Pipelined Execution-
The following parameters serve as criterion to estimate the performance of pipelined
execution-
 Speed Up
 Efficiency
 Throughput
1. Speed Up-

It gives an idea of “how much faster” the pipelined execution is as compared to non-pipelined
execution.
It is calculated as-

2. Efficiency-The efficiency of pipelined execution is calculated as-


ABES ENGINEERING COLLEGE, GHAZIABAD

3. Throughput-
Throughput is defined as number of instructions executed per unit time.
It is calculated as-c

Total time to complete 6 tasks = 4+6 = 9 cycles


Q.2 What is the difference between hardwired and micro-programmed control
unit?
(2022-23)
Solution:
ABES ENGINEERING COLLEGE, GHAZIABAD

Hardwired Control Unit Microprogrammed Control Unit

Microprogrammed control unit


Hardwired control unit generates the control
generates the control signals with the
signals needed for the processor using logic
help of micro instructions stored in
circuits
control memory

Hardwired control unit is faster when


This is slower than the other as micro
compared to microprogrammed control unit
instructions are used for generating
as the required control signals are generated
signals here
with the help of hardwares

Difficult to modify as the control signals that Easy to modify as the modification need
need to be generated are hard wired to be done only at the instruction level

Less costlier than hardwired control as


More costlier as everything has to be realized
only micro instructions are used for
in terms of logic gates
generating control signals

It cannot handle complex instructions as the


It can handle complex instructions
circuit design for it becomes complex

Only limited number of instructions are used Control signals for many instructions
due to the hardware implementation can be generated

Used in computer that makes use of


Used in computer that makes use of Reduced
Complex Instruction Set
Instruction Set Computers(RISC)
Computers(CISC)

Q.3

Solution:
ABES ENGINEERING COLLEGE, GHAZIABAD

Q.4 Differentiate between horizontal microprogramming and vertical micro-programming ( 2017-


18).

Solution:

S.
No Horizontal µ-programmed CU Vertical µ-programmed CU

1. It supports longer control word. It supports shorter control word.

It allows a higher degree of


parallelism. If degree is n, then n It allows a low degree of parallelism i.e., the
Control Signals are enabled at a degree of parallelism is either 0 or 1.
2. time.

Additional hardware in the form of decoders


No additional hardware is required.
3. is required to generate control signals.

It is faster than a Vertical micro- it is slower than a Horizontal micro-


4. programmed control unit. programmed control unit.

It is more flexible than a vertical It is less flexible than horizontal but more
5. micro-programmed control unit. flexible than that of a hardwired control unit.

A horizontal micro-programmed A vertical micro-programmed control unit


control unit uses horizontal micro- uses vertical micro-instruction, where a code
instruction, where every bit in the is used for each action to be performed and
control field attaches to a control the decoder translates this code into
6. line. individual control signals.

The horizontal micro-programmed


The vertical micro-programmed control unit
control unit makes less use of ROM
makes more use of ROM encoding to reduce
encoding than the vertical micro-
the length of the control word.
7. programmed control unit.

Q.5: The memory unit of a computer has 256K words of 32 bits each. The computer has an
instruction format with four fields: an operation code field, a mode field to specify one of seven
addressing modes, a register address field to specify one of 60 processor registers and a
memory address. Specify the instruction format and the number of bits in each field if the
instruction is in one memory word. (2018-19)
Solution: : Instruction format (32- bit instruction):
ABES ENGINEERING COLLEGE, GHAZIABAD

Opcode Register Addressing Mode Memory Address


A computer has 256 K word memory i.e. memory is word addressable.

60 processor registers will require 6 bits (60 < 26)

7 addressing modes will require 3 bits (7 < 23)

memory address field will require 18 bits

so opcode will have 32 -(6+3+18) = 5

so maximum instructions the system supports = 32

Q.6 Explain the organization of the Micro-programmed control unit in details.


ABES ENGINEERING COLLEGE, GHAZIABAD

Q.7: What is a micro-program sequencer? With a block diagram, explain the


working of the micro-program sequencer. (2018-19)
Solution: Micro Instructions Sequencer is a combination of all hardware for selecting the next
micro-instruction address. The micro-instruction in control memory contains a set of bits to
initiate micro-operations in computer registers and other bits to specify the method by which
the address is obtained
ABES ENGINEERING COLLEGE, GHAZIABAD

Implementation of Micro Instructions Sequencer:


 Control Address Register(CAR) : Control address register receives the address
from four different paths. For receiving the addresses from four different paths,
Multiplexer is used.
 Multiplexer : Multiplexer is a combinational circuit which contains many data
inputs and single data output depending on control or select inputs.
 Branching : Branching is achieved by specifying the branch address in one of
the fields of the micro instruction. Conditional branching is obtained by using
part of the micro-instruction to select a specific status bit in order to determine
its condition.
 Mapping Logic : An external address is transferred into control memory via a
mapping logic circuit.
 Incrementer : Incrementer increments the content of the control address
register by one, to select the next micro-instruction in sequence.
 Subroutine Register (SBR) : The return address for a subroutine is stored in a
special register called Subroutine Register whose value is then used when the
micro-program wishes to return from the subroutine.
 Control Memory : Control memory is a type of memory which contains
addressable storage registers. Data is temporarily stored in control memory.
Control memory can be accessed quicker than main memory.

Q.8: Differentiate between RISC and CISC biased microprocessors. ( 2017-18)


Solution:

CISC RISC

Very few instructions are present. The


A large number of instructions are
number of instructions is generally less than
present in the architecture.
100.

Some instructions with long execution No instruction with a long execution time
times. These include instructions that due to a very simple instruction set. Some
copy an entire block from one part of early RISC machines did not even have an
memory to another and others that integer multiply instruction, requiring
copy multiple registers to and from compilers to implement multiplication as a
memory. sequence of additions.

Variable-length encodings of the Fixed-length encodings of the instructions


instructions. are used.
Example: IA32 instruction size can Example: In IA32, generally all instructions
range from 1 to 15 bytes. are encoded as 4 bytes.
ABES ENGINEERING COLLEGE, GHAZIABAD

CISC RISC

Multiple formats are supported for


specifying operands. A memory Simple addressing formats are supported.
operand specifier can have many Only base and displacement addressing is
different combinations of allowed.
displacement, base, and index register.

CISC supports array. RISC does not support an array.

Arithmetic and logical operations only use


register operands. Memory referencing is
Arithmetic and logical operations can
only allowed by loading and storing
be applied to both memory and register
instructions, i.e. reading from memory into
operands.
a register and writing from a register to
memory respectively.

Implementation programs are hidden


Implementation programs exposed to
from machine-level programs. The ISA
machine-level programs. Few RISC machines
provides a clean abstraction between
do not allow specific instruction sequences.
programs and how they get executed.

Condition codes are used. No condition codes are used.

Registers are being used for procedure


The stack is being used for procedure arguments and return addresses. Memory
arguments and returns addresses. references can be avoided by some
procedures.

Successful pipeline with one instruction


Unsuccessful pipeline
per cycle

Heavy use of RAM More efficient use of RAM

Q.9: What is micro programmed control unit? Give the basic structure micro programed
control unit and also discuss the micro instruction format and the control unit
organization for a typical micro programmed controllers using suitable diagrams (2017-
18).
Solution: A control unit whose binary control variables are stored in memory is known as a
microprogrammed control unit.
ABES ENGINEERING COLLEGE, GHAZIABAD

In Microprogrammed Control, the control information is stored in the control memory and is
programmed to initiate the required sequence of micro-operations.
By creating a definite collection of signals at each system clock beat, a controller generates
the instructions to be executed. Each of these output signals causes a single micro-operation,
such as register transfer. As a result, defined micro-operations that can be preserved in
memory are formed from the sets of control signals.
Each bit in the microinstruction is connected to a single control signal. The control signal is
active when its bit is set. The control signal becomes inactive when it is cleared. The internal
control memory can store a sequence of these microinstructions. A microprogram-controlled
computer's control unit is a computer within a computer.
The block diagram of a Microprogrammed Control Organization is shown below.

The microprogrammed control performs the following steps:-


1.) It can execute any instruction. It should be divided into a sequence of consecutive
operations by the CPU. This set of operations is called microinstruction. The control signals
are required for the sequential micro-operations to complete.
2.) Control signals saved in the ROM are created to execute the instructions on the data
direction. These control signals can be used to control the micro-operations associated with a
microinstruction at any time step.
3.) The following microinstruction address is generated.
4.) The last two steps are repeated till all of the microinstructions associated with the
instruction in the set are executed.
The micro counter register generates the address supported by the control ROM. The micro
counter obtains its inputs from a multiplexer that selects the output of an address ROM, a
current address incrementer, and an address saved in the next address field of the current
microinstruction.
A microinstruction format includes 20 bits in total. They are divided into four
elements as displayed in the figure.
ABES ENGINEERING COLLEGE, GHAZIABAD

F1, F2, F3 are the micro-operation fields. They determine micro-operations for the computer.

CD is the condition for branching. They choose the status bit conditions.

BR is the branch field. It determines the type of branch.

AD is the address field. It includes the address field whose length is 7 bits.

The micro-operations are divided into three fields of three bits each. These three bits can
define seven different micro-operations. In total there are 21 operations as displayed in the
table.

Q.10: Illustrate different types of Program Control Instructions and their types with
example.

Solution: Instructions of the computer are always stored in consecutive memory locations.
These instructions are fetched from successive memory locations for processing and
executing.

When an instruction is fetched from the memory, the program counter is incremented by 1
so that it points to the address of the next consecutive instruction in the memory. Once a data
transfer and data manipulation instruction are executed, the program control along with the
program counter, which holds the address of the next instruction to be fetched, is returned
to the fetch cycle.

Data transfer and manipulation instructions specify the conditions for data processing
operations, whereas the program control instructions specify the conditions that can alter the
content of the program counter.

The change in the content of the program counter can cause an interrupt/break in the
instruction execution. However, the program control instructions control the flow of program
execution and are capable of branching to different program segments.
ABES ENGINEERING COLLEGE, GHAZIABAD

Some of the program control instructions are listed in the table.

Q.11: Define vertical microprogramming and explain its advantages over horizontal
microprogramming.
Solution: The control unit (CU) is the engine that runs the entire functions of a computer
with the help of control signals in the proper sequence. In the micro-programmed control
unit approach, the control signals that are associated with the operations are stored in
special memory units. It is convenient to think of sets of control signals that cause specific
micro-operations to occur as being “micro-instructions”. The sequences of micro-
instructions could be stored in an internal “control” memory.
The micro-programmed control unit can be classified into two types based on the type of
Control Word stored in the Control Memory, viz., Horizontal micro-programmed control
unit and Vertical micro-programmed control unit.
 In the Horizontal micro-programmed control unit, the control signals are
represented in the decoded binary format, i.e., 1 bit/CS. Here ‘n’ control signals
require n bit encoding. On the other hand.
 In a Vertical micro-programmed control unit, the control signals are represented
in the encoded binary format. Here ‘n’ control signals require log2n bit encoding.

Difference between Horizontal and Vertical micro-programmed Control Unit:

S.
No Horizontal µ-programmed CU Vertical µ-programmed CU

1. It supports longer control word. It supports shorter control word.

It allows a higher degree of It allows a low degree of parallelism i.e., the


2. parallelism. If degree is n, then n degree of parallelism is either 0 or 1.
ABES ENGINEERING COLLEGE, GHAZIABAD

S.
No Horizontal µ-programmed CU Vertical µ-programmed CU

Control Signals are enabled at a


time.

Additional hardware in the form of decoders


No additional hardware is required.
3. is required to generate control signals.

It is faster than a Vertical micro- it is slower than a Horizontal micro-


4. programmed control unit. programmed control unit.

It is more flexible than a vertical It is less flexible than horizontal but more
5. micro-programmed control unit. flexible than that of a hardwired control unit.

A horizontal micro-programmed A vertical micro-programmed control unit


control unit uses horizontal micro- uses vertical micro-instruction, where a code
instruction, where every bit in the is used for each action to be performed and
control field attaches to a control the decoder translates this code into
6. line. individual control signals.

The horizontal micro-programmed


The vertical micro-programmed control unit
control unit makes less use of ROM
makes more use of ROM encoding to reduce
encoding than the vertical micro-
the length of the control word.
7. programmed control unit.

Example: Consider a hypothetical Control Unit that supports 4 k words. The Hardware
contains 64 control signals and 16 Flags. What is the size of control word used in bits and
control memory in a byte using:
a Horizontal Programming
ABES ENGINEERING COLLEGE, GHAZIABAD

b) Vertical programming

a) For Horizontal
64 bits for 64 signals % 16 bits for flags
Control Word Size = 64 + 16 = 80 bits
Control Memory = 4 kW = ( (4* 80) / 8 ) = 40 kByte
b) For Vertical
6 bits for 64 signals i.e log264
4 bits for 16 flags i.e log216
12 bits for 4K words i.e log2(4*1024)

Control Word Size = 4 + 6 + 12 = 22 bits

Control Memory = 4 kW = ( (4* 22) / 8 ) = 11 kByte

Q.12: What are the different types of instructions commonly found in computer
architectures? Provide examples of each.
Solution: These instructions are typically divided into three categories: data movement
instructions, arithmetic and logic instructions, and control instructions.

 Data movement instructions are used to move data between different parts of the
computer system. These instructions include load and store instructions, which
move data between memory and the CPU, and input/output (I/O) instructions,
which move data between the CPU and external devices.
 Arithmetic and logic instructions are used to perform mathematical operations and
logical operations on data stored in the system. These instructions include add,
subtract, multiply, and divide instructions, as well as logic instructions such as AND,
OR, and NOT.
 Control instructions are used to control the flow of instructions within the
computer system. These instructions include branch instructions, which transfer
control to different parts of the program based on specified conditions, and jump
instructions, which transfer control to a specified memory location.
ABES ENGINEERING COLLEGE, GHAZIABAD

The basic computer has 16-bit instruction register (IR) which can denote either memory
reference or register reference or input-output instruction.
1. Memory Reference – These instructions refer to memory address as an
operand. The other operand is always accumulator. Specifies 12-bit address, 3-
bit opcode (other than 111) and 1-bit addressing mode for direct and indirect
addressing.

Example – IR register contains = 0001XXXXXXXXXXXX, i.e. ADD after fetching


and decoding of instruction we find out that it is a memory reference
instruction for ADD operation.
Hence, DR ← M[AR]
AC ← AC + DR, SC ← 0
2. Register Reference – These instructions perform operations on registers rather
than memory addresses. The IR(14 – 12) is 111 (differentiates it from memory
reference) and IR(15) is 0 (differentiates it from input/output instructions). The rest
12 bits specify register operation.

Example – IR register contains = 0111001000000000, i.e. CMA after fetch and


decode cycle we find out that it is a register reference instruction for
complement accumulator.
Hence, AC ← ~AC
3. Input/Output – These instructions are for communication between computer and
outside environment. The IR(14 – 12) is 111 (differentiates it from memory
reference) and IR(15) is 1 (differentiates it from register reference instructions).
The rest 12 bits specify I/O operation.

Example – IR register contains = 1111100000000000, i.e. INP after fetch and


decode cycle we find out that it is an input/output instruction for inputing
character. Hence, INPUT character from peripheral device.
The set of instructions incorporated in16 bit IR register are:
1. Arithmetic, logical and shift instructions (and, add, complement, circulate left,
right, etc)
2. To move information to and from memory (store the accumulator, load the
accumulator)
3. Program control instructions with status conditions (branch, skip)
ABES ENGINEERING COLLEGE, GHAZIABAD

4. Input output instructions (input character, output character)


Q.14 What sub-cycles are involved in the fetch-execute cycle, and what happens during
each sub-cycle?
Solution:
ABES ENGINEERING COLLEGE, GHAZIABAD
ABES ENGINEERING COLLEGE, GHAZIABAD

Q.16 A processor has 40 distinct instruction and 24 general purpose register. A 32bit
instruction word has an opcode, two register operand. Evaluate the number of bits available
for the immediate operand fields. (2018-19)
Solution:

Q.17 Consider a non-pipelined system which takes 100ns to perform a task. The same task
can be performed using a 6 segment pipeline with cycle time of 19ns.
Calculate 1) speed up of pipeline for 1000 tasks.
2) What is the maximum speed up?
Soltion:
ABES ENGINEERING COLLEGE, GHAZIABAD

Q.20 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 ______.
Solution: delays = 10ns,20ns,14ns

total instruction (n) = 100 ns

We take pipeline delay as tp =max (10,20,14)=20

number of stages (k) =3

So,

Total execution time =(k+(n–1))× tp

⟹(3+100−1)×20ns

⟹2040ns
Q.21: A control unit generates 125 control signals which can be divided into 5 groups of
mutually exclusive signals as follows: Group 1 : 20 signals, Group 2 : 70 signals, Group 3
: 2 signals, Group 4 : 10 signals, Group 5 : 23 signals How many bits of the control words
can be saved by using vertical microprogramming over horizontal microprogramming?
Solution: In horizontal microprogramming we need 1 bit for every control word, therefore
total bits in
ABES ENGINEERING COLLEGE, GHAZIABAD

Horizontal Microprogramming =20+70+2+10+23=125

Now lets consider vertical microprogramming, In vertical microprogramming we use


Decoder (n to 2n) and output lines are equal to number of control words. A input is given
according to what control word we have to select.

Now in this question these 5 groups contains mutually exclusive signals, i.e, they can be
activated one at a time for a given group, we can safely use decoder.

group 1=⌈log2 20⌉=5 (Number of input bits for decoder, given output
is number of control word in given group)

group 2=⌈log2 70⌉=7

group 3=⌈log2 2⌉=1

group 4=⌈log2 10⌉=4

group 5=⌈log2 23⌉=5

Total bits required in vertical microprogramming =5+7+1+4+5=22

So number of control words saved =125−22=103

Q.22 Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with
combinational circuit only. The pipeline registers are required between each stage and at
the end of the last stage. Delays for the stages are 5, 6, 11, 8 and 1nanosec of pipeline
registers. What is the approximate speed up of the pipeline in steady state under ideal
conditions when compared to the corresponding non-pipeline implementation?
ABES ENGINEERING COLLEGE, GHAZIABAD

Solution:

Pipeline registers overhead is not counted in normal time execution


So the total count will be
5+6+11+8= 30 [without pipeline]
Now, for pipeline, each stage will be of 11 n-sec (+ 1 n-sec for overhead).
and, in steady state output is produced after every pipeline cycle. Here,
in this case 11 n-sec. After adding 1n-sec overhead, We will get 12 n-sec
of constant output producing cycle.
dividing 30/12 we get 2.5 Answer
Q.23 Write a program to evaluate the arithmetic statement:
X=A-B+C*(D*E-F)
G+H*K

a) Using a general register computer with three instructions.


b) Using a general register computer with two instructions.
c) Using a general register computer with one instructions.
d) Using a general register computer with zero instructions
ABES ENGINEERING COLLEGE, GHAZIABAD

Solution:
ABES ENGINEERING COLLEGE, GHAZIABAD
ABES ENGINEERING COLLEGE, GHAZIABAD

You might also like