Professional Documents
Culture Documents
PART-A
PART - A
YEAR/SEM: II/III
UNIT I
1. What is a diode?
Diode Di + ode
Di means two and ode means electrode. So physical contact of two electrodes is known as diode
and its important function is alternative current to direct current.
2. State the applications of a diode
Some of the typical applications of diodes include:
II Yr/III Sem
PART-A
II Yr/III Sem
10.
Write down the formulas for rectifier efficiency and ripple factor?
11.
PART-A
When a single rectifier diode unit is placed in series with the load across an ac supply, it converts
alternating voltage into uni-directional pulsating voltage, using one half cycle of the applied
voltage, the other half cycle being suppressed because it conducts only in one direction. Unless
there is an inductance or battery in the circuit, the current will be zero, therefore, for half the
time. This is called half-wave rectification.
12.
The average voltage or the dc voltage available across the load resistance is
15.
What are the advantages of zener diode
The main application of zener diodes are as voltage regulator, as a fixed reference voltage in
transistor biasing circuit, as peak clipper or limiters in wave shaping circuits and as a protector of
volt meter damages.
MVIT/Dept of IT/2016-2017/ ODD SEM
II Yr/III Sem
PART-A
Overvoltage protection is done by using Zener diodes because there is current flowing through
the diode after the reverse bias voltage exceeds a certain value. This circuit provides safety for
the equipment connected at the terminals. Normally the current should not exceed normal valve
but if due to any fault in the circuit the current exceeds the maximum allowable limit, the
equipment of the system can be damaged permanently.
16.
Zener doide
PN diode
17.
Define clippers?
Clipping circuits (also known as limiters, amplitude selectors, or slicers), are used to remove
the part of a signal that is above or below some defined reference level.
18.
Define clampers?
Clamping circuits, also known as dc restorers or clamped capacitors, shift an input signal by
an amount defined by an independent voltage source. While clippers limit the part of the input
signal that reaches the output according to some reference level(s), the entire input reaches the
output in a clamping circuit it is just shifted so that the maximum (or minimum) value of the
input is clamped to the independent source.
19.
Voltage Multipliers are simple circuits made from diodes and capacitors that can increase the
input voltage by two, three, or four times and by cascading together individual half or full stage
multipliers in series to apply the desired DC voltage to a given load without the need for a stepup transformer.
Voltage multiplier circuits are classified as voltage doublers, triplers, or quadruplers, etc,
depending on the ratio of the output voltage to the input voltage.
20.
Voltage Doubler is a voltage multiplier circuit which has a voltage multiplication factor of two.
The circuit consists of only two diodes, two capacitors and an oscillating AC input voltage (a
MVIT/Dept of IT/2016-2017/ ODD SEM
II Yr/III Sem
PART-A
PWM waveform could also be used). This simple diode-capacitor pump circuit gives a DC
output voltage equal to the peak-to-peak value of the sinusoidal input. In other words, double the
peak voltage value because the diodes and the capacitors work together to effectively double the
voltage.
21.
A voltage tripler circuit consists of one and a half voltage doubler stages. This voltage
multiplier circuit gives a DC output equal to three times the peak voltage value (3Vp) of the
sinusoidal input signal. As with the previous voltage doubler, the diodes within the voltage tripler
circuit charge and block the discharge of the capacitors depending upon the direction of the input
half-cycle.
Then 1Vpis dropped across C3 and 2Vp across C2 and as the two capacitors are in series, this
results in the load seeing a voltage equivalent to 3Vp. Note that the real output voltage will be
three times the peak input voltage minus the voltage drops across the diodes used, 3Vp
V(diode).
If a voltage tripler circuit can be made by cascading together one and a half voltage multipliers,
then aVoltage Quadrupler Circuit can be constructed by cascading together two full voltage
doubler circuits as shown.
22.
II Yr/III Sem
PART-A
UNIT II
1. Define thyristors?
A thyristor is normally four layer three-terminal device. Four layers are formed by alternating
n type and p type semiconductor materials. Consequently there are three p n junctions
formed in the device. It is a bistable device. The three terminals of this device are called anode
(A), cathode (K) and gate (G) respectively. The gate (G) terminal is control terminal of the
device. That means, the current flowing through the device is controlled by electrical signal
applied to the gate (G) terminal. The anode (A) and cathode (K) are the power terminals of the
device handle the large applied voltage and conduct the major current through the thyristor.
2. What are unidirectional thyristors
The thyristors which conduct in forward direction only are called as unidirectional thyristors. Ex:
SCR, Light Activated SCR (LASCR) and silicon control switch (SCS).
3. State the applications of thyristors
II Yr/III Sem
PART-A
A thyristor is designed to handle large current and voltage, it is used mainly in electrical power
circuit with system voltage more than 1 kV or currents more than 100 A. The main advantage of
using thyristors as power control device is that as the power is controlled by periodic on off
switching operation hence (ideally) there is no internal power loss in the device for controlling
power in output circuit. Thyristors are commonly used in some alternating power circuits to
control alternating output power of the circuit to optimize internal power loss at the expense of
switching speed.
4. Write a short note on SCR with its applications
The SCR stand for Silicon Control Rectifier, it is used in industries because it can handle high
values of current and voltage. Three terminals of SCR are
Anode - P-layer
Cathode - N-layer (opposite end)
Gate - P-layer near the cathode
Hence it has three junctions and four layers
Application
5.
SCR as a switch
SCR Half and Full wave rectifier
SCR as a static contactor
SCR for power control
SCR for speed control of d.c. shunt motor
Over light detector
Draw the neat diagram of SCR with its equivalent circuit of SCR
II Yr/III Sem
PART-A
II Yr/III Sem
PART-A
13.
Write a note on LED?
A light emitting diode (LED) is known to be one of the best optoelectronic devices out of the lot.
The device is capable of emitting a fairly narrow bandwidth of visible or invisible light when its
internal diode junction attains a forward electric current or voltage. The visible lights that an
LED emits are usually orange, red, yellow, or green. The invisible light includes the infrared
MVIT/Dept of IT/2016-2017/ ODD SEM
II Yr/III Sem
PART-A
light. The biggest advantage of this device is its high power to light conversion efficiency. That
is, the efficiency is almost 50 times greater than a simple tungsten lamp.
14.
Liquid crystal cell displays (LCDs) are used in similar applications where LEDs are used.
These applications are display of numeric and alphanumeric characters in dot matrix and
segmental displays.
The LCDs are of two types :
Dynamic scattering type and
Field effect type.
The liquid crystal material may be one of the several organic compounds which exhibit optical
properties of a crystal though they remain In liquid form. Liquid crystal is layered between glass
sheets with transparent electrodes deposited on the inside faces. When a potential is applied
across the cell, charge carriers flowing through the liquid disrupt the molecular arrangement and
produce turbulence. When the liquid is not activated, it is transparent. When the liquid is
activated the molecular turbulence causes light to be scattered in all directions and the cell
appears to be bright. The phenomenon is called dynamic scattering.
The construction of a field effect liquid crystal display is similar to that of the dynamic scattering
type, with the exception that two thin polarizing optical filters are placed at the inside of each
glass sheet. The liquid crystal material in the field effect cell is also of different type from that
employed in the dynamic scattering cell. The material used is twisted nematic type and actually
twists the light passing through the cell when the latter is not energized. This allows the light to
pass through the optical filters and the cell appears bright. When the cell is energized, no twisting
of light takes place and the cell appears dull.
15.
low forward voltage drop and a very fast switching action. There is a small voltage drop across
the diode terminals when current flows through a diode. A normal diode will have a voltage drop
between 0.6 to 1.7 volts, while a Schottky diode voltage drop is usually between 0.15 and 0.45
volts. This lower voltage drop provides better system efficiency and higher switching speed. In a
Schottky diode, a semiconductormetal junction is formed between a semiconductor and a metal,
thus creating a Schottky barrier. The N-type semiconductor acts as the cathode and the metal
10
II Yr/III Sem
PART-A
side acts as the anode of the diode. This Schottky barrier results in both a low forward voltage
drop and very fast switching.
16. Write a note on varactor diode
Varactors are operated in a reverse-biased state. No current flows, but since the thickness of the
depletion zone varies with the applied bias voltage, the capacitance of the diode can be made to
vary. Generally, the depletion region thickness is proportional to the square root of the applied
voltage; capacitance is inversely proportional to the depletion region thickness. Thus, the
capacitance is inversely proportional to the square root of applied voltage. All diodes exhibit this
phenomenon to some degree, but varactor diodes are manufactured specifically to exploit this
effect and increase the capacitance (and thus the range of variability), whereas most ordinary
diode fabrication strives to minimize the capacitance. A varactor diode is best explained as a
variable capacitor. Think of the depletion region as a variable dielectric. The diode is placed in
reverse bias. Junction capacitance is present in all reverse biased diodes because of the depletion
region.
17. Write briefly on Tunnel diode.
A tunnel diode or Esaki diode is a type of semiconductor that is capable of very fast operation,
well into the microwave frequency region, made possible by the use of the quantum mechanical
effect called tunneling.
It was introduced by Leo Esaki in 1958.Heavily-doped p-n junction.Impurity concentration is
1part in 10^3 as compared to 1 part in 10^8 in p-n junction diode.Width of the depletion layer is
very small (about 100 A). It is generally made up of Ge andGaAs.
18. With neat diagram, explain photo-diode
Photo junction Devices are basically PN-Junction light sensors or detectors made from silicon
semiconductor PN-junctions which are sensitive to light and which can detect both visible light
and infra-red light levels.
19. With neat diagram, explain photo-transistor
An alternative photo-junction device to the photodiode is the Phototransistor which is basically a
photodiode with amplification. The Phototransistor light sensor has its collector-base PNjunction reverse biased exposing it to the radiant light source. Figure 5.38 Photo-transistor
Symbol. Phototransistors operate the same as the photodiode except that they can provide current
gain and are much more sensitive than the photodiode with currents are 50 to 100 times greater
than that of the standard photodiode and any normal transistor can be easily converted into a
phototransistor light sensor by connecting a photodiode between the collector and base.
MVIT/Dept of IT/2016-2017/ ODD SEM
11
II Yr/III Sem
PART-A
Phototransistors consist mainly of a bipolar NPN Transistor with its large base region electrically
unconnected, although some phototransistors allow a base connection to control the sensitivity,
and which uses photons of light to generate a base current which in turn causes a collector to
emitter current to flow. Most phototransistors are NPN types whose outer casing is either
transparent or has a clear lens to focus the light onto the base junction for increased sensitivity.
UNIT III
1. Write the Hybrid parameters equation for transistor amplifier?
Vi= hi Ii + hrVo
Io = hfIi + hoVo
In matrix
2.
Why hybrid parameters are called so? Define them?
The dimensions of the hybrid parameters are not alike, that is they are hybrid in nature so they
are called hybrid parameters.
h11 = [ V1/I1] at V2=0; h11 = Input impedance with output port short circuited.
h12 = [ V1/V2] at I1=0; h12 = Reverse voltage gain with input port open circuited.
h21 = [ I2/I1] at V2=0; h11 = Forward current gain with output port short circuited.
h22 = [ I2/V2] at I1=0; h11 = output impedance with input port open circuited.
3.
Hybrid equation:
Vi= hi Ii + hr Vo
Io = h f Ii + ho V o
4.Draw a CE amplifier and its hybrid representation?
12
II Yr/III Sem
5.
6.
7.
What is an amplifier?
PART-A
An amplifier is a circuit, which can be used to increase the amplitude of the input current or
voltage at the output by means of energy drawn from an external source.
8. Based on the transistor configuration how amplifiers are classified.
Based on transistor configuration, the amplifier are classified as
a. Common Emitter amplifier
b. Common Collector amplifier
c. Common Base amplifier
8. List out the classification of large signal amplifiers?
The large signal amplifiers are classified as follows.
a. Based on the input
i. small signal amplifiers
ii. large signal amplifiers
b. Based on the output
I. Voltage amplifier
II. Power amplifier
III. Current amplifier
c. Based on the transistor configuration
I. CE amplifier
II. CB amplifier
III. CC amplifier
d. Based on the number of stages
MVIT/Dept of IT/2016-2017/ ODD SEM
13
II Yr/III Sem
PART-A
When the input or output impedence is not of the correct magnitude , for a particular
application 2 or more stages are connected.
10. What are the marits of cascade amplifier?
Gain increases
Bandwidth reduces
Class A
Class B
Class C
Class D
Class AB
14
II Yr/III Sem
14.
PART-A
15
II Yr/III Sem
PART-A
operated as binary switches. Since the power handling devices (MOSFETS) works as
perfect binary switches, no time is wasted in between the transition of stages and no power
is wasted in the zero input condition. Class D power amplifiers are much power efficient
when compared to its predecessors like Class A, Class B and Class AB.
21. What is class AB power amplifier?
Class AB amplifier is an amplifier configuration that stands somewhere between Class A
and Class B configurations.
22. What is the difference between voltage amplifier and power amplifier?
23.
S.No
Characteristics
Voltage Amplifier
Power Amplifier
Current Gain
Low 20-50
Collector Load
Low 5-20
Input Voltage
Low, a few mV
High, 2-4V
Collector Current
Power output
Low
High
Power dissipation
capacity
Output Impedence
Coupling
Usually RC coupling
Transformer or tuned
circuit
The efficiencyof an amplifier represents the amount of a,c power delivered or transferred to
the load, from thed.c source i.e accepting the d.c. power input.
The generalisedexpression for an efficiency of an amplifier is,
24. List the difference of Class A,B,C &AB power amplifier
Class
Conduction
Angle
A
360o
180o
AB
180 to 360o
In
Position of
the Q-point
X-axis
on
the Below
X-axis
the
between
Load
Line
MVIT/Dept of IT/2016-2017/ ODD SEM
the
16
II Yr/III Sem
Overall
Efficiency
Signal
Distortion
PART-A
Poor
Better
25 to 30%
70 to 80%
None if Correctly At
Biased
Higher
the
than 80%
X-axis
Crossover Point
Large Amounts
Better
than
27.
Sl.No.
Class A amplifier
Advantages
Disadvantages
Two centre tap transformers are necessary
The transformers, make the circuit bulky and hence costlier.
Frequency response is poor.
28. What is meant by cross over distortion in class B power amplifier and how it is
corrected? (OR) What is called as crossover distortion and how to minimize this
distortion?
MVIT/Dept of IT/2016-2017/ ODD SEM
17
II Yr/III Sem
PART-A
Transistors do not turn ON below 0.7V applied to the emitter junction. Therefore the
sinusoidal base voltage excitation will not result in the sinusoidal output current. This cause
one transistor off before the other begins on. This distortion is introduced during the time
when the operation crosses over from one transistor to the other transistor. This effect is called
cross-over distortion.
To overcome cross-over distortion, the transistors must operate in class AB mode where a
small standby current flows at zero excitation.
29. What are the Applications of Class C power amplifier?
RF oscillators.
RF amplifier.
FM transmitters.
Booster amplifiers.
Distortion: The difference between the output waveform and the input waveform in an
amplifier.
different amounts.
Phase or delay distortion: If the phase shift between input and output waveforms depends
Cross-over distortion: Transistors do not turn ON below 0.7V applied to the emitter
18
II Yr/III Sem
PART-A
junction. Therefore the sinusoidal base voltage excitation will not result in the sinusoidal
output current. This cause one transistor off before the other begins on. This distortion is
introduced during the time when the operation crosses over from one transistor to the other
transistor.
33. Why do you call FET as field effect transistor?
The name field effect is derived from the fact that the current is controlled by an electric
field set up in the device by an external voltage, applied across gate and source terminals,
which reverse bias the junctions.
34. What is a FET?
A field effect (FET) is a three terminal semiconductor device in which current conduction
takes place by only one type of carriers (either holes or electron) and is controlled by an
electric field.
35.Why FET is called an unipolar device?
The operation of FET depends upon the flow of majority carriers only (either holes or
electrons) so the FET is said to be an unipolar device.
36.Define pinch off voltage?
It is the voltage at which the channel is pinched off, i.e. all the free charge from the channel
get removed. At Pinch-off voltage VP the drain current becomes constant.
37. Define drain resistance?
Drain resistance (rd) is defined as the ratio of small change in drain to source voltage (Vds) to
the corresponding change in drain current (Id) at constant gate to source voltage (Vgs). rd =
Vds / Id at constant gate to source voltage (Vgs)
38. Write down the relationship between various FET parameters?
Amplification factor = drain resistance * Transconductance = rd * gm
39. Mention the applications of FET.
FET is used as a buffer in measuring instruments, receivers since it has high i/p impedance and
low o/p impedance.
FETS are used in RF amplifiers in FM tuners and communication equipment for the low noise
level.
Since the device is voltage controlled, it is used as a voltage variable resistor in op-amps and
tone controls.
Used as phase shift oscillator because frequency drifts is low.
40. Why the input impedance of FET is more than that of a BJT?
The input impedance of FET is more than that of a BJT because the input circuit of FET is
reverse biased whereas the input circuit of BJT is forward biased.
41. What is meant by gate source threshold voltage of a FET?
MVIT/Dept of IT/2016-2017/ ODD SEM
19
II Yr/III Sem
PART-A
The voltage at which the channel is completely cur off and the drain current becomes zero is
called as gate source threshold voltage. Also called as VGS(off).
42.Why N channel FETs are preferred over P channel FETs?
In N channel FET the charge carriers are the electrons which have a mobility of about 1300 cm2/
VS, whereas in P channel FETs the charge carriers are the holes which have a mobility of about
500 cm2 /VS. the current in a semiconductor is directly proportional to mobility. Therefore the
current in N channel FET is more than that of P channel FET.
UNIT IV
Give the expression for the frequency of oscillations in a sine wave oscillator?
The expression for the frequency of oscillations in an op-amp sine wave oscillator is, f = 1 /
(2RC) 63.
2.What are the conditions for sustained oscillator or what is Barkhausen criterion?
Condition for sustained oscillation, a. Magnitude condition |Av| = 1 b. Phase condition Av =
0 These conditions are called as Barkhausen criterion.
3. What is Oscillator circuit?
A circuit with an active device is used to produce an alternating current is called an oscillator
circuit.
4.What are the classifications of Oscillators?
*Based on wave generated: i. Sinusoidal Oscillator, ii. Non-sinusoidal Oscillator or Relaxation
Oscillator Ex: Square wave, Triangular wave, Rectangular wave etc. *According to principle
involved: i. Negative resistance Oscillator, ii. Feedback Oscillator. *According to frequency
generated: i.Audio frequency oscillator 20 Hz 20 kHz ii.Radio frequency Oscillator 30 kHz
30 MHz iii. Ultrahigh frequency Oscillator 30 MHz 3 GHz iv.Microwave Oscillator 3 GHz
above. * Crystal Oscillators.
5.What are the types of feedback oscillators?
MVIT/Dept of IT/2016-2017/ ODD SEM
20
II Yr/III Sem
PART-A
21
II Yr/III Sem
PART-A
UNIT V
1.
What is an op-amp?
22
II Yr/III Sem
PART-A
It is defined as the algebraic difference between the current entering the inverting and noninverting terminal of an op-amp.
6.Define input bias current?
It is defined as the average of the currents entering into the input terminals of an op-amp.
7.What are the two compensating techniques used in frequency compensation?
Two types of compensating techniques are used, they are, a. External compensation b. Internal
compensation
8.What is compensated op-amp?
Op-amp, which uses a capacitor internally for compensation, is called a compensated op-amp.
This op-amp has a high gain stability and low bandwidth.
input bias current b. Input offset current c .Input offset voltage d. Thermal drift
15. What is the type of feedback employed in the inverting op-amp amplifier?
23
II Yr/III Sem
PART-A
24
II Yr/III Sem
PART-A
A Schmitt trigger is a comparator with a small amount of positive feedback applied to create a
hysteresis for the input level.
25
II Yr/III Sem
PART-A
Linear
data structure
Ex: list, stacks, queues
non linear
data structure
Ex: trees, graphs
An Abstract Data Type (ADT) is a set of operations. Abstract data types are mathematical
abstractions; nowhere in an ADT's definition is there any mention of how the set of
operations is implemented. This can be viewed as an extension of modular design.
Objects such as lists, sets, and graphs, along with their operations, can be viewed as
abstract data types, just as integers, reals, and booleans are data types. Integers, reals, and
Booleans have operations associated with them, and so do abstract data types. For the set
ADT, there are various operations as union, intersection, size, and complement.
Alternately, the two operations union and find, which would define a different ADT on
the set.
The basic idea is that the implementation of these operations is written once in the
program, and any other part of the program that needs to perform an operation on the
ADT can do so by calling the appropriate function. If for some reason implementation
26
II Yr/III Sem
PART-A
details need to change, it should be easy to do so by merely changing the routines that
perform the ADT operations. This change, in a perfect world, would be completely
transparent to the rest of the program.
5. Define a stack.
A stack is an ordered collection of homogeneous data elements, where the insertion and
deletion operation take place at one end.(LIFO)
Similar to array and linked list, attack is also linear data structure.
Only difference compared to array and link list, insertion and deletion operations takes
place at any position.
In stack, Insertion and deletion operation specially termed as PUSH and POP
respectively.
Some terminologies of stack are TOP, ITEM, and SIZE.
TOP Position of the stack, where operations are preformed.
ITEM Element in a stack.
SIZE Maximum number of elements that a stack can accommodate.
performed on a stack.
27
II Yr/III Sem
PART-A
Move the operators one by one to their right, such that each operator replaces their
corresponding right parenthesis.
The part of the expression, which has been converted into postfix is to be treated as single
operand.
or n!= n x (n-1)!
The last expression is the recursive description of the factorial whereas the first is the iterative
definition.
10. Define linked list.
Linked list consists of a series of structures, which are not necessarily adjacent in memory. Each
structure contains the element and a pointer to a structure containing its successor. We call this
the Next Pointer. The last pointer points to NULL.
The two fields of linked list.
MVIT/Dept of IT/2016-2017/ ODD SEM
28
II Yr/III Sem
PART-A
Info field
Next field
29
II Yr/III Sem
PART-A
Linked Lists
Size of a list is variable
It is not necessary to specify the number of
elements during declaration
Insertions and deletions are carried
out easily
It occupies less memory than a linked list for It occupies more memory
the same number of elements
16. Define sparse matrix.
A sparse matrix is a matrix populated primarily with zeros as elements of the table. The fraction
of zero elements in a matrix is called the sparsity.
30
II Yr/III Sem
PART-A
UNIT II
1. What is Queue?
Queue is a linear and static data structure.
Queue is an ordered collection of elements in which we can insert an element at one end
called Rear and delete an element at another end called Front.
Initial condition of the stack Rear=Front=-1.
MVIT/Dept of IT/2016-2017/ ODD SEM
31
II Yr/III Sem
It is otherwise called as FIFO (First In First Out).
PART-A
QUEUE
USING
LINKED LIST
REAR=N
FRONT=1
FRONT=0
REAR =0
P1
P2
P3
P4
P5
P6
P7
P8
32
II Yr/III Sem
PART-A
6. A priority queue does not follow the basic principle of priority queue as follows
i. An element of higher priority processed before any element of lower priority.
ii. Two elements of same priority are processed according to the order in which they
were added to the queue.
4. Define Dequeue.
In generally , liner queue usual practices FIFO .
Elements are added from the rear and elements are deleted from the front.
But in doubly ended queue we can make use of both end for insertion and deletion.
That mean possible to insert the elements by rear as well as front.
Similarly it is possible to delete the elements by rear as well as front.
Insertion by front end
Deletion by front end
10
20
30
40
50
Insertion by Rear
33
II Yr/III Sem
PART-A
The new data item is inserted in priority queue without affecting the descending order of
queue.
It means we can insert the element only at one end and delete the elements at both ends.
The below diagram shows the input restricted Dequeue.
34
II Yr/III Sem
PART-A
F1
10
1
20
2
30
40
3
50
6
60
7
70
8
80
9
10
11
12
13
14
15
16
Q1 of size 5
Q2 of size 4
Q3 of size 2
Q4 of size 5
35
II Yr/III Sem
PART-A
Priority queues can be used to sort the elements using Heap Sort.
Simulation.
Mathematics user Queuing theory.
Computer networks where the server takes jobs of the client as per the queue strategy.
UNIT III
1. What is a tree?
A tree is a finite set of one or more nodes such that there is a specially designated node called the
Root, and zero or more non empty sub trees T1, T2, T3.Tk, each of whose roots are connected
by a directed edge from Root R.
36
II Yr/III Sem
PART-A
Level: The level of a node is defined by initially letting the root be at level one, if a node is at
level L then its children are at level L+1. Level of A=1, B, C, D=2;F, G, H, I, J=3;L, M, =4.
Depth: For any node n, the depth of n is the length of the unique path from root to n. The Depth
of the root is zero. In the figure depth of node F is 2, node L is 3.
Height: For any node n, the height of the node n is the length of the longest path from n to the
leaf. The height of the leaf is zero, height of node F is 1, and Height of L is 0.
3. Define binary tree and write down its node declarations?
Binary tree is a tree in which no node can have more than two children. Maximum number of
nodes at level I of a binary tree is 2 i+1. It is defined as finite set of nodes such that
T is empty (called the empty binary tree), or
T contains a specially designated node called the root of T, and the remaining nodes of T
form two disjoint binary trees T1, and T2 which are called the left sub-tree and the right
sub tree, respectively.
Node declaration:
Struct TreeNode
{
Int Element;
Struct TreeNode *Left;
Struct TreeNode *Right;
};
4. List some of the possible types of binary Tree?
A few important frequently used trees are listed below.
Expression tree
Binary search tree
Heap tree
Threaded binary tree
Huffman tree
AVL tree
Red black tree
Splay tree
Decision tree
5. Comparison between tree & binary tree?
Tree: A general tree has any number of children.
37
II Yr/III Sem
PART-A
Binary tree: A binary Tree has not more than two children.
38
II Yr/III Sem
PART-A
Data field
Pointer to the right subtree
39
II Yr/III Sem
PART-A
40
II Yr/III Sem
PART-A
Zig-Zig: If p is not the root, p is the left child and v is also a left child, then a left- left rotation at
g followed by a left-left rotation at p, brings v as an ancestor of g as well as p.
Zig-Zag: If p is not the root, p is the left child and v is a right child, perform a left-right rotation
at g and bring v as an ancestor of p as well as g.
15. Define B-tree of order M.
A B-tree of order M is a tree that is not binary with the following structural properties:
The root is either a leaf or has between 2 and M children.
All non-leaf nodes (except the root) have between M/2 and M children.
All leaves are at the same depth.
Applications of B-tree
1. Database implementation
2. Indexing on non primary key fields
UNIT IV
1. What is meant by sorting?
Ordering the data in an increasing or decreasing fashion according to some relationship among
the data item is called sorting.
MVIT/Dept of IT/2016-2017/ ODD SEM
41
II Yr/III Sem
PART-A
EG:
11
15
23
29
2. What are the two main classifications of sorting based on source of data?
Internal sorting
External sorting
3. Define external sorting.
External sorting is a process of sorting in which large blocks of data stored in storage devices are
moved to the main memory and then sorted.
EG:
Sorted Array: 1
11
15
23
29
Sorted Array: 1
11
15
23
29
42
II Yr/III Sem
PART-A
43
II Yr/III Sem
PART-A
regular insertion sort is performed on the list, but by then the 1ist of data is guaranteed to
be almost sorted. Using the above Procedure for any sequence values of h, always ending
in 1 will produce a sorted list.
9. What is the purpose of quick sort?
The divide-and-conquer approach can be used to arrive at an efficient sorting method
different from merge sort. In merge sort, the file a[1:n] was divided at its midpoint into
sub arrays which were independently sorted & later merged.
In Quick sort, the division into 2 sub arrays is made so that the sorted sub arrays do not
need to be merged later.
This is accomplished by rearranging the elements in a[1:n] such that a[i]<=a[j] for all i
between 1 & n and all j between (m+1) & n for some m, 1<=m<=n.
It is assumed that a[p] a[m] and that a[m] is the partitioning element. If m=1 & p-1=n,
then a[n+1] must be defined and must be greater than or equal to all elements in a[1:n]
The assumption that a[m] is the partition element is merely for convenience, other
choices for the partitioning element than the first item in the set are better in practice.
44
II Yr/III Sem
PART-A
Specifically, the list of names is first sorted according to the first letter of each names,
that is, the names are arranged in 26 classes
Intuitively, one might want to sort numbers on the most significant digit.
But Radix sort do counter-intuitively by sorting on the least significant digits first.
On the first pass entire numbers sort on the least significant digit and combine in a
array.
Then on the second pass, the entire numbers are sorted again on the second leastsignificant digits and combine in a array and so on.
UNIT V
1. Define Hashing.
Hashing is the transformation of string of characters into a usually shorter fixed length value
or key that represents the original string. Hashing is used to index and retrieve items in a
database because it is faster to find the item using the short hashed key than to find it using the
original value.
Hash table
The hash table data structure is merely an array of some fixed size, containing the keys. A
key is a string with an associated value. Each key is mapped into some number in the range 0 to
tablesize-1 and placed in the appropriate cell.
Hash function
45
II Yr/III Sem
PART-A
A hash function is a key to address transformation which acts upon a given key to compute
the relative position of the key in an array. The choice of hash function should be simple and it
must distribute the data evenly. A simple hash function is hash_key=key mod tablesize.
Importance of hashing.
Maps key with the corresponding value using hash function.
Hash tables support the efficient addition of new entries and the time spent on searching
for the required data is independent of the number of items stored.
2. What do you mean by collision in hashing?
When an element is inserted, it hashes to the same value as an already inserted element,
and then it produces collision.
Collision resolution methods
Separate chaining or external hashing
Open addressing or closed hashing
3. What do you mean by separate chaining?
Separate chaining is a collision resolution technique to keep the list of all elements that
hash to the same value. This is called separate chaining because each hash table element is a
separate chain (linked list). Each linked list contains all the elements whose keys hash to the
same index.
Advantage of separate chaining.
More number of elements can be inserted as it uses linked lists.
Disadvantages of separate chaining.
The elements are evenly distributed. Some elements may have more elements and some
may not have anything.
It requires pointers. This leads to slow the algorithm down a bit because of
the time required to allocate new cells, and also essentially requires the
implementation of a second data structure.
4. What do you mean by open addressing?
Open addressing is a collision resolving strategy in which, if collision occurs alternative cells
are tried until an empty cell is found. The cells h0(x), h1(x), h2(x),. are tried in succession,
where hi(x)=(Hash(x)+F(i))mod Tablesize with F(0)=0. The function F is the collision resolution
strategy.
types of collision resolution strategies in open addressing?
Linear probing
Quadratic probing
Double hashing
5. What is Probing?
Probing is the process of getting next available hash table array cell.
linear probing
MVIT/Dept of IT/2016-2017/ ODD SEM
46
II Yr/III Sem
PART-A
47
II Yr/III Sem
PART-A
48
II Yr/III Sem
PART-A
49
II Yr/III Sem
PART-A
Encapsulation
Wrapping up of data and function within the structure is called as encapsulation.
4. What are Class and Objects? Write its syntax.
Objects
Definition1:
In oop, a problem is considered as a collection of a number of entities called
objects objects are instances of classes.
Definition2:
Objects are basic run-time entities in an objected oriented system. Problem is
analyzed in terms of object.
Syntax:- classname objectname;
Example: Person, place, table of date etc.
Class
Definition:
The entire set of date and code of an objects made as a user-defined date type
with the help of a class . C++ enables to define a class that is similar to struct of C but
with addition of functions members. Thus a class is a collection of similar type.
Example: Fruit mango
Syntax:class class_name
{
access_specifier_1:
data member;
member function;
access_specifier_2:
data member;
member function;
...
};
5. What are the differences between a class and structure?
Class:
1. User defined data type which contains data and methods to manipulate that data; is
known as class.
2. It is the fundamental packaging unit of OO technology. An object is a variable of a
Class.
3. Each object is associated with the data of type class with which it is created. Thus we
can also say that class is a collection of objects of similar types. Eg.
class Student
{
int rollno;
MVIT/Dept of IT/2016-2017/ ODD SEM
50
II Yr/III Sem
PART-A
Function overloading
Operator overloading
51
II Yr/III Sem
PART-A
5) Top-Down Approach
OOP
1) Emphasis on real item
2) Programs are divided into Objects
3) Data are not sharable
4) Object Oriented Programming
5) Bottam-Up Arpproach
9. What are data members and member functions?
Classes use the concept of abstraction and are defined as a list of abstract attributes such
as size, weight, and cost and uses functions to operate on these attributes.
The attributes are sometimes called as data members because they hold information.
The functions that operate on these data are called as methods or member functions.
Eg: int a,b;
// a,b are data members
Void getdata ( ) ; // member function
10. What are the operators available in C++?
All operators in C are also used in C++. In addition to insertion operator << and
extraction operator >> the other new operators in C++ are,
::
Scope resolution operator
::*
Pointer-to-member operator
->*
Pointer-to-member operator
.*
Pointer-to-member operator
delete Memory release operator
endl
Line feed operator
new
Memory allocation operator
setw
Field width operator
11. What is a scope resolution operator?
The global version of a variable cannot be accessed from within the inner block in C
program. C++ solves this problem by introducing new operator : : called scope resolution
operator.
This is used to un cover a hidden variable and takes the following form
:: variable -name
Example:
Class MyClass
{
int n1, n2;
public:
{
void func1();
---------Function Declaration
}
};
public void MyClass::func1() ---Use of Scope Resolution Operator to write
Function definition outside class definition
{
// Function Code
MVIT/Dept of IT/2016-2017/ ODD SEM
52
II Yr/III Sem
PART-A
53
II Yr/III Sem
PART-A
};
student s1(a);
}
UNIT II
1. Define constructor and write its types and its characteristics.
A constructor is a special member function whose task is to initialize the objects of its
class.
It is special because its name is same as class name. The constructor is invoked
whenever an object of its associated class is created.
It is called constructor because it constructs the values of data members of the class.
Eg:
class integer
MVIT/Dept of IT/2016-2017/ ODD SEM
54
II Yr/III Sem
PART-A
public:
integer( ); //constructor
}
Types:1. Default constructor
2. Parameterized constructor
3. Copy constructor
Characteristics: A constructor takes the same name as the class name.
The programmer cannot declare a constructor as virtual or static, nor can the
programmer declare a constructor as const, volatile, or const volatile.
No return type is specified for a constructor.
The constructor must be defined in the public. The constructor must be a public
member.
Overloading of constructors is possible.
2. Define default constructor and parameterized constructor.
Default constructor
The constructor with no arguments is called default constructor
Eg:
Class integer
{
int m,n;
Public:
Integer( );
.
};
integer::integer( )//default constructor
{
m=0;n=0;
}
the statement
integer a;
invokes the default constructor
Parameterized constructor
Constructor with arguments is called parameterized constructor
Eg;
Class integer
{
int m,n;
public:
integer(int x,int y)
{
m=x;n=y;
MVIT/Dept of IT/2016-2017/ ODD SEM
55
II Yr/III Sem
PART-A
}
};
To invoke parameterized constructor we must pass the initial values as arguments to the
constructor function when an object is declared. This is done in two ways
1.By calling the constructor explicitly
eg: integer int1=integer(10,10);
2.By calling the constructor implicitly
eg: Integer int1(10,10);
3. Define copy constructor and dynamic constructor.
Copy constructor
A copy constructor is used to declare and initialize an object from another object. It
takes a reference to an object of the same class as an argument
Eg: integer i2(i1);
would define the object i2 at the same time initialize it to the values of i1.
Another form of this statement is
Eg: integer i2=i1;
The process of initializing through a copy constructor is known as copy initialization .
Dynamic constructor
Allocation of memory to objects at time of their construction is known as dynamic
constructor. The memory is allocated with the help of the NEW operator
Eg:
Class string
{
char *name;
int length;
public:
string( )
{
length=0;
name=new char[ length +1];
}
void main( )
{
string name1(Louis),name3(Lagrange);
}
4. Define destructor with its syntax.
It is used to destroy the objects that have been created by constructor. Destructor name
is same as class name preceded by tilde symbol(~)
Eg;
~integer()
{
}
A destructor never takes any arguments nor it does it return any value. The compiler upon
exit from the program will invoke it.
Whenever operator is used to allocate memory in the constructor, we should use delete to
free that memory.
MVIT/Dept of IT/2016-2017/ ODD SEM
56
II Yr/III Sem
PART-A
57
II Yr/III Sem
PART-A
58
II Yr/III Sem
PART-A
argument (object of the relevant class) When binary operators are overloaded using friend
function, it takes two explicit
arguments.
In case of unary operators, overloaded operator can be invoked as
Operator op (x);
In case of binary operators, overloaded operator can be invoked as Operator op (x , y)
12. List out the operators that cannot be overloaded using Friend function.
Assignment operator =
Function call operator ( )
Subscripting operator [ ]
Class member access operator
13. Explain basic to class type conversion with an example.
Conversion from basic data type to class type can be done in destination class.
Using constructors does it. Constructor takes a single argument whose type is to be converted.
Eg: Converting int type to class type
class time
{
int hrs,mins;
public:
.
Time ( int t) //constructor
{
hours= t/60 ; //t in minutes
mins =t % 60;
}
};
Constructor will be called automatically while creating objects so that this conversion is done
automatically.
14. Explain class to basic type conversion with an example.
Using Type Casting operator, conversion from class to basic type conversion can be
done. It is done in the source class itself.
Eg: vector : : operator double( )
{
double sum=0;
for(int I=0;I<size;I++)
sum=sum+v[ i ] *u[ i ] ;
return sqrt ( sum ) ;
}
This function converts a vector to the corresponding scalar magnitude.
15. What do you mean by explicit constructor?
Conversion from one class type to another is the combination of class to basic and basic
to class type conversion. Here constructor is used in destination class and casting operator
function is used in source class.
Eg: objX = objY
MVIT/Dept of IT/2016-2017/ ODD SEM
59
II Yr/III Sem
PART-A
objX is the object of class X and objY is an object of class Y. The class Y type data is
converted into class X type data and the converted value is assigned to the obj X. Here class Y is
the source class and class X is the destination class.
UNIT III
1. What do you mean by Template in C++?
C++ supports a mechanism known as templates to implement the concept of generic
programming. Template allows us to generate a family of classes or family of function to
handle different data type. Template classes and function illuminate code duplication for
different types and thus make program development easier and manageable.
Two specifications:
1. Class template
2. Function template
2. Define Function template with its syntax.
The generic function outlined by specification of a generic type using template
keyword. The actual function is defined later using the template.
Syntax:-
60
II Yr/III Sem
PART-A
template<class T>
return type function name (arguments of typeT)
{
//
//body of the function with type T
//wherever appropriate
};
Where template is a keyword , typename T is a template data type.
Need for Function Template:
Function Template is generic function which works for any data type that is passed to
them.
The data type need not to be specified while writing the function.
When using the template function, we can pass the data type and get the required
functionality.
Also it is possible that we may not specify the data type and the compiler deduces it for
us
3. Define Class template with its syntax.
Classes can also be declared to operate on different data types. Such classes are called
class templates. A class template specifies how individual classes can be constructed similar to
normal class specification
Syntax of class template
template <class T1,class T2,>
class classname
{
T1 data1;
.
//functions of template arguments T1,T2,.
void func1(T1 a,T2 &b);
61
II Yr/III Sem
PART-A
int main()
{
int s;
int a[]={1,2,3,4,5,6,7,8,9,10};
s=average(a,10);
cout<<"Average value of int is:"<<s<<endl;
return 0;
}
5. What is an Exception? List down the various types.
Errors which occur during the program execution, due to some fault in the input data is
called Exception.
Exception refers to unexpected condition in a program. The unusual conditions could be
faults, causing an error which in turn causes the program to fail. The error handling mechanism
of C++ is generally referred to as exception handling.
Two types of exceptions:Exceptions are classifieds into
a)Synchronous exception
The technique that is not suitable to handle the current class of data,
within the program are known as synchronous exception
b) Asynchronous exception
The exceptions caused by events or faults unrelated to the program and
beyond the control of program are called asynchronous exceptions
6. What is Exception handling? How its handled in C++?
The blocks related to exception handling constructs are
try
throw
catch
The keyword try is used to preface a block of statements which may generate
exceptions. This block of statements is known as try block.
When an exception is detected, it is thrown using throw statement in the try block.
A catch block catches the exception thrown by the throw statement in the try block and
handles it appropriately.
Syntax:
try
{
throw exception;
}
catch (type arg)
{
}
7. Draw the Exception handling model?
MVIT/Dept of IT/2016-2017/ ODD SEM
62
II Yr/III Sem
PART-A
Try block
Perform operation which may
throw or invoke external function
if needed
Throw block
If(failure)
Throw object;
exception
Catch block
Catches all exceptions thrown from
within try block or by function
invoked within a try block
63
II Yr/III Sem
PART-A
Keyword
try
{
//code raising exception or referring to a function raising exception
}
catch(type_id1)
{
//actions for handling an exception
}
catch(type_idn)
{
//actions for handling an exception
}
12. Write the syntax of catch construct.
The exception handler is indicated by the catch keyword. It must be used immediately
after the statements marked by the try keyword. The catch handler can also occur immediately
after another catch. Each handler will only evaluate an exception that matches, or can be
covered to the type specified in its argument list.
Keyword
Catch(T)
{
//
}
13. Write the syntax of throw construct.
The keyword throw is used to raise an exception when an error is generated in the
computation. The throw expression initializes a temporary object of the type T (to match the
type of argument arg ) used in throw(T arg )
Named object, nameless object
Keyword
throw T;
14. Define terminate and unexpected functions.
terminate() is a library function which by default aborts the program
It is called whenever the exception handling mechanism cannot find a handler for a thrown
MVIT/Dept of IT/2016-2017/ ODD SEM
64
II Yr/III Sem
PART-A
exception.
Syntax of terminate:
void terminate( );
unexpected() is called when a function with an exception specification throws an
exception of a type that is not listed in the exception specification for the function.
A function declaration without a specification like throw(char*) may throw any type of
exception, and one with throw() is not allowed to throw exceptions at all.
By default unexpected() calls terminate().
Syntax of unexpected:
void unexpected( );
15. What you mean by uncaught exception?
uncaught_exception( ) function: It returns true when throw has happened for an
exception, but no catch statement is executed. Once catch is executed the function returns false.
Syntax:
bool uncaught_exception( );
UNIT IV
1. Define Inheritance and its types.
The mechanism of deriving a new class from an old one is called inheritance (or)
derivation.
The new class is referred as base class and new one is called derived or sub-class.
Different forms of Inheritance:
Single inheritance
Multiple inheritance
Hierarchical inheritance
Multilevel inheritance
Hybrid inheritance
2. List the rules for inheritance.
1) The default mode is private
2) Difficult to inherit the base class private members
3) The base class public and protected member functions are considered as public and
protected member functions in derived class, When those class is publicly inherited from base
class
4) The base class public and protected member functions are considered as private
member function in derived class, when those class is privately inherited from base class
3. Define single and multilevel inheritance with its syntax.
MVIT/Dept of IT/2016-2017/ ODD SEM
65
II Yr/III Sem
PART-A
Single inheritance
If a single class is derived from a single base class is called single inheritance.
Eg:
Base class
A
Derived class
Multilevel inheritance
If a class is derived from a class, which in turn is derived from another class, is
called multilevel inheritance. This process can be extended to any number of levels.
Eg:
Base class Grand father
Intermediate Base class Father
Derived class Child
Derived class
C
66
II Yr/III Sem
PART-A
67
II Yr/III Sem
PART-A
68
II Yr/III Sem
PART-A
UNIT V
1. What are streams?
A Stream is a sequence of bytes. It can either as a source from which the input data can
be obtained or as a destination to which the output data can be sent.
The stream source that provides data to the program is called the input stream and the
destination stream that receives output from the program is called output stream
Input Stream
Input Device
2. List
out some of the unformatted I/O operators.
Output
a) put()
Device
b) get()
Output Stream
c) getline()
d) write()
3. List any four I/O Manipulators supported by C++ stream.
a) setw(int width)
b) setprecision(int prec)
c) setfill(int fchar)
d) setbase(int base)
e) setiosflags(long flags)
f) resetioflags(long flags)
Extraction
from Input
Stream
Program
Insertion into
Output Stream
69
II Yr/III Sem
PART-A
ios
istream
Streambuf
*bp=&strstreambase::
bug
streambuf
ostream
iostream
istream_withassi
gn
iostream_withassig
n
ostream_withass
ign
5. List out some of the formatted I/O operations and also list some of ios functions.
C++ supports a number of features that could be used for formatting the output.
These features include
a) ios stream class member functions and flags
b) Standard manipulators
c) User defined manipulators
Some of the ios functions
a) width()
b) precision()
c) fill()
d) setf()
e) unsetf()
6. Write the syntax of creating a custom or own manipulator.
The users can design their own manipulators to control the appearance of the output
Syntax of creating a custom manipulator
Ostream & manipulator(ostream & output, arguments_if_any)
{
(manipulator code)
Return output;
}
7. What are the flags that do not have bit fields?
a) ios::showbase
b) ios::showpos
c) ios::showpoint
d) ios::uppercase
70
II Yr/III Sem
PART-A
8. What is a file?
A file is a collection of related information defined by its creator. Files represent
programs (both source and object forms) and data. Data may be numeric, alphabetic, or
alphanumeric. Files may be free-form, such as text files, or may be rigidly formatted.
9. List some of the file modes.
1) ios::in
2) ios::out
3) ios::ate
4) ios::app
5) ios::trunk
6) ios::nocreate
7) ios::noreplace
8) ios::binary
10. What are the functions that the file stream class provides?
a) seekg()-Moves get pointer to a specified location
b) seekp()-Moves put pointer to a specified location
c) tellg()-Gives the current position of the get pointer
d) tellp()-Gives the current position of the put pointer
11. What is namespaces? Give an example.
ANSI C++ Standard has added a new keyword namespace to define a scope that could
hold global identifiers.The best example of namespace scope is the C++ Standard Library.All
classes,functions and templates are declared within the namespace named std.
Using namespace std;
The using namespace statement specifies that the members defined in std namespace
will be used frequently throughout the program
Syntax for defining a namespace
namespace namespace_name
{
//Declaration of
//variables,functions,classes,etc.
}
12. What are the member functions in String objects?
The member functions such as
MVIT/Dept of IT/2016-2017/ ODD SEM
71
II Yr/III Sem
1.
2.
3.
4.
PART-A
insert ()
replace ()
erase ()
append ().
72
II Yr/III Sem
PART-A
73
II Yr/III Sem
PART-A
5. How will you convert a Binary number into Hexa Decimal number?
ANS:
74
II Yr/III Sem
PART-A
care conditions. We simply dont care whether the value of 0 or 1 is assigned to F for a
particular minterm. Dont care conditions are represented by X in the K-Map table.
13. What are the specialities of Tabulation Method?
It is more efficient for use in computer algorithms, and it also gives a deterministic way
to check that the minimal form of a Boolean function has been reached. It is sometimes
referred to as the tabulation method.
14. State De Morgan's theorem.
De Morgan suggested two theorems that form important part of Boolean algebra. They
are,
1) The complement of a product is equal to the sum of the complements. (AB)' = A' +
B'
2) The complement of a sum term is equal to the product of the complements. (A + B)'
= A'B'
15. Simplify the following expression Y = (A + B) (A + C) (B' + C)
Y = (A + B) (A + C) (B' + C)
= (AA' + AC +A'B +BC) (B' + C') [A.A' = 0]
= (AC + A'B + BC) (B' + C)
= AB'C + ACC' + A'BB' + A'BC' + BB'C + BCC'
Y= AB'C + A'BC'
75
II Yr/III Sem
PART-A
UNIT II
1. What are an Adder and its types?
An adder or summer is a digital circuit that performs addition of numbers.
Types:
a. Half-adder
b. Full-adder
2. Define ripple carry adder?
Create a logical circuit using multiple full adders to add N-bit numbers. Each full adder
inputs a Cin, which is the Cout of the previous adder. This kind of adder is a ripple carry
adder, since each carry bit "ripples" to the next full adder.
3. Define - Carry Look-ahead Adders?
It is used to reduce the computation time by creating P and G signal(p is sum output of
adder ,G is carry generator.
4. What is meant by a half subtractor and full subtractor?
Half subtractor: subtract two bit and produce their difference and borrow.
Full subtractor: It is subtract two bits and also taken into account borrow of the lower
significant stage.
5. Define code converters and write examples?
These are circuits that translate a code into another. Usually this converters are
programmed in logic arrays.
Eg:Binary to gray ,gray to binary.
6. How will you convert a Binary number into BCD?
76
II Yr/III Sem
PART-A
8.
9.
Difference between Decoder and encoder?
Decoder
Encoder
n input, 2n output eg:2 input 4 output
2n input, n output eg:4input 2 output
input of the decoder is encode the n i/p
input of the decoder is encode the 2n i/p
and producing 2n o/p
and producing n o/p
77
II Yr/III Sem
PART-A
One i/p to many o/p.The selection of specific o/p line is controlled by the value of
selection lines.
12. List out the Features of Parity Generator?
1. Generates either odd or even parity for nine data lines
2. Inputs are buffered to lower the drive requirements
3. Can be used to upgrade existing systems using MSI parity circuits
4. Cascadable for N-bits
5. Advanced oxide-isolated, ion-implanted Schottky TTL process
13. What are the types of Parity bits?
Even Parity Bit
Odd parity Bit
14. Write the design procedure for combinational circuits.
a. The problem definition
b. Determine the number of available input variables & required O/P variables.
c. Assigning letter symbols to I/O variables
d. Obtain simplified Boolean expression for each O/P.
e. Obtain the logic diagram.
15. What is priority Encoder?
A priority encoder is an encoder circuit that includes the priority function. In priority
encoder, if 2 or more inputs are equal to 1 at the same time, the input having the highest
priority will take precedence.
78
II Yr/III Sem
PART-A
UNIT III
1.
Latch
A Latch samples the inputs
continuously whenever it is enabled, that is,
only when the enable signal is on. (or
otherwise, it would be a wire, not a latch).
79
II Yr/III Sem
PART-A
6. Define T flip-flop.
It is called as toggle flipflop. When T=0 No change in o/p.When T=1 the o/p switch to the
complement state(or)toggles
7. Define sequential circuit?
The circuit in which the o/p variable depend not only on the present state but they also
depend upon the past history of these i/p variable are known as sequential circuit .Eg: flip
flop, counter, register.
8. Define State Table and state table?
State diagram is the pictorial representation of behavior of sequential circuit the state is
represented by circle and transition between the state for different i/p condition is
represented by directed line connecting circle.
State table is the transition of state diagram into tabular form, It represent relationship
among i/p and o/p and flip flop.
9. Define race around condition.
In JK flip-flop output is fed back to the input. Therefore change in the output results
change in the input. Due to this in the positive half of the clock pulse if both J and K are
high then output toggles continuously. This condition is called race around condition.
10. Define state assignment?
It is an one step in the design of sequential circuit which assigns binary values to the states
in such a way that it reduces the cost of the combinational circuit that drives the flip flop.
11. Define Registers and its types?
In computer architecture, a processor register (or general purpose register) is a small
amount of storage available on the CPU whose contents can be accessed more quickly
MVIT/Dept of IT/2016-2017/ ODD SEM
80
II Yr/III Sem
PART-A
than storage available elsewhere. Typically, this specialized storage is not considered part
of the normal memory range for the machine.
12. Define Shift Register
A shift register is a cascade of flip flops, sharing the same clock, which has the output of
any one but the last flip-flop connected to the "data" input of the next one in the chain,
resulting in a circuit that shifts by one position the one-dimensional "bit array" stored in
it, shifting in the data present at its input and shifting out the last bit in the array, when
enabled to do so by a transition of the clock input.
13. Define Counters and its types?
In digital logic and computing, a counter is a device which stores (and sometimes
displays) the number of times a particular event or process has occurred, often in
relationship to a clock signal.
14. What are state reduction and the use?
It is the used to reduce the redundant state so, we can reduce the number of gates and flip
flop and also reducing cost.
15. What is ASM chart?
An ASM chart is a method of describing the sequential operations of a digital system.
81
II Yr/III Sem
PART-A
UNIT IV
1. What is a memory an its types of memory?
Memory is a storage device to store data, instructions and intermediate values.
There are 2 types of memory.
1. Main memory or Primary memory
2. Mass memory or Secondary memory
2. What are the type of RAM?
1. static RAM (SRAM)
2. dynamic RAM
3. Differentiate RAM with ROM.
S.NO
RAM
ROM
RAM allows the computer to read ROM stores the program required to
data quickly to run applications. It allows initially boot the computer. It only
reading and writing.
allows reading.
82
II Yr/III Sem
PART-A
83
II Yr/III Sem
PART-A
some form of delay caused by logic elements (NOT, AND, OR gates, etc.) This results in
the logic not performing its function properly. Types of Hazards
1. Static Hazard
2. Dynamic Hazards
13. What is meant by Static Hazard?
A static hazard is the situation where, when one input variable changes, the output
changes momentarily before stabilizing to the correct value. There are two types of static
hazards:
Static-1 Hazard: the output is currently 1 and after the inputs change, the output
momentarily changes to 0 before settling on 1
Static-0 Hazard: the output is currently 0 and after the inputs change, the output
momentarily changes to 1 before settling on 0
84
II Yr/III Sem
PART-A
UNIT V
1.What is Verilog?
Verilog is a general purpose hardware descriptor language. It is similar in syntax to the C
programming language. It can be used to model a digital system at many levels of abstraction
anging from the algorithmic level to the switch level.
2. What are the various modeling used in Verilog?
1. Gate-level modeling 2. Data-flow modeling
3. Switch-level modeling 4. Behavioral modeling
3. What is the structural gate-level modeling?
Structural modeling describes a digital logic networks in terms of the components that wake
up the system. Gate-level modeling is based on using primitive logic gates and specifying how
they are wired together.
4. What is Switch-level modeling?
Verilog allows switch-level modeling that is based on the behavior of MOSFETs. Digital
circuits at the MOS-transistor level are described using the MOSFET switches.
5. What are identifiers?
Identifiers are names of modules, variables and other objects that we can reference in the
design. Identifiers consists of upper and lower case letters, digits 0 through 9, the underscore
character(_) and the dollar sign($). It must be a single group of characters. Examples: A014,
a, b, in_o, s_out
6. What are the value sets in Verilog?
Verilog supports four levels for the values needed to describe hardware referred to as value
sets.
Value levels Condition in hardware circuits
0 Logic zero, false condition
1 Logic one, true condition
X Unknown logic value
Z High impedance, floating state
7. What are the types of gate arrays in ASIC?
1) Channeled gate arrays 2) Channel less gate arrays 3) Structured gate arrays
8. Give the classifications of timing control
Methods of timing control:
1. Delay-based timing control
MVIT/Dept of IT/2016-2017/ ODD SEM
II Yr/III Sem
PART-A
86
II Yr/III Sem
PART-A
1. No else statement
Syntax: if ([expression]) true statement; 2. One else
statement
Syntax: if ([expression]) true statement; else falsestatement;
3. Nested if-else-if
Syntax : if ( [expression1] ) true statement 1; else if
( [expression2] ) true-statement 2; else if ( [expression3]
) true-statement 3; else default-statement;
IT T 36 COMPUTER ORGAVIZATION
UNIT-I
1. What are the basic functional units of a computer?
MVIT/Dept of IT/2016-2017/ ODD SEM
87
II Yr/III Sem
PART-A
88
II Yr/III Sem
PART-A
A stack is a list of data elements, usually words or bytes with the accessing restriction
that elements can be added or removed at one end of the list only. It follows last in first
out (LIFO) mechanism.
9. What is a queue?
Is a type of datastructure in which the data are stored in and retrieved on a First in first
out(FIFO) basis. It grows in the direction of increasing addresses in the memory. New
data are added at the back (High-address end) and retrieved from the front (low-address
end) of the queue.
10.What is the function of ALU?
Most of the computer operations (arithmetic and logic) are performed in ALU. The data
required for the operation is brought by the processor and the operation is performed by
the ALU.
11. What do you mean by assembler directives?
These are the instructions which direct the program to be executed. They have no binary
equivalent so they are called pseudo-opcodes. These instructions are used to define symbols,
allocate space for variable, generate fixed tables etc.
Examples: END, NAME
12. What are the registers generally contained in the processor?
MAR-Memory Address Register MDRMemory Data Register IR-Instruction
Register R0-Rn-General purpose
Registers PC-Program Counter
13. Compare single bus structure and multiple bus structure?
A system that contains only one bus(i.e only one transfer at a time) is called as a single bus
structure. A system is called as multiple bus structure if it contains multiple buses.
14. Explain about Bus.
Bus is a group of lines that serves as a connecting path for several devices. In addition to the
lines that carry the data, the bus must have the lines for address and control purposes.
15. What are the two techniques used to increase the clock rate R?
The two techniques used to increase the clock rate R are
1. The integrated circuit (IC) technology can be increased which reduces the time needed to
complete a basic step.
2. We can reduce the amount of processing done in one basic step.
UNIT-II
1. What is half adder? What is full adder?
A half adder is a logic circuit with two inputs and two outputs, which adds two bits at a time,
producing a sum and a carry.
MVIT/Dept of IT/2016-2017/ ODD SEM
89
II Yr/III Sem
PART-A
A full adder is logic circuit with three inputs and two outputs, which adds three bits at a time
giving a sum and a carry.
2. What is a carry look-ahead adder?
The input carry needed by a stage is directly computed from carry signals obtained from all the
preceding stages i-1,i-2,..0, rather than waiting for normal carries to supply slowly from stage
to stage. An adder that uses this principle is a called carry look-ahead adder.
3. What are the main features of Booths algorithm?
1) It handles both positive and negative multipliers uniformly.
2) It achieves some efficiency in the number of addition required when the multiplier has a few
large blocks of 1s.
4. What is bit pair recoding? Give an example.
Bit pair recoding halves the maximum number of summands. Group the Booth-recoded
multiplier bits in pairs and observe the following: The pair (+1 -1) is equivalent to 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. Eg: 11010 Bit Pair recoding
value is 0 -1 -2
5. What is the advantage of using Booth algorithm?
1) It handles both positive and negative multiplier uniformly.
2) It achieves efficiency in the number of additions required when the multiplier has a few large
blocks of 1s.
3) The speed gained by skipping 1s depends on the data.
6. Write the algorithm for restoring division.
Do the following for n times:
1) Shift A and Q left one binary position.
2) Subtract M and A and place the answer back in A.
3) If the sign of A is 1, set q0 to 0 and add M back to A.
Where A- Accumulator, M- Divisor, Q- Dividend.
Step 1: Do the following for n times:
1) If the sign of A is 0 , shift A and Q left one bit position and subtract M from A; otherwise ,
shift A and Q left and add M to A.
2) Now, if the sign of A is 0,set q0 to 1;otherwise , set q0 to0.
Step 2: if the sign of A is 1, add M to A.
7. Give the IEEE standard for floating point numbers for single precision number.
90
II Yr/III Sem
PART-A
8. Give the IEEE standard for floating point numbers for double precision number.
9. What is guard bit? What are the ways to truncate the guard bits?
Although the mantissa of initial operands are limited to 24 bits, it is important to retain extra
bits, called as guard bits.
There are several ways to truncate the guard bits:
1) Chooping
2) Von Neumann rounding
3) Rounding
10. In floating point numbers when so you say that an underflow or overflow has occurred?
In single precision numbers when an exponent is less than -126 then we say that an underflow
has occurred. In single precision numbers when an exponent is less than +127 then we say that
an overflow has occurred.
11. How CSA speeds up multiplication?
It reduces the time needed to add the summands. Instead of letting the carries ripple
along the rows, they can be saved and introduced into the next row, at the correct waited
position.
12. Write down the steps for restoring division and non-restoring division
MVIT/Dept of IT/2016-2017/ ODD SEM
91
II Yr/III Sem
PART-A
Non Restoring:
Step1: Do the following n times
1.If the sign of A is 0, shift A and Q left one bit position and subtract M
from A otherwise shift A and Q left and add M to A.
2.Now if the sign of A is 0, set Q0 to 1; otherwise set Q0 to 0
Step 2: If the sign of A is 1, add M to A
Restoring:
0
1
13.What is the need for adding binary 8 value to the true exponential in floating point
numbers?
This solves the problem of negative exponent. Due to this the magnitude of the
numbers can be compared. The excess-x representation for exponents enables efficient
comparison of the relative sizes of the two floating point numbers.
14.What are the ways to truncate guard bits?
1.Chopping
2.Von Neumann rounding
3.Rounding procedure
15.What are the two attractive features of Booth algorithm
It handles both positive and negative multipliers uniformly
92
II Yr/III Sem
PART-A
UNIT-III
1. What are the basic steps required to execute an instruction by the processor?
The basic steps required to execute an instruction by the processor are:
1) Fetch the contents of the memory location pointed to by the PC. They are loaded into the IR.
IR[[PC]]
2) Assuming that the memory is byte addressable, increment the contents of the PC by 4, that is
PC [PC} + 4
3) Carry out the action specified by the instruction in the IR.
2. Write down the control sequence for Move (R1), R2.
The control sequence is :
R1out, MARin,Read
MDRoutE,WMFC
MDRout,R2in
3.What is the role of cache memory in pipeline?
The use of cache memory is to solve the memory access problem. When cache is included in the
processor the access time to the cache is usually the same time needed to perform other basic
operation inside the processor.
4.Name the methods for generating the control signals.
The methods for generating the control signals are:
1) Hardwired control
2) Microprogrammed control
Define hardwired control.
Hard-wired control can be defined as sequential logic circuit that generates specific sequences of
control signal in response to externally supplied instruction.
Define microprogrammed control.
A microprogrammed control unit is built around a storage unit is called a control store where all
the control signals are stored in a program like format. The control store stores a set of
microprograms designed to implement the behavior of the given instruction set.
5. Differentiate Microprogrammed control from hardwired control.
Microprogrammed Control
It is the microprogram in the control store that
generate control signals.
Speed of the operation is low,because it
involves memory access.
Change in control can be implemented easily
by modifying the microcontruction in the
contrl store.
Hardwired Control
It is the sequential circuit that generate control
signals.
Speed of operation is high.
Changes in control unit behaviour can be
implemented only by redesigning the entire
unit.
93
II Yr/III Sem
PART-A
HORIZONATAL
Long Formats
Ability to express a high degree of parallelism
VERTICAL
Short Formats
Limited ability to expressparallel micro
operation
94
II Yr/III Sem
PART-A
For each register, two control signals are used to place the contents of that register on the bus or
to load data on the bus into the register. The input and output of register Ri are connected to the
bus via switches controlled by the signals Riin and Riout, respectively. When Riin is set to 1, the
data on the bus are loaded into Ri. Similarly, when Riout is set to 1, the contents of register Ri
are placed on the bus. While Riout is equal to 0, the bus can be used for transferring data from
other registers.
13. What is mean by branch instruction.
A branch instruction is an instruction which replaces the contentsof the PC with the branch target
address. This address is usually obtained by adding an offset X, which is given in the branch
instruction, to the updated value of the PC. The location following a branch instruction is called a
branch delay slot.
14. Define microroutine and microinstruction.
A sequence of control words corresponding to the control sequence
of a machine instruction constitutes the microroutine for that instruction, and the individual
control words in this microroutine are referred to as microinstructions
15. Compare vertical organization and horizontal organization.
Vertical organization
Horizontal organization
Minimally encoded
95
II Yr/III Sem
PART-A
UNIT-IV
1. What is RAM?
This storage location can be accessed in any order and access time is independent of the location
being accessed
2. Explain virtual memory.
The data is to be stored in physical memory locations that have addresses different from those
specified by the program. The memory control circuitry translates the address specified by the
program into an address that can be used to access the physical memory.
3. Give the format for main memory address using direct mapping function for 4096 blocks
in main memory and 128 blocks in cache with 16 blocks per cache.
4. Give the format for main memory address using set associative mapping function for
4096 blocks in main memory and 128 blocks in cache with 16 blocks per cache.
96
II Yr/III Sem
PART-A
97
II Yr/III Sem
PART-A
UNIT-V
1.Why IO devices cannot be directly be connected to the system bus?
The IO devices cannot be directly connected to the system bus because i. The data transfer
rate of IO devices is slower that of CPU. ii. The IO devices in computer system has different
data formats and work lengths that of CPU. So it is necessary to use a module between
system bus and IO device called IO module or IO system
2.What is an I/O Interface?
Input-output interface provides a method for transferring binary information between internal
storage, such as memory and CPU registers, and external I/O devices
Write the factors considered in designing an I/O subsystem?
1. Data Location: Device selection, address of data with in device( track, sector etc)
2. Data transfer: Amount, rate to or from device.
3. Synchronization: Output only when device is ready, input only when
4. Memory or between an I/O device and CPU.
3.Explain Direct Memory Access.
A modest increase in hardware enables an IO device to transfer a block of information to or
from memory without CPU intervention. This task requires the IO device to generate
memory addresses and transfer data through the bus using interface controllers.
4.What is polling?
Polling is a scheme or an algorithm to identify the devices interrupting the processor. Polling
is employed when multiple devices interrupt the processor through one interrupt pin of the
processor.
5.What is a Priority Interrupt?
A priority interrupt is an interrupt that establishes a priority over the various sources to
determine which condition is to be serviced first when two or more requests arrive
simultaneously.
6.Define synchronous bus.
Synchronous buses are the ones in which each item is transferred during a time slot(clock
cycle) known to both the source and destination units. Synchronization can be achieved by
connecting both units to a common clock source.
7.Define asynchronous bus.
Asynchronous buses are the ones in which each item being transferred is accompanied by a
control signal that indicates its presence to the destination unit. The destination can respond with
another control signal to acknowledge receipt of the items.
8.Define interrupt.
An interrupt is any exceptional event that causes a CPUU to temporarily transfer control
from its current program to another program , an interrupt handler that services the event in
question.
9.What are the different methods used for handling the situation when multiple interrupts
occurs?
1) Vectores interrupts2) Interrupt nesting 3) Simultaneous Requests
MVIT/Dept of IT/2016-2017/ ODD SEM
98
II Yr/III Sem
PART-A
99