You are on page 1of 43

SESSION ASSIGNMENT

JAN CYCLE-2007

Prepared By : - Harmeet Singh


Course : - MCA
Semester : - First
MDU. SESSION ASSIGNMENT JAN CYCLE-2007
LAST DATE OF SUBMISSION: 25-6-2007
PROGRAMME : APGDCA/M.Sc/MCA 1st Semester
SEMESTER : 1st Semester
SUBJECT CODE : APGDCA 01/M.Sc 01/MCA 01
SUBJECT TITLE : Foundation Course in It & MS-Office
MAX MARKS : 15

Ques. 1 Write short notes on: -

a) Auto Correct

Ans :- AutoCorrect is a feature that saves time by automatically correcting


spelling errors or making pre-selected adjustments as you type. If AutoCorrect is
set to make an adjustment, it does so without any further action from us.

We've probably already noticed the default uses of AutoCorrect which include
changing “teh” to “the” and “adn” to “and.” AutoCorrect automatically changes (C)
to © and (tm) to ™. To adjust AutoCorrect to your own preferences, go to the
Tools menu and select AutoCorrect. In the pop-up dialog box that appears, note
we have choices such as “Capitalize the First Letter of Sentences” and
“Capitalize Names of Days.” Place a check in the boxes we wish or uncheck
those we have no use for. Note the scrolling list of all current AutoCorrect words.
We can add to or delete from the list as desired.

b) Auto Format

Ans :- The AutoFormat feature in Word works behind the scenes to produce an
attractive, easy-to-read document while you concentrate on the content. Word
analyzes each paragraph to see how it is used in the document (for example, as
a heading or as an item in a numbered list) and then applies an appropriate style
for that item. Word also automatically formats Internet, network, and e-mail
addresses as hyperlinks; applies bold or underline character formatting to text
surrounded by asterisks or underscores; replaces two hyphens with an em dash;
and so on.

c) Macro

Ans :- A macro in computer science is a rule or pattern that specifies how a


certain input sequence (often a sequence of characters) should be mapped to an
output sequence (also often a sequence of characters) according to a defined
procedure.

The term originated with macro-assemblers, where the idea was to write a single
statement that appeared like an instruction in the assembly language (a macro-
instruction). When the program was assembled, the macro-instruction was
expanded into a sequence of real instructions that would then be assembled. In
this way the complexity of the sequence of real instructions would be hidden, and
the abstraction of the macro simplified coding and understanding code. Complex
macro-assemblers offered sophisticated ways to add parameters to macros, so
that the macro would expand in different ways according to the values of the
parameters.

Ques.2 Explain the features of MS-EXCEL.

Ans : - MS Excel is a Windows-based application package that can be used to


automate tasks such as calculation and analysis of data, automate financial
statements, business forecasting, transaction registers, inventory control, etc. It
provides multiple facilities, such as making graphs and charts, analyzing
situations, and helps users at the managerial level in taking decisions. The
features provided by Excel are very useful for managers as well as the
supervisors in any type of organization and help them to execute their complex
tasks with a minimum effort. MS Excel can be customized in a way that suits a
user to achieve his goal. It is extensively used in financial organizations. The
features of MS Excel are as follows:

Workbooks: A document in MS Excel is called a workbook. Each workbook


contains sixteen worksheets by default. A user can change this number by
resetting the default options. Worksheets within workbooks make it easy to bind
files of related information. When a user opens a workbook, he can use all the
worksheets to perform a task. To create a workbook, a user will have to select
the New command from the File menu. To open an existing workbook, a user will
have to select the Open option from the File menu. A user can insert a worksheet
between two worksheets by choosing the Worksheet option from the Insert
menu.

Cell References: MS Excel provides three types of cell references: relative,


absolute, and mixed. Relative references refer to the cell relative to the given
position. Absolute references refer to the specific cell irrespective of the position
of the formula. The '$' sign is used to denote an absolute reference. Mixed
references are a combination of both relative and absolute references. It has one
absolute co-ordinate and one relative co-ordinate. and C$1 are both examples of
mixed references.

MS Excel allows fast searching and instant replacing of data. To search or


replace the data entered by a user, he can use the Find or Replace command
from the Edit menu.
1. Horizontal Alignment options:

General: The text is left aligned and the numbers are right aligned. This is the
default status.
Left: Aligns the contents to the left of the cell.
Center: Aligns the cell contents to the center of the cell.
Right: Aligns the contents to the right of the cell.
Fill: Fills the selected cells with the single character.
Justify: This option is selected with multiple lines of text as it wraps the
contents from left to right.

2. Vertical Alignment options:

Top: Aligns the text at the top of the cell.


Center: Places the text in the center of the cell.
Bottom: Aligns the text on the bottom of the cell.
Justify: Wraps the text from top to bottom.

Functions and formulas: The built-in formulas are called functions. MS Excel
provides analyzing data and manipulating text by using different functions. Users
can easily calculate percentage, interest, average, etc. by using built-in functions.
This can be done either by typing in the function-based formulas or by using
function wizards. Formulas are widely used in simple computing (such as
addition, subtraction, multiplication and division) and advanced computing. They
provide the power to analyze data extensively.
Charts: One of the most important features of MS Excel is a chart. MS Excel
allows users to view data entered as tables in a graphical form as charts, which
helps a user to easily understand, analyze, and compare data. Excel allows its
users to create either two-dimensional charts or three-dimensional charts. A user
can enhance the chart by adding chart items, such as data labels, a legend,
titles, text, and gridlines. He can also do formatting on these items by using
colors, alignment, fonts, and other formatting attributes. MS Excel also allows
users to view charts along with the data by using embedded charts. These charts
are included in the worksheet and can be copied, moved, and resized in the
same way as can be done with any other graphical object.

Database: Data are raw facts, information is processed data, and a database is
an organized collection of information. Every organization heavily depends upon
databases to store, retrieve, and maintain different kinds of data. MS Excel
provides all this in the form of its database feature. In MS Excel, database can be
created in two ways:

1. Enter the data in the form of table in the worksheet.

2. Use the Data Form command

Ques.3 Represent the following data in binary number: -

a) (11011001 )2 in to Hexa-Decimal

b) (23)10 in to Octal Number

c) (47)8 in to Decimal

Ques.4 What do you mean by Primary Memory? Differentiate between SIMM,


DIMM and RIMM.
Ans :- Primary storage, or internal memory, is computer memory that is
accessible to the central processing unit of a computer without the use of
computer's input/output channels. Primary storage is used to store data that is
likely to be in active use and is stored in locations selected by virtual addressing
into a physical address. Primary storage is typically very fast, as in the case of
RAM. RAM is also volatile, losing the stored information in an event of power
loss, and quite expensive. ROM is not volatile, but is not suited to storage of
changeable data which is what makes the computer a flexible tool of immense
power; it is also somewhat more expensive to produce as ROM chips are
machine dependent and so have less effective economies of scale. Typically,
Programmable read-only Memory (EEPROM) must also be completely erased
before it can be rewritten, making large scale use impractical for frequently
changing data, if not impossible. Other types of ROM (PROM and EPROM) are
even less flexible but have their niches in imbedded systems.) Therefore the use
of ROM is limited to separate secondary storage such as for code to bootstrap a
system, basic input output system (hardware driver kernels) or for Memory
Management Units, and other applications usually requiring long-term persistent
storage.

Confusingly, the term primary storage has recently been used in a few contexts
to refer to online storage on a server's or local computer's hard disks, which
memory type, is now classified in many instructional contexts as secondary
storage (Before the era of large address spaces and cheap RAM chips, it was
considered otherwise). Swapping data blocks (virtual memory management) from
Hard Disk to Physical RAM and back is so fundamental a part of modern
computers as to make the newer academic distinction almost moot, save that
one is electronic, and the other electromagnetic and comparatively much slower
utilizing dedicated cache memory managers and other tricks to speed up
electronic throughput rates. Hence when the data retrieval can be deferred, the
data may be offline in the hard disk's portion of virtual memory at any given time,
or if it's been needed lately, in physical addresses manged by the virtual memory
swapping controlled by the Memory management unit (MMU).

Primary storage, in the technical sense in use today, includes several types of
storage, such as main storage in physical address space, cache memory, and
internal registers, all of which can be directly accessed by the processor, at least
through the Memory management unit (MMU). Primary storage can be accessed
randomly, that is, accessing any location in storage at any moment takes (nearly)
the same amount of time (Ram locations behind a Memory management unit,
such as video display memory, take a few machine instruction cycles longer, as
the video memory registers would need programmed first). A particular location in
storage is selected by its physical memory address. That address remains the
same, no matter how the particular value stored there changes.

Two main types of SIMMs, three main types of DIMMs, and one type of RIMM
have been commonly used in desktop systems. The various types are often
described by their pin count, memory row width, or memory type.

SIMMs, for example, are available in two main physical types30-pin (8 bits plus
an option for 1 additional parity bit) and 72-pin (32 bits plus an option for 4
additional parity bits)with various capacities and other specifications. The 30-pin
SIMMs are physically smaller than the 72-pin versions, and either version can
have chips on one or both sides. SIMMs were widely used from the late 1980s to
the late 1990s but have become obsolete.

DIMMs are also available in three main types. DIMMs usually hold standard
SDRAM or DDR SDRAM chips and are distinguished by different physical
characteristics. Standard DIMMs have 168 pins, one notch on either side, and
two notches along the contact area. DDR DIMMs, on the other hand, have 184
pins, two notches on each side, and only one offset notch along the contact area.
DDR2 DIMMs have 240 pins, two notches on each side, and one in the center of
the contact area. All DIMMs are either 64-bits (non-ECC/parity) or 72-bits (parity
or error correcting code [ECC]) wide (data paths). The main physical difference
between SIMMs and DIMMs is that DIMMs have different signal pins on each
side of the module. That is why they are called dual inline memory modules, and
why with only 1" of additional length, they have many more pins than a SIMM.

Note

There is confusion among users and even in the industry over regarding the
terms single-sided or double-sided with respect to memory modules. In truth, the
single- or double-sided designation actually has nothing to do with whether chips
are physically located on one or both sides of the module, and it has nothing to
do with whether the module is a SIMM or DIMM (meaning whether the
connection pins are single- or double-inline). Instead the terms single-sided and
double-sided are used to indicate whether the module has one or two banks of
memory chips installed. A double-banked DIMM module has two complete 64-bit-
wide banks of chips logically stacked so that the module is twice as deep (has
twice as many 64-bit rows). In most (but not all) cases, this requires chips to be
on both sides of the module; therefore, the term doublesided has often been
used to indicate that a module has two banks, even though the term is technically
incorrect. Single-banked modules (incorrectly referred to as single-sided) can
have chips physically mounted on both sides of the module, and double-banked
modules (incorrectly referred to as double-sided) can have chips physically
mounted on only one side. I recommend using the terms single-banked and
double-banked instead because they are much more accurate and easily
understood.

RIMMs also have different signal pins on each side. Three different physical
types of RIMMs are available: a 16/18-bit version with 184 pins, a 32/36-bit
version with 232 pins, and a 64/72-bit version with 326 pins. Each of these plugs
into the same sized connector, but the notches in the connectors and RIMMs are
different to prevent a mismatch. A given board will accept only one type. By far
the most common type is the 16/18-bit version. The 32-bit version was
introduced in late 2002, and the 64-bit version was introduced in 2004.

The standard 16/18-bit RIMM has 184 pins, one notch on either side, and two
notches centrally located in the contact area. 16-bit versions are used for non-
ECC applications, whereas the 18-bit versions incorporate the additional bits
necessary for ECC.

The pins are numbered from left to right and are connected through to both sides
of the module on the SIMMs. The pins on the DIMM are different on each side,
but on a SIMM, each side is the same as the other and the connections carry
through. Note that all dimensions are in both inches and millimeters (in
parentheses), and modules are generally available in error correcting code
(ECC) versions with 1 extra ECC (or parity) bit for every 8 data bits (multiples of
9 in data width) or versions that do not include ECC support (multiples of 8 in
data width)

Ques.5 How many addressing technique are there in excel?

Ans:-

Relative references - A relative cell reference in a formula,

such as A1, is based on the relative position of the cell that

contains the formula and the cell the reference refers to.

If the position of the cell that contains the formula changes,


the reference is changed. If you copy the formula across rows

or down columns, the reference automatically adjusts.

By default, new formulas use relative references. For example,

if you copy a relative reference in cell B2 to cell B3, it

automatically adjusts from =A1 to =A2.

Absolute references An absolute cell reference in a formula,

such as $A$1, always refer to a cell in a specific location. If the

position of the cell that contains the formula changes, the

absolute reference remains the same. If you copy the formula across

rows or down columns, the absolute reference does not adjust.

By default, new formulas use relative references, and you need to

switch them to absolute references. For example, if you copy an

absolute reference in cell B2 to cell B3, it stays the same in both cells =$A$1.

Mixed references A mixed reference has either an absolute column

and relative row, or absolute row and relative column. An absolute column

reference takes the form $A1, $B1, and so on. An absolute row reference

takes the form A$1, B$1, and so on. If the position of the cell that contains
the formula changes, the relative reference is changed, and the absolute

reference does not change. If you copy the formula across rows or down

columns, the relative reference automatically adjusts, and the absolute

reference does not adjust. For example, if you copy a mixed reference

from cell A2 to B3, it adjusts from =A$1 to =B$1.

Ques.6 What is the use of creating more than one window at a time? Discuss the
different ways of arranging the windows on the screen.

SUBJECT CODE : APGDCA 02/M.Sc 02/MCA 02

SUBJECT TITLE : Computer Networking & Multimedia

Ques. 1 What is OSI model? Explain its various layers briefly.

Ans:- The OSI, or Open System Interconnection, model defines a networking


framework for implementing protocols in seven layers. Control is passed from
one layer to the next, starting at the application layer in one station, proceeding
to the bottom layer, over the channel to the next station and back up the
hierarchy.

Application
(Layer 7) This layer supports application and end-user processes.
Communication partners are identified, quality of service is identified, user
authentication and privacy are considered, and any constraints on data syntax
are identified. Everything at this layer is application-specific. This layer provides
application services for file transfers, e-mail, and other network software
services. Telnet and FTP are applications that exist entirely in the application
level. Tiered application architectures are part of this layer.

Presentation
(Layer 6) This layer provides independence from differences in data
representation (e.g., encryption) by translating from application to network
format, and vice versa. The presentation layer works to transform data into the
form that the application layer can accept. This layer formats and encrypts data
to be sent across a network, providing freedom from compatibility problems. It is
sometimes called the syntax layer.

Session
(Layer 5) This layer establishes, manages and terminates connections
between applications. The session layer sets up, coordinates, and terminates
conversations, exchanges, and dialogues between the applications at each end.
It deals with session and connection coordination.

Transport
(Layer 4) This layer provides transparent transfer of data between end
systems, or hosts, and is responsible for end-to-end error recovery and flow
control. It ensures complete data transfer.

Network
(Layer 3) This layer provides switching and routing technologies, creating
logical paths, known as virtual circuits, for transmitting data from node to node.
Routing and forwarding are functions of this layer, as well as addressing,
internetworking, error handling, congestion control and packet sequencing.

Data Link
(Layer 2) At this layer, data packets are encoded and decoded into bits. It
furnishes transmission protocol knowledge and management and handles errors
in the physical layer, flow control and frame synchronization. The data link layer
is divided into two sublayers: The Media Access Control (MAC) layer and the
Logical Link Control (LLC) layer. The MAC sublayer controls how a computer on
the network gains access to the data and permission to transmit it. The LLC layer
controls frame synchronization, flow control and error checking.

Physical
(Layer 1) This layer conveys the bit stream - electrical impulse, light or radio
signal -- through the network at the electrical and mechanical level. It provides
the hardware means of sending and receiving data on a carrier, including
defining cables, cards and physical aspects. Fast Ethernet, RS232, and ATM are
protocols with physical layer components.

Ques.2 What are the type of networks topologies? Explain each in detail.

Ans:- Every network has a "shape" which is normally refered to as its topology.
There are five major topologies in use today: Bus, Ring, Star, Tree, and Mesh.
Each is used for specific network types, although some network types can use
more than one topology. For example, Ethernet networks can be laid out in a
Bus, Star, or Tree topology, or any combination of the three. Token ring is
physically laid out in a Star, but electrically behaves like a Ring. To properly
understand each network type requrires first understanding the basic topologies.

Bus

The simplest topology to understand is the Bus. In a Bus, all the devices on the
network are connected to a common cable. Normally, this cable is terminated at
either end, and can never be allowed to form a closed loop. Figure One shows
an example of a Bus network.

Figure One
Bus Topology

Ring

A Ring topology is very similar to the Bus. In a Ring, all the devices on the
network are connected to a common cable which loops from machine to
machine. After the last machine on the network, the cable then returns to the first
device to form a closed loop. Figure Two shows an example of a Ring network.

Figure Two
Ring Topology
Star

A star topology is completely different from either a Bus or a Ring. In a Star. each
device has its own cable run connecting the device to a common hub or
concentrator. Only one device is permitted to use each port on the hub. Figure
Three shows an example of a Star network.

Figure Three
Star Topology

Tree
A tree topology can be thought of as being a "Star of Stars" network. In a Tree
network, each device is connected to its own port on a concentrator in the same
manner as in a Star. However, concentrators are connected together in a
heirarchial manner -- i.e. a hub will connect to a port on another hub. Figure Four
shows a Tree network.

Figure Four
Tree Topology

Mesh

A Mesh topology consists of a network where every device on the network is


physically connected to every other device on the network. This provides a great
deal of performance and reliability, however the complexity and difficulty of
creating one increases geometrically as the number of nodes on the network
increases. For example, a three or four node mesh network is relatively easy to
create, whereas it is impractical to set up a mesh network of 100 nodes -- the
number of interconnections would be so ungainly and expensive that it would not
be worth the effort. Mesh networks are not used much in local area networks
(LANs) but are used in Wide Area Networks (WANs) where reliability is important
and the number of sites being connected together is fairly small. Figure Five
shows an example of a four-node Mesh network.

Figure Five
Mesh Topology

Ques.3 Write short note on :-

a) Digital and analog transmission


Ans:- In general, there are two types of telecommunication transmission--Analog
transmission and Digital transmission.

Analog Transmission

Analog transmission uses signals that are exact replicas of a sound wave or
picture being transmitted. Signals of varying frequency or amplitude are added to
carrier waves with a given frequency of electromagnetic current to produce a
continuous electric wave. The term "analog signal" came about because the
variations in the carrier waves are similar, or analogous, to that of the voice itself.

For example, in analog transmission, say a telephone system, an electric current


or the reproduction of patterned sound waves are transmitted through a wire and
into the telephone receiver. Once this is completed, they are then converted back
into sound waves.

Digital Transmission

In digital transmission the signals are converted into a binary code, which
consists of two elements—positive and non-positive. Morse code and the "on and
off" flashing of a light are basic examples. Positive is expressed as the number 1,
while non-positive is expressed as the number 0. Numbers that are expressed as
a string of 0s and 1s are called binary numbers. Every digit in a binary number is
referred to as a bit and represents a power of two. For example, in the binary
number 101, the 1 at the right represents 1 x 2º; the 0 in the middle represents 0
x 2¹; and the 1 to the far left represents 1 x 2². The decimal equivalent of 101 is
(1 x 2²) + (0 x 2¹) + (1 x 2º) = 4 + 0 + 1 = 5. In a standard code used by most
computers, the letter "A" is expressed in 8 bits as 01000001.
As an example of digital transmission, in a type of digital telephone system,
coded light signals produced by a rapidly flashing laser travels through optical
fibers (thin strands of glass) and are then decoded by the receiver. When
transmitting a telephone conversation, the light flashes on and off about 450
million times per second. This high rate enables two optical fibers to carry about
15,000 conversations simultaneously.

Digital format is ideal for electronic communication as the string of 1s and 0s can
be transmitted by a series of "on/off" signals represented by pulses of electricity
or light. A pulse "on" can represent a 1 and the lack of a pulse "off" can represent
a 0. Information in this form is very much easier to store electronically.
Furthermore, digital transmission is usually faster and involves less noise and
disturbances as compared to analog data transmission.

b) Communication Channels

Ans:- A Channel can take many forms. Examples of communications channels


include:

A connection between initiating and terminating nodes of a circuit.

A buffer from which messages can be put and gotten. See Actor model and
process calculi for discussion on the use of channels.

A single path provided by a transmission medium via either

physical separation, such as by multipair cable or

electrical separation, such as by frequency- or time-division multiplexing.

A path for conveying electrical or electromagnetic signals, usually distinguished


from other parallel paths.
The portion of a storage medium, such as a track or a band, that is accessible to
a given reading or writing station or head.

In a communications system, the part that connects a data source to a data sink.

A specific radio frequency, pair or band of frequencies, usually named with a


letter, number, or codeword, and often allocated by international agreement.
Examples:

Marine VHF radio uses some 88 channels in the VHF band for two-way FM voice
communication. Channel 16, for example, is 156.800MHz. Seven additional
channels, WX1 - WX7, are allocated for weather broadcasts.

Television channels such as North American TV Channel 2 = 55.25MHz, Channel


13 = 211.25MHz. Each channel is 6MHz wide.

Wi-Fi consists of unlicensed channels 1-13 from 2412MHz to 2484MHz in 5MHz


steps.

A room in the Internet Relay Chat (IRC) network, in which participants can
communicate with each other.

All of these communications channels share the property that they transfer
information. The information is carried through the channel by a signal.

c) Compression/Decompression

Ans:- Compression, as the name implies, squeezes or "compresses" the size of


a file or data set. Compression techniques are used for voice, video, audio, text,
and program data in hundreds of different applications and product types. Much
of the compression and subsequent decompression processing performed in
products today is accomplished by a CPU running any number of different
algorithms that have been specifically designed to efficiently reduce the size of a
file or data set.

Unfortunately, all compression algorithms require the entire file to be examined


and processed. Scanning through a file, especially a large file, is something that
CPUs are generally not that good at doing. For applications that do not require
compression and decompression to be accomplished particularly fast, a CPU is
sufficient. When it comes to higher performance applications such as those
involved with Internet file transfers or large data backups, CPU-based
compression is not sufficient.

Hardware compression offers a significant improvement in the rate at which data


can be compressed and decompressed and there are a number of trade-offs that
designers can make when deploying dedicated compression hardware that will
help minimize the overhead while achieving the desired improvements in
compression processing performance. This paper examines some of the specific
trade-offs that a designer can make when deploying hardware for lossless data
compression.

Ques.4 What is

Ques.5 Explain the following:-

a) Audio Synthesis

Ans:- The synthesis of new audio during a game's execution can be useful,
especially in response to unforeseen or rare events. In this chapter, I look at how
to generate tone sequences for sampled audio and how to create MIDI
sequences at runtime. The discussion is split into two main parts: synthesis of
sampled audio and synthesis of sequences. I finish by describing additional
libraries and APIs that can help with audio generation.
b) Authoring

Ans:- Authoring encompasses the Web site creation process. From designing of
your site, creating writing and layout with style, graphics creation and
optimization, to the markup languages like HTML, to our comprehensive how-to
tutorials, this is the place to go for Web site creation information. Programming is
cross-linked under its own category.

c) DVI Technology

Ans:- Short for Digital Video Interactive, a now-defunct technology developed by


General Electric that enables a computer to store and display moving video
images like those on television. The most difficult aspect of displaying TV-like
images on a computer is overcoming the fact that each frame requires an
immense amount of storage. A single frame can require up to 2MB (megabytes)
of storage. Televisions display 30 frames per second, which can quickly exhaust
a computer's mass storage resources. It is also difficult to transfer so much data
to a display screen at a rate of 30 frames per second.

DVI overcomes these problems by using specialized processors to compress


and decompress the data. DVI is a hardware -only codec
(compression/decompression) technology. A competing hardware codec, which
has become much more popular, is MPEG. Intel has developed a software
version of the DVI algorithms, which it markets under the name Indeo.
SUBJECT CODE: APGDCA 03/M.Sc 03/MCA 03

SUBJECT TITLE: Programming in C & data structure

Ques.1 What is meant by Programming style? Enumerate the elements of good


programming style.

Ans :- A well-written computer program is more than just a debugged and tested
program, it should also be readable to yourself and to others. Doing this requires
a certain amount of discipline, but fortunately this discipline is not difficult to
acquire. The purpose of paying attention to coding style is to make reading and
fixing code easier to do, and the effort of writing using a good style makes it more
likely your program will be correct in the first place.

Computer code doesn't need to look pretty, it just needs to look simple and easy
to understand. A lot of students spend a lot of effort trying to make their code look
pretty, but creativity in typography is often better redirected at making the code
actually work well.

This set of notes aims to describe a simple, neat programming style which you
should try to follow in your own coding for this course. You don't have to follow
this style, as long as the other people in your programming team follow a
common style as you; otherwise the code handed in by your team will be
mismatched and more difficult to follow.
Ques.2 What is stack? Enumerate its applications and also write a program in
‘C’ for Push and Pop operations on a stack.

Ans :- In computer science, a stack is a temporary abstract data type and data
structure based on the principle of Last In First Out (LIFO). Stacks are used
extensively at every level of a modern computer system. For example, a modern
PC uses stacks at the architecture level, which are used in the basic design of an
operating system for interrupt handling and operating system function calls.
Among other uses, stacks are used to run a Java Virtual Machine, and the Java
language itself has a class called "Stack", which can be used by the programmer.
The stack is ubiquitous.

A stack-based computer system is one that stores temporary information


primarily in stacks, rather than hardware CPU registers (a register-based
computer system).

Program-

/* allocating an array with 10 elemets used as stack */

int* stack;

int StackInit(int i)

stack = malloc(i*(sizeof(int));

return stack;

}
void push(int elem)

stack[++top] = elem;

int pop(int elem)

return stack[elem--];

int main()

int j = 10;

int l;

/* allocating a stack */

stackinit(j);

/* fill the stack with 10 items */

for(l=0;l<=10;l++){

push(l);
/* we have 10 items in the stack, so quit */

if(l >= 10)

break;

exit(1);

/* pop out all items of the stack */

int k;

for(k = 10;k>=0;k--)

pop(k);

if(k <= 0)

break;

exit(1);

}
return 0;

typedef struct LinkedList

struct LinkedList* head;

struct LinkedList* next;

};

struct LinkedList list;

struct* LinkedList InitList(struct LinkedList* p)

if(p =

malloc(x*sizeof(LinkedList))== NULL)

printf("Error! Unable to allocate memory");

else

p = p->next;

p->next = NULL;

}
return p;

Ques.3 What are the difference between

a) Heap-sort and Radix Sort

Ans:- Heapsort is a much more efficient version of selection sort. It also works by
determining the largest (or smallest) element of the list, placing that at the end (or
beginning) of the list, then continuing with the rest of the list, but accomplishes
this task efficiently by using a data structure called a heap, a special type of
binary tree. Once the data list has been made into a heap, the root node is
guaranteed to be the largest element. It is removed and placed at the end of the
list, then the heap is rearranged so the largest element remaining moves to the
root . Using the heap, finding the next largest element takes O(log n) time,
instead of O(n) for a linear scan as in simple selection sort. This allows Heapsort
to run in O(n log n) time.

Radix sort is an algorithm that sorts a list of fixed-size numbers of length k in O(n
· k) time by treating them as bit strings. We first sort the list by the least
significant bit while preserving their relative order using a stable sort. Then we
sort them by the next bit, and so on from right to left, and the list will end up
sorted. Most often, the counting sort algorithm is used to accomplish the bitwise
sorting, since the number of values a bit can have is small.

b) Inverted List and Multi List

Ans:-
In data management, a file that is indexed on many of the attributes of the data
itself. For example, in an employee file, an index could be maintained for all
secretaries, another for managers. It is faster to search the indexes than every
record. Also known as "inverted lists," inverted file indexes use a lot of disk
space; searching is fast, updating is slower.

c) Call-by-value and Call-by-reference

Ans:- Call by value

Call-by-value evaluation is the most common evaluation strategy, used in


languages as far-ranging as C and Scheme. In call-by-value, the argument
expression is evaluated, and the resulting value is bound to the corresponding
variable in the function (usually by capture-avoiding substitution or by copying the
value into a new memory region). If the function or procedure is able to assign
values to its parameters, only the local copy is assigned -- that is, anything
passed into a function call is unchanged in the caller's scope when the function
returns.

Call-by-value is not a single evaluation strategy, but rather the family of


evaluation strategies in which a function's argument is evaluated before being
passed to the function. While many programming languages that use call-by-
value evaluate function arguments left-to-right, some (such as O'Caml) evaluate
functions and their arguments right-to-left, and others (such as Scheme and C)
leave the order unspecified (though they generally guarantee sequential
consistency).

Call by reference

In call-by-reference evaluation, a function is passed an implicit reference to its


argument rather than the argument value itself. If the function is able to modify
such a parameter, then any changes it makes will be visible to the caller as well.
If the argument expression is an L-value, its address is used. Otherwise, a
temporary object is constructed by the caller and a reference to this object is
passed; the object is then discarded when the function returns.
Some languages contain a notion of references as first-class values. ML, for
example, has the "ref" constructor; references in C++ may also be created
explicitly. In these languages, "call-by-reference" may be used to mean passing a
reference value as an argument to a function.

In languages (such as C) that contain unrestricted pointers instead of or in


addition to references, call-by-address is a variant of call-by-reference where the
reference is an unrestricted pointer.

d) Singly and Double link list

Ans:- Singly-linked list

The simplest kind of linked list is a singly-linked list (or slist for short), which
has one link per node. This link points to the next node in the list, or to a null
value or empty list if it is the final node.

A singly-linked list containing three integer values

[edit] Doubly-linked list

A more sophisticated kind of linked list is a doubly-linked list or two-way linked


list. Each node has two links: one points to the previous node, or points to a null
value or empty list if it is the first node; and one points to the next, or points to a
null value or empty list if it is the final node.

A doubly-linked list containing three integer values


Ques.4 What do you mean by Binary Search? How does it differ from Sequential
Search? Explain.

Ques.5 What is traversal of graph & tree?

Ans:- A binary search algorithm (or binary chop) is a technique for finding a
particular value in a sorted list. It makes progressively better guesses, and closes
in on the sought value, by comparing an element halfway with what has been
determined to be an element too low in the list and one too high in the list. A
binary search finds the median element in a list, compares its value to the one
you are searching for, and determines if it’s greater than, less than, or equal to
the one you want. A guess that turns out to be too high becomes the new top of
the list, and one too low the new bottom of the list. The binary search's next
guess is halfway between the new list's top and bottom. Pursuing this strategy
iteratively, it narrows the search by a factor 2 each time, and finds your value. A
binary search is an example of a divide and conquer algorithm (more specifically
a decrease and conquer algorithm) and a dichotomic search.

SUBJECT CODE : APGDCA 04/M.Sc 04/MCA 04

SUBJECT TITLE : CO&A

Computer Organisation & Architecture

Ques.1 What is meant by an Instruction Set? What are the elements of an


Instruction? How an instruction is represented? What are various types of
instruction?

Ans:- An instruction set, or instruction set architecture (ISA), is the part of the
computer architecture related to programming, including the native data types,
instructions, registers, addressing modes, memory architecture, interrupt and
exception handling, and external I/O. An ISA includes a specification of the set of
opcodes (machine language), the native commands implemented by a particular
CPU design.

Instruction set architecture is distinguished from the microarchitecture, which is


the set of processor design techniques used to implement the instruction set.
Computers with different microarchitectures can share a common instruction set.
For example, the Intel Pentium and the AMD Athlon implement nearly identical
versions of the x86 instruction set, but have radically different internal designs.

This concept can be extended to unique ISAs like TIMI (Technology-Independent


Machine Interface) present in the IBM System/38 and IBM AS/400. TIMI is an ISA
that is implemented as low-level software and functionally resembles what is now
referred to as a virtual machine. It was designed to increase the longevity of the
platform and applications written for it, allowing the entire platform to be moved to
very different hardware without having to modify any software except that which
comprises TIMI itself. This allowed IBM to move the AS/400 platform from an
older CISC architecture to the newer POWER architecture without having to
rewrite any parts of the OS or software associated with it.

Ques.2 What is pipelining ? When, where and why it is necessary? Also


Differentiate between the Instruction pipelining and Arithmetic pipelining.

Ans:- In computers, a pipeline is the continuous and somewhat overlapped


movement of instruction to the processor or in the arithmetic steps taken by the
processor to perform an instruction. Pipelining is the use of a pipeline. Without a
pipeline, a computer processor gets the first instruction from memory, performs
the operation it calls for, and then goes to get the next instruction from memory,
and so forth. While fetching (getting) the instruction, the arithmetic part of the
processor is idle. It must wait until it gets the next instruction. With pipelining, the
computer architecture allows the next instructions to be fetched while the
processor is performing arithmetic operations, holding them in a buffer close to
the processor until each instruction operation can be performed. The staging of
instruction fetching is continuous. The result is an increase in the number of
instructions that can be performed during a given time period.

Pipelining is sometimes compared to a manufacturing assembly line in which


different parts of a product are being assembled at the same time although
ultimately there may be some parts that have to be assembled before others are.
Even if there is some sequential dependency, the overall process can take
advantage of those operations that can proceed concurrently.

Computer processor pipelining is sometimes divided into an instruction pipeline


and an arithmetic pipeline. The instruction pipeline represents the stages in
which an instruction is moved through the processor, including its being fetched,
perhaps buffered, and then executed. The arithmetic pipeline represents the
parts of an arithmetic operation that can be broken down and overlapped as they
are performed.

Pipelines and pipelining also apply to computer memory controllers and moving
data through various memory staging places.

Ques.3 What is a Shift register? Show how a shift register with parallel load can
be used to convert parallel input to serial outputs and serial input to parallel
output?

Ans:- Shift registers can have a combination of serial and parallel inputs and
outputs, including serial-in, parallel-out (SIPO) and parallel-in, serial-out
(PISO) types. There are also types that have both serial and parallel input and
types with serial and parallel output. There are also bi-directional shift registers
which allow you to vary the direction of the shift register. The serial input and
outputs of a register can also be connected together to create a circular shift
register. One could also create multi-dimensional shift registers, which can
perform more complex computation.
Serial-In, Serial-Out

Destructive Readout

These are the simplest kind of shift register. The data string is presented at 'Data
In', and is shifted right one stage each time 'Data Advance' is brought high. At
each advance, the bit on the far left (i.e. 'Data In') is shifted into the first Flip-
Flop's output. The bit on the far right (i.e. 'Data Out') is shifted out and lost.

4-Bit SISO Shift Register


0 0 0 0

1 0 0 0
The data is stored after each flip-flop on the 'Q' output, so there are
1 1 0 0
four storage 'slots' available in this arrangement, hence it is a 4-Bit
0 1 1 0
Register. To give an idea of the shifting pattern, imagine that the
register holds 0000 (so all storage slots are empty). As 'Data In' 1 0 1 1
presents 1,1,0,1,0,0,0,0 (in that order, with a pulse at 'Data Advance' 0 1 0 1
each time. This is called clocking or strobing) to the register, this is the
0 0 1 0
result. The left hand column corresponds to the left-most flip-flop's
0 0 0 1
output pin, and so on.
0 0 0 0
So the serial output of the entire register is 00001101 (not counting the
final step). As you can see if we were to continue to input data, we would get
exactly what was put in, but offset by four 'Data Advance' cycles. This
arrangement is the hardware equivalent of a queue. Also, at any time, the whole
register can be set to zero by bringing the reset (R) pins high.

This arrangement performs destructive readout - the data is lost once it has been
shifted out of the right-most bit.

Ques.4 What is the difference between Multiplexer and Demultiplexer? Outline


important applications of both of these.

Ans:-

Multiplexer

Description

This component contains a multiplexer for boolean values. The multiplexer routes
one of the input values to the output connector. The selected input connector
depends on the address read from the address inputs.
The component has an internal address latch. This latch is activated if the
optional connector 'Enable Latch Address' is activated. During true condition at
this input the current address is used. A change to false condition latches the
address. During false condition at this input the latched address is used. The
latch is bypassed if the optional connector 'Enable Latch Address' is deactivated.

The component also has an internal output latch. This latch is activated if the
connector 'Enable Latch Output' is activated. During true condition at this input
the current addressed input value is used. A change to false condition latches the
output value. During false condition at this input the latched output value is used.
The latch is bypassed if the optional connector 'Enable Latch Output' is
deactivated.

If an input is addressed which does not exist (e.g. the 15th input is selected but
the component has only 14 inputs) the reset value is used.

Features

• Up to 16 inputs.

• The all inputs and outputs are negatable.

• The 'Latch Address Input' and 'Latch Output' inputs are level or edge
sensitive.

• Activate or deactivate the optional 'Latch Address Input' and 'Latch Output'
inputs (deactivated connectors are hidden).

• The component is rotatable.

Demultiplexer

Description

This component contains a demultiplexer for boolean values. The demultiplexer


routes the input value to one of the output connectors. The selected output
connector depends on the address read from the address inputs.
The component has an internal address latch. This latch is activated if the
optional connector 'Enable Latch Address' is activated. During true condition at
this input the current address is used. A change to false condition latches the
address. During false condition at this input the latched address is used. The
latch is bypassed if the optional connector 'Enable Latch Address' is deactivated.

The component also has an internal output latch. This latch is activated if the
connector 'Enable Latch Output' is activated. During true condition at this input
the latch is bypassed. A change to false condition latches the last output values.
During false condition at this input the latched output values are used. The latch
is bypassed if the optional connector 'Enable Latch' is deactivated.

Features

• Up to 16 outputs.

• The all inputs and outputs are negatable.

• The 'Latch Address Input' input are level or edge sensitive.

• Activate or deactivate the optional 'Latch Address Input' (deactivated


connectors are hidden).

• The component is rotatable.

Ques.5 What are registers ? Explain the various types of registers.

Ans:- Types of Shift Register

Shift registers can have a combination of serial and parallel inputs and outputs,
including serial-in, parallel-out (SIPO) and parallel-in, serial-out (PISO) types.
There are also types that have both serial and parallel input and types with serial
and parallel output. There are also bi-directional shift registers which allow you
to vary the direction of the shift register. The serial input and outputs of a register
can also be connected together to create a circular shift register. One could
also create multi-dimensional shift registers, which can perform more complex
computation.

Serial-In, Serial-Out

Destructive Readout

These are the simplest kind of shift register. The data string is presented at 'Data
In', and is shifted right one stage each time 'Data Advance' is brought high. At
each advance, the bit on the far left (i.e. 'Data In') is shifted into the first Flip-
Flop's output. The bit on the far right (i.e. 'Data Out') is shifted out and lost.

4-Bit SISO Shift Register


0 0 0 0

1 0 0 0
The data is stored after each flip-flop on the 'Q' output, so there are
1 1 0 0
four storage 'slots' available in this arrangement, hence it is a 4-Bit
0 1 1 0
Register. To give an idea of the shifting pattern, imagine that the
register holds 0000 (so all storage slots are empty). As 'Data In' 1 0 1 1
presents 1,1,0,1,0,0,0,0 (in that order, with a pulse at 'Data Advance' 0 1 0 1
each time. This is called clocking or strobing) to the register, this is the
0 0 1 0
result. The left hand column corresponds to the left-most flip-flop's
0 0 0 1
output pin, and so on.
0 0 0 0
So the serial output of the entire register is 00001101 (not counting the
final step). As you can see if we were to continue to input data, we would get
exactly what was put in, but offset by four 'Data Advance' cycles. This
arrangement is the hardware equivalent of a queue. Also, at any time, the whole
register can be set to zero by bringing the reset (R) pins high.

This arrangement performs destructive readout - the data is lost once it has been
shifted out of the right-most bit.

Non-destructive readout

Non-destructive readout can be achieved using the configuration shown below.


Another input line is added - the Read/Write Control. When this is high (i.e. write)
then the shift register behaves as normal, advancing the input data one place for
every clock cycle, and data can be lost from the end of the register. However,
when the R/W control is set low (i.e. read), any data shifted out of the register at
the right becomes the next input at the left, and is kept in the system. Therefore,
as long as the R/W control is set low, no data can be lost from the system.
4-Bit SISO Shift Register with Non-Destrucive Readout

In this animation, the last four output bits are shown on the far right. When the
R/W control is set low, the data is both output and brought back into the input of
the register, but when R/W is high, the data is shifted out and lost.

Serial-In, Parallel-Out

This configuration allows conversion from serial to parallel format. Data is input
serially, as described in the SISO section above. Once the data has been input, it
may be either read off at each output simultaneously, or it can be shifted out and
replaced.

4-Bit SIPO Shift Register


rParallel-In, Serial-Out

This configuration has the data input on lines D1 through D4 in parallel format. To
write the data to the register, the Write/Shift control line must be held LOW. To
shift the data, the W/S control line is brought HIGH and the registers are clocked.
The arrangement now acts as a SISO shift register, with D1 as the Data Input.
However, as long as the number of clock cycles is not more than the length of the
data-string, the Data Output, Q, will be the parallel data read off in order.

4-Bit PISO Shift Register

The animation below shows the write/shift sequence, including the internal state
of the shift register.
Parallel-In, Parallel-Out

This kind of shift register takes the data from the parallel inputs (D0-D3) and
shifts it to the corresponding output (Q0-Q3) when the registers are clocked. It
can be used as a kind of 'history', retaining old information as the input in another
part of the system, until ready for new information, whereupon, the registers are
clocked, and the new data is 'let through'.

4-Bit PIPO Shift Register

You might also like