Monday, December 19, 2011

Benefits of multithread


Benefits of multithread :-
The benefits of multithreaded programming is:
1. Responsiveness:- Multithreading an interactive application may allow a
program to continue running even if part of it is blocked or is performing
a lengthy operation, thereby increasing responsiveness to the user.
2.Resource sharing :-It allows an application to have several different threads of activity all within the same address space.
3.)Economy:-Due to cost of memory ,it is more economical to create and context switch threads.
4. Utilization of multiprocessor architectures: - A single-threaded
process can only run on one CPU,Multithreading on a multi-CPU machine increases concurrency.

   On single processor machine ,multithreading can help where:-i)some task tales much longer to execute than other .
ii)some task need a better deterministic outcome than other.
iii)some user interface activity is to be run concurrently with hardware communication.

Process State

Process State:-for a program to be executed, a process, or task, is created for that program.As a process executes, it changes state. The state of a process is defined in part by the current activity of that process.dispatcher program that switches the processor from one process to another.

 Each process may be in one of the following states:--
*New: The process is being created.
*Running: Instructions are being executed.
*Waiting: The process is waiting for some event to occur (such as an I/O completion or reception of a signal).
*Ready: The process is waiting to be assigned to a processor.
*Terminated: The process has finished execution.
Process state Diagram


Process Creation

Process Creation--When a new process is to be added to those currently being managed, the OS builds the data structures that are used to manage the process and allocates address space in main memory to the process.
                 A process may create several new processes, via a create-process system call, during the course of execution. The creating process is called a parent process, and the new processes are called the children of that process. Each of these new processes may in turn create other processes, forming a tree of processes.
*Reasons for Process Creation->
1.New batch job -The OS is provided with a batch job control stream, usually on tape or
disk.When the OS is prepared to take on new work, it will read the
next sequence of job control commands.
2.Interactive login-> A user at a terminal logs on to the system.
3.Created by OS to provide a service-> The OS can create a process to perform a function on behalf of a user program, without the user having to wait (e.g., a process to control
printing).
4.Spawned by existing process->For purposes of modularity or to exploit parallelism, a user program
can dictate the creation of a number of processes.

                                                                     When the OS creates a process at the explicit request of another
process, the action is referred to as process spawning.

Proccess

Proccesses :-
A batch system executes jobs, whereas a time-shared system has user programs, or tasks. Process is a program in execution. A program is only one part of process ,the process also contains the execution state of program.
It also includes the current activity, as represented by the value of the program counter and the contents of the processor ‘s registers. a process generally includes the process stack, which contains temporary data (such as method parameters, return addresses, and local variables), and a data section, which contains global
variables.
 So process,including--
  a.)A program in execution
  b.)An instance of a program running on a computer
  c.)The entity that can be assigned to and executed on a processor
  d.)A unit of activity characterized by the execution of a sequence of instructions, a current state, and an associated set of system resources

Each process provides the resources needed to execute a program.A single process might contains multiple threads. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier.A process is always stored in the main memory also termed as the primary memory or random access memory.On a multiprocessor system, multiple processes can be executed in parallel.
        At any given point in time, while the program is executing, this process can be uniquely characterized by a number of elements, including the following:--
• Identifier:- A unique identifier associated with this process, to distinguish it
from all other processes.
• State- If the process is currently executing, it is in the running state.
• Priority:- Priority level relative to other processes.
• Program counter: -The address of the next instruction in the program to be
executed.
• Memory pointers: -Includes pointers to the program code and data associated
with this process, plus any memory blocks shared with other processes.
• Context data: -These are data that are present in registers in the processor
while the process is executing.
• I/O status information: -Includes outstanding I/O requests, I/O devices (e.g., tape
drives) assigned to this process, a list of files in use by the process, and so on.
• Accounting information: -May include the amount of processor time and clock
time used, time limits, account numbers, and so on.

Os as Resource Manager

Os as Resource Manager--
A computer is a set of resources for the movement, storage, and processing of data and for the control of these functions.The OS is responsible for managing resources like mouse ,printer ,memory ,etc.OS provides instructions for the processor.it is a program or suite of programs executed by the processor.    
                      The OS frequently relinquishes control and must depend on the processor to allow it to regain control.The OS directs the processor in the use of the other system resources and in the timing of its execution of other programs.
 Fig shows the main resources that are managed by the OS.A portion of the OS is in main memory.This includes the kernel, or nucleus, which contains the most frequently used functions in the OS and, at a given time, other portions of the OS currently in use.The allocation of this resource (main memory) is controlled by the OS and memory management hardware in the processor.The processor itself is a resource, and the OS determines how much processor time is to be devoted to the execution of a particular user program..


Sunday, December 18, 2011

Batch Processing

Batch Processing-It uses use multiprogramming.
Advantages of Batch Processing-
*Batch processing is particularly useful for operations that require the computer or a
peripheral device for an extended period of time and very little user interaction
  Disadvantages of Batch Processing-
*No interaction is possible with the user while the program is being executed
Job setup time was real problem li took a lot of time for mounting of tapes or cards
• .CPU sat idle during the transition from one job to another.

Advantages of Distributed System over Independent PCs

 Advantages of Distributed System over Independent PCs--

1. Data Sharing: It is always possible to have people working independently on their
own PCs, for the same business. But we know that users may need to share data. For example,
airline reservation clerks need access to the master database of flights and existing
reservations. Giving each clerk his own private copy Of the entire database would not work,
since nobody would be able to know which seas the other clerks have all ready sold. Shared
data is absolutely essential to this of application and so, the machines must be.
interconnected
2.Device Sharing: Data are not the only things to be shared. Expensive . peripherals
such as color laser printers, photo-type setters and massive archival storage devices are also
among the few things that should be sharable.
3. Communication: Another reason to connect a group of isolated computers into a
distributed system is to achieve enhanced person-to-person communication. For many people,
electronic mail has numerous attractions over paper mail, telephone and FAX as it makes
various kinds of documents accessible by the people without changing their formats. this
requires a good communication setup.
4. Flexibility: Finally, a distributed System is potentially more flexible than giving each
user a isolated personal computer. If, we have a mixture of personal and shared computers, perhaps of different sizes, and jobs run on the most appropriate ones rather than always on
the owners machine. Then the workload can be spread Over the computers more effectively
and letting people run their jobs elsewhere may compensate for the loss of a few machines.
This way the system will be more flexible.

Advantage of Distributed Systems over Centralized Ones

Advantage of Distributed Systems over Centralized Ones-->
1. Speed. When used to implement parallel processing where only goal is to achieve
maximum speed on a single problem, distributed systems can achieve very high specd as
compared to the centralized ones.
2. Inherent Distribution- Another reason for building a distributed system is that some
applications are inherently distributed. Banking, Airline reservation etc. are examples of the
 applications that are inherently distribute . When all the branches of a bank are connected,
  we have a commercial distributed system.
3. Reliability- Another potential advantage of a distributed system over a centralized
 one is higher reliability. By distributing the workload over many machines, a single chip
failure will bring down at most one machine, leaving the rest intact. Ideally, if 5 percent of
the machines are down at any moment, the system should be able to continue to work with
a 5 percent loss in performance. For critical applications, such as control of nuclear reactors
or aircraft, using a distributed system to achieve high reliability may be a dominant consideration
4. Incremental Growth. Finally, incremental growth is also potentially a big plus. Often
a company will buy a mainframe with the intention of doing all its work on it. If the company
prospers and the workload grows, at a certain point the mainframe will no longer be adequate.
The only solutions are to either replace the mainframe with a larger one (if it exists), or add
a second mainframe. Both of these can cause management difficulties with the company's
operations. In contrast, with a distributed system, it may be possible to simply add more
processors to the system, thus allowing it to expand gradually as the need arises.

Client Server

Client Server Support--server process waits for a request from a
client for one of its services.A client, which can be an application program or another server
program, requests a service by sending a message.The message is routed through the Executive to the appropriate server.The server performs the requested operation and
returns the results or status information by means of another message,which is routed
through the Executive back to the client.
*Advantages of a client/server architecture include the following:-
• It simplifies the Executive. It is possible to construct a variety of APIs implemented
in user-mode servers without any conflicts or duplications in the Executive.
New APIs can be added easily.
• It improves reliability. Each new server runs outside of the kernel, with its own partition of memory, protected from other servers. A single server can fail without crashing or corrupting the rest of the OS.
-It provides a uniform means for applications to communicate with services via
RPCs without restricting flexibility.
-It provides a suitable base for distributed computing.

Saturday, December 17, 2011

Thereds and it's Use

Thereds:-A thread is a single sequential flow of control within a program . or A sequence of a program which runs a certain function within a program.
                          A thread, sometimes called a lightweight process (LWP), is a basic unit of CPU  utilization.
If the process has multiple threads of control, it can do more than  one task at a time.
  ex.-A web browser might have one thread display images or text   while another thread retrieves data from the network.For example, a web server accepts client requests for web pages, images, sound, and so forth. A busy web server may have several (perhaps hundreds) of clients concurrently accessing it. If the web server ran as a traditional single-threaded process, it would be able to service only one client at a time.
    Uses of threads in a single-user multiprocessing system:-
*Foreground and background work:- For example, in a spreadsheet program,
one thread could display menus and read user input, while another thread executes user commands and updates the spreadsheet.It increases speed of the application by allowing the program to prompt for the next command before the previous command is complete.
*Asynchronous processing: -asynchronous elements in the program can be implemented
as threads. For example, as a protection against power failure, one
can design a word processor to write its random access memory (RAM) buffer
to disk once every minute.
*Speed of execution: A multithreaded process can compute one batch of data
while reading the next batch from a device. On a multiprocessor system, multiple threads from the same process may be able to execute simultaneously.
*Modular program structure: -Programs that involve a variety of activities or a variety of sources and  estinations of input and output may be easier to design and implement using threads.
  

Processor point of view of OS

Processor point of view: At a certain point, the processor is executing instructions  from the portion of main memory containing the monitor.These instructions  cause the next job to be read into another portion of main memory. Once  a job has been read in, the processor will encounter a branch instruction in the  monitor that instructs the processor to continue execution at the start of the  user program.The processor will then execute the instructions in the user program  until it encounters an ending or error condition. Either event causes the processor to fetch its next instruction from the monitor program. Thus the  phrase “control is passed to a job” simply means that the processor is now  fetching and executing instructions in a user program, and “control is returned  to the monitor” means that the processor is now fetching and executing instructions  from the monitor program.

Network operating system

Network operating system--A network operating system is an operating system that provides features such as file sharing across the network and that includes a communication scheme that allows different processes on different computers to exchange messages. A computer running a network operating system acts autonomously from all other computers on the network, although it is aware of the network and is able to communicate with other networked computers.
     An operating system, which includes software to communicate with othe computers via a
network, is called -network operating system. This allows resources such as files, application
programs and printers to be shared between computers
Such operating systems are specialized to provide the networking services.
Network operating system examples are . -
                BSD (Berkeley System Distribution) Unix, Novell, Lantastic.

User and System View of OS

User View--For user The goal is to maximize the work (or play) that the user is performing. In this case, the operating system is designed mostly for ease of use, with some attention paid to performance and none paid to resource utilization—how various hardware and software resources are shared. Performance is, of course, important to the user; but rather than resource utilization, such systems are optimized for the single-user experience.
                A user sits at a terminal connected to a mainframe or  minicomputer. Other users are accessing the same computer through other  terminals. These users share resources and may exchange information. The   operating system in such cases is designed to maximize resource utilization—       to assure that all available CPU time, memory, and I/O are used efficiently and   that no individual user takes more than her fair share.    In still other cases, users sit at workstations connected to networks of   other workstations and servers.These users have dedicated resources at their       disposal, but they also share resources such as networking and servers—file, compute, and print servers. Therefore, their operating system is designed to
compromise between individual usability and resource utilization.
 

System View--computer's point of view, the operating system is the program most intimately involved with the hardware. In this context, we can view an operating system as a resource allocator. A computer system has many resources that may be required to solve a problem: CPU time, memory space,  file-storage space, I/O devices, and so on. The operating system acts as the manager of these resources.An operating system is a  control program. A control program manages the execution of user programs  to prevent errors and improper use of the computer. It is especially concerned  with the operation and control of I/O devices.

System Calls

System Calls-System calls provide an interface to the services made available by an operating
system or interface between a pEocess and the operating system.the purpose of a system call is to request the operating system to perform some activity. For ex writing a  simple program to read data from one file and copy them to another file. The first input that the program will need is the names of the two files: the input file and the output file.This requires many I/O system calls.Once the two file names are obtained, the program must open the input file and create the output file.Each of these operations requires another system call.
 
  There are different system calls for performing different kinds of tasks -
•File manipulation system calls for example, are open, close, read, write, lseek etc.
•There can be system calls for process control. These can be like abort, execute, create
    process, terminate a process, allocate and free ‘memory for a process etc.
•For device management, the system calls that can be there are — request device, release:
device, read, write, reposition, get and set device attributes etc
•For managing the information, the system calls that can be there are — get and set
time, get and set file or device attributes etc.. ‘‘

OPERATING SYSTEM SERVICES

OPERATING SYSTEM SERVICES-- It is Intermediary between user of a computer and computer h/w
An operating system provides an environment for the execution of programs in a convenient manner and manages the computer h/w.
*User interface.-
*Program execution. The system must be able to load a program into
memory and to run that program. The program must be able to end its
execution,.
*I/O operations.-A running program may require I/O, which may involve a
file or an I/O device.
*File-system manipulation.- The file system is of particular interest.programs need to read and write files and directories.
*Communications.-communication
may occur between processes that are executing on the same computer
or between processes that are executing on different computer systems tied together by a computer network.Communications may be implemented via shared memory or through message passing, in which packets of
information are moved between processes by the operating system.
*Error detection.- The operating system needs to be constantly aware of possible errors. Errors may occur in the CPU and memory hardware (such
as a memory error or a power failure), in I/O devices (such as a parity error on tape, a connection failure on a network,.
*Resource allocation. When there are multiple users or multiple jobs
running at the same time, resources must be allocated to each of them.This is done by os.
*Accounting:-A good OS will collect usage statistics for various resources and monitor performance parameters such as response time.
*Protection and security. The owners of information stored in a multiuser or
networked computer system may want to control use of that information.

Database Administrator

Database Administrator:-Schema definition. -The DBA creates the original database schema by executing a set of data definition statements in the DDL.
-Storage structure and access-method definition.To define the storage structure and access methods.
- Schema and physical-organization modification.--The DBA carries out changes to the schema and physical      organization to reflect the changing needs of the organization, or to alter the physical organization to improve    performance.
-Granting of authorization for data access--
-Routine maintenance-
-To grant authorization for data access
-To specify integrity constraints

Hierarchical Model

Hierarchical Model - A hierarchical database is similar in nature to a file system, with a root or parent node and one or more children referencing the parent. This makes for a very fast
data-access path.
The hierarchical model organizes data elements as tabular rows, one for each instance of an entity. Consider a company's organizational structure. At the top we have a General Manager (GM). Under him we have several Deputy General Managers (DGMs). Each DGM looks after some departments and each department will have a manager and many employees. When represented in hierarchical model, there will be separate rows for representing the GM, each DGM, each department, each Manager and each Employee. The row position implies a relationship to other rows. A given employee belongs to the department that is closest above it in the list and the department belongs to the manager that is immediately above it in the list and so on.
it has the disadvantages of low flexibility, lack of an ad-hoc
query capability, and high application maintenance.


Data integrity Since the hierarchical model is based on the parent Childes relationship, there is always a link between the parent segment and the child segments under it The child segments arc always aromatically referenced to its parent.

File-processing system and a DBMS

File-processing system and a DBMS:-
a.)Both systems contain a collection of data and a set of programs which access
that data. A database management system coordinates both the physical
and the logical access to the data, whereas a file-processing system coordinates
only the physical access.
b.)A database management system reduces the amount of data duplication by
ensuring that a physical piece of data is available to all programs authorized
to have access to it,whereas data written by one programing a file-processing
system may not be readable by another program.
c.)A database management system is designed to allow flexible access to data
(i.e., queries), whereas a file-processing system is designed to allow predetermined
access to data (i.e., compiled programs).
d.)A database management system is designed to coordinate multiple users
accessing the same data at the same time. A file-processing systems usually designed to allow one or more programs to access different data files at
the same time. In a file-processing system, a file can be accessed by two
programs concurrently only if both programs have read-only access to the
file.

Entity Sets

Entity Sets:-An entity is a “thing” or “object” in the real world that is distinguishable from all
other objects. For example, each person in an enterprise is an entity. An entity has a
set of properties, and the values for some set of properties may uniquely identify an entity.

An entity set is a set of entities of the same type that share the same properties, or
attributes.The set of all persons who are customers at a given bank, for example, can be defined as the entity set customer.The individual entities that constitute a
set are said to be the extension of the entity set.Entity sets do not need to be disjoint.


A database thus includes a collection of entity sets, each of which contains any
number of entities of the same type.

Disadvantages of file processing system

Disadvantages of file processing system:-
a.)Data redundancy and inconsistency.:-Data redundancy means duplication of data.Non data base system maintain separate copy of data for each applied redundancy leads to higher storage and access cost.and also inconstancy.
b.)Difficulty in accessing data.:-file-processing environments do not allow needed data to be retrieved in a convenient and efficient manner.
c.)Data isolation.:- Because data are scattered in various files, and files may be in
different formats, writing new application programs to retrieve the appropriate
data is difficult.
d.)Integrity problems.:- The data values stored in the database must satisfy certain
types of consistency constraints.when new constraints are added, it is difficult
to change the programs.
e.)Atomicity problems.:-the funds transfer must be atomic—it must happen in its entirety or
not at all. It is difficult to ensure atomicity in a conventional file-processing
system.
f.)Concurrent-access anomalies.:-It not provide it.
g.)Security problems:-enforcing security constraints is difficult.

ACID properties

Properties of Transactions--
The following are the ACID properties:
1. Atomicity: A transaction is an atomic unit of processing; it is either performed in its entirety or not performed at all.Either all operations of the transaction are reflected properly in the
database, or none are.
2. Consistency preservation: A transaction is consistency preserving if its complete execution take(s) the database from one consistent state to another.Execution of a transaction in isolation (that is, with no other
transaction executing concurrently) preserves the consistency of the database.
3. Isolation: A transaction should appear as though it is being executed in isolation from other transactions. That is, the execution of a transaction should not be interfered with by any other transactions executing concurrently.
Even though multiple transactions may execute concurrently, the
system guarantees that, for every pair of transactions Ti and Tj , it appears
to Ti that either Tj finished execution before Ti started, or Tj started execution
after Ti finished. Thus, each transaction is unaware of other transactions
executing concurrently in the system.
4. Durability or permanency: The changes applied to the database by a committed transaction must persist in the database. These changes must not be lost because of any failure.
After a transaction completes successfully, the changes it has made
to the database persist, even if there are system failures.

Friday, December 16, 2011

Advantages of DBMS over Simply storing data

Advantages of DBMS over Simply storing data:-
A.)Data independence and efficient access.:-Database application programs are independent
of the details of data representation and storage.DBMS provides efficient storage and
retrieval mechanisms, including support for very large files, index structures and
query optimization.
B.)Reduced application development time.:-DBMS provides several important
functions required by applications, such as concurrency control and crash
recovery, high level query facilities, etc., only application-specific code needs to
be written.
C.)Data integrity and security. The view mechanism and the authorization facilities
of a DBMS provide a powerful access control mechanism. Further, updates to the
data that violate the semantics of the data can be detected and rejected by the
DBMS if users specify the appropriate integrity constraints.
D.)Data administration. By providing a common umbrella for a large collection of
data that is shared by several users, a DBMS facilitates maintenance and data
administration tasks. A good DBA can effectively shield end-users from the chores
of fine-tuning the data representation, periodic back-ups etc.
E.)Concurrent access and crash recovery.

Controlled Access

Controlled Access--In controlled access, the stations consult one another to find which station has the right to send. A station cannot send unless it has been authorized by other stations.
1.Reservation--In the reservation method, a station needs to make a reservation before sending data.
Time is divided into intervals. In each interval, a reservation frame precedes the data frames sent in that interval.If there are N stations in the system, there are exactly N reservation mini slots in the
reservation frame.When a station needs to send a data frame, it makes a reservation in its own mini slot. The stations that have made reservations
can send their data frames after the reservation frame.
2.Polling--It is similar to the roll-call performed in a classroom.In Polling one device is designated as a primary station and the other devices are secondary stations.All data exchanges must be made through the primary device even when the ultimate destination is a secondary device.The primary device controls the link; the secondary devices follow its instructions.If the primary wants to receive data, it asks the secondaries if they have anything to send; this is called poll function..If there is no data, usually a “poll reject” message is sent back. If the primary wants to send data, it tells the secondary
to get ready to receive; this is called select function.

3.Token Passing--In token passing scheme, all stations are logically connected in the form of a ring and control of the access to the medium is performed using a token.A token is a special bit pattern or a small packet, usually several bits in length, which circulate from node to node. Token passing can be used with both broadcast (token bus) and sequentially connected (token ring) type of networks.
token is passed from a node to the physically adjacent node.

Bridges

Bridges--A bridge operates in both the physical and the data link layer. As a physical layer
device, it regenerates the signal it receives. As a data link layer device, the bridge can
check the physical (MAC) addresses (source and destination) contained in the frame.A bridge has filtering capability. It can check the destination address of a frame and
decide if the frame should be forwarded or dropped. If the frame is to be forwarded, the
decision must specify the port. A bridge has a table that maps addresses to ports.
A bridge does not change the physical (MAC) addresses in a frame.
  A two-layer switch is a bridge, a bridge with many ports and a design that allows better (faster) performance.A bridge has filtering capability.

Random access

Random access:-It is also called contention method.In this method, stations compete for the medium. If two stations transmit data at the same time, then a collision
results—both stations then must determine when to retransmit data.

In this no station is superior to another station and
none is assigned the control over another.No station permits, or does not permit,another station to send. a station that has data to send uses a procedure
defined by the protocol to make a decision on whether or not to send.

If two station transmit data at the some time ,then a collision results,both station then must somehow determine when to transmit data,this decision depends on the state of the medium(idle or busy).

In this scheme, each stations must:-
•- Determine when to access the medium.
• -Determine what to do if the medium is busy.
• -Have some way of determining whether transmission succeeded or not.
•- Have some way of dealing with collisions (access conflicts with other stations).

Use of Data Link Layer

Use of Data Link Layer:-
i)Framing:-Group the physical layer bit stream into units called frames. so that each frame is distinguishable from another.
ii)Flow control:-It Ensuring the sending entity does not overwhelm
the receiving entity.Flow control. Prevent a fast sender from overwhelming a slower receiver.
iii)Error control :-It allows the receiver to inform the sender of any frames lost or damaged in transmission and coordinates the retransmission of those frames by the sender.
iv)Sender checksums the frame and sends checksum together with data. The checksum allows the receiver to determine when a frame has been damaged in transit.
vI)Receiver recomputes the checksum and compares it with the received value. If they differ, an error has occurred and the frame is discarded.
v)Medium Access Control (MAC):-It provide a link with reliable communication or there is a available dedicated link(channel) between the sender and receiver .

Physical Layer

Physical Layer:-The physical layer coordinates the functions required to carry a bit stream over a physical medium. It deals with the mechanical and electrical specifications of the interface and
transmission medium. It also defines the procedures and functions that physical devices and intertäces have to perturb tor transmission to Occur.
The physical layer is responsible for movements of
individual bits from one hop (node) to the next.
It's properties are:-
1.)Physical characteristics of interfaces and medium.:-The physical layer defines
the characteristics of the interface between the devices and the transmission
medium and type of transmission medium.
2.)Representation of bits.:-For transmission , bits must be encoded into signals—electrical or optical. The physical layer defines the type of encoding (how Os and 1s are changed to signals).
3.)Data rate. :-The transmission rate—the number of bits sent each second—is also
defined by the physical layer.
4.)Synchronization of bits:-the sender and
the receiver clocks must be synchronized.
5.)Line configuration.
6.)Physical topology:-how network are connected.
7.)Transmission mode:-It also define the direction of transmission.

Physical Topology

Physical Topology:--
The term physical topology refers to the way in which a network is laid out physically..
Two or more device connect (0 a link, two or more links form a topology. The topology--

1.)Mesh:- In a mesh topology, every device has a dedicated point-to-point link to every
other device. The term dedicated means that the link carries traffic only between the
two devices it connects.
for n nodes-we need
n(n—l)/2
duplex-mode links.

*advantages over other network topologies.:---
1.)It uses dedicated links so guarantees that each connection can carry its own data load,so eliminating the traffic problems.
2.)a mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire system.
3.)privacy or security. When every
message travels along a dedicated line, only the intended recipient sees it.
4.)fault identification and fault isolation is easy.

*disadvantage:-
1)the amount of cabling and the
number of i/o ports required.
2.) the hardware required to connect each link (I/O ports and cable) can be
prohibitively expensive. For these reasons a mesh topology is usually implemented in a
limited fashion.

2.)Star Topology :-In a star topology, each device has a dedicated point-to-point link
only to a central controller, usually called a huh. Thc devices arc not directly linked to
one another. Unlike a mesh topology, a star topology does not allow direct traffic
between devices. The controller acts as an exchange: If one device wants to send data to
another, it sends the data to the controller, which then relays the data to the other connected device .

advantage:-1.)A star topology is less expensive than a mesh topology. In a star, each device needs
only one link and one I/O port to connect it to any number of others.
2)it easy to install and reconfigure.
3.)robustness
4.)If one link fails, only that link is affected. All
other links remain active.so easy fault identification and fault isolation.

disadvantage:-
1.)dependency of the whole topology
on one single point, the huh. If the huh goes down, the whole system is dead.
2.)star requires far less cable than a mesh, each node must be linked to a
central hub. For this reason. often more cabling is required in a star.

3.) Bus Topology :-The preceding examples all describe point-to--point connections. A bus
topology, on the other hand, is multi-point. One long cable acts as a backbone to link all
the devices in a network.

Nodes are connected to the bus cable by drop lines and taps.
Advantages:-
1.) easy of installation.
2.)Due to Backbone , bus uses less cabling than mesh or star topologies. In a star, for
example, four network devices in the same room require four lengths of cable .

Disadvantages :-1.) difficult reconnection and fault isolation.
2.)difficult to add new
devices.
3.)Signal reflection at the taps can cause degradation . This degradation
can be controlled by limiting the number and spacing of devices connected to a given
length of cable.Adding new devices may therefore require modification or replacement
of the backbone.
4.)fault or break in the bus cable stops all Transmission.The damaged area reflects signals back in the
direction of origin, creating noise in both directions.

4.)Ring Topology-- In a ring topology, each device has a dedicated point-to-point connection
with only the two devices on either side of it. A signal is passed along the ring
in one direction, from device to device, until it reaches its destination. Each device in
the ring incorporates a repeater. When a device receives a signal intended for another
device, its repeater regenerates the bits and passes them along.

adv-A ring is relatively easy to install and reconfigure.To add or delete a device requires
changing only two connections.a signal is circulating at all times. If one device does not
receive a signal within a specified period, it can issue an alarm. The alarm alerts the
network operator to the problem and its location.

disad-unidirectional traffic can be a disadvantage.a break in
the ring (such as a disabled station) can disable the entire network. This



Thursday, December 15, 2011

Network Criteria

* NETWORKS:-A network is a combination of hardware and software that sends data from one location
to another. The hardware consists of the physical equipment that carries signals from
one point of the network to another. The software consists of instruction sets that make
possible the services that we expect from a network.
A network is a set of devices ( nodes) connected by communication
links. A node can be a computer, printer, or any other device capable of sending and/or
receiving data generated by other nodes on the network.

*Network Criteria:-A network must he able to meet a certain number of criteria. The most important of
these are performance, reliability, and security.---
1)Performance:-Performance can be measured in many ways, including transit time and response time.
Transit time is the amount of time required for a message to travel from one device to another.
2.)Reliability:-network reliability is measured by the frequency of
failure, the time it takes a link to recover fron a failure, and the networks robustness in
a catastrophe.
3.)Security:-Network security issues include protecting data from unauthorized access. protecting
dat,a from damage.

Type of connection

Type of connection :--
1.)Point-to-Point A point-to-point connection provides a dedicated link between two
devices. The entire capacity of the link is reserved for transmission between those two
devices.
2.)Multipoint:-A multipoint (also called multidrop) connection is one in which more
than two speciIic devices share a single link (see Figure 1.3h).
In a multipoint environment, the capacity of the channel is shared, either spatially
or temporally. If several devices can use the link simultaneously, it is a spatially shared
connection.

Data communications

Data communications:-Data communications are the exchange of data between two devices via some
form of transmission medium such as a wire cable. For data communications to occur,
the communicating device; must be part of a communication system made up of a combination of hardware (physical equipment) and( software (programs). The effectiveness
of a data communications system depends on four fundamental characteristics: delivery. accuracy, nmeimess, and jitter.
i)Delivery. -The system must deliver data to the correct destination. Data must be
received by the intended device or ricer and only by that derive or user
2. Accuracy. -The system must deliver the data accurately. Data that have been
altered in transmission and left uncorrected are unusable.
3. Timeliness- The system must deliver data in a timely manner. Data delivered late are
useless.
4)Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in
the delivery of audio a video packets.

Group cohesiveness and cohesion

Group cohesiveness -

A group is said to be in a state of cohesion when its members possess bonds linking them to one another and to the group as a whole. According to Festinger, Schachter, and Back (1950), group cohesion was believed to develop from a field of binding social forces that act on members to stay in the group. Cohesiveness is a measure of the attraction of the group to its members (and the resistance to leaving it), the sense of team spirit, and the willingness of its members to coordinate their efforts.

A group may be cohesive if : -

1. Its members have positive feelings towards one another (individual-level attraction),
2. Its members have positive feelings towards the group (group-level attraction), or
3. Its members have positive feelings towards other members and the group as a whole.

According to Hogg (1992), group cohesiveness typically develops from a depersonalized attraction to group members based on their status as group members, rather than a personal attraction based on specific relationships. In addition to group cohesion, this depersonalized form of attraction has also been linked to membership stability.

Other theorists stress that cohesion comes from group members’ commitment to work together to complete their shared tasks and accomplish their collective goals.

* Consequences of group cohesion -

Group cohesion has been linked to a range of positive and negative consequences. Firstly, members of cohesive groups tend to communicate with one another in a more positive fashion than noncohesive groups. As a result, members of cohesive groups often report higher levels of satisfaction and lower levels of anxiety and tension than members of noncohesive groups.

Secondly, group cohesion has been linked to enhanced group performance in non-laboratory-based groups. This bi-directional relationship is strongest when the members of a group are committed to the group’s tasks.

Membership in a cohesive group can also prove problematic for members. As cohesion increases, the internal dynamics (e.g., emotional and social processes) of the group intensify. As a result, people in cohesive groups are confronted with powerful pressures to conform to the group’s goals, norms, and decisions. In many instances these pressures to conform are so great that members suffer from groupthink. Individuals who refuse to yield to the ways of the majority are typically met with additional negative consequences, including hostility, exclusion, and scapegoating. Furthermore, group cohesion can trigger distress and maladaptive behavior in members following changes to the structure of the group.

Group Dynamics

Group Dynamics -

A group can be defined as several individuals who come together to accomplish a particular task or goal. Group dynamics refers to the attitudinal and behavioral characteristics of a group. Group dynamics concern how groups form, their structure and process, and how they function. Group dynamics are relevant in both formal and informal groups of all types. In an organizational setting, groups are a very common organizational entity and the study of groups and group dynamics is an important area of study in organizational behavior.

Group Dynamics is typically oriented with group study and its processes. A group is two or more individuals are connected to each other by social relationships. They interact and influence with each other, groups always develop a number of dynamic processes that separates them from a collection of individuals.

GROUP MEMBER RESOURCES

GROUP MEMBER RESOURCES--

A group’s potential level of performance is, to a large extent, dependent on the
resources that its members individually bring to the group.
a.Abilities--Set the parameters for what members can do and how effectively they will perform in a group.
b.Personality Characteristics--The magnitude of the effect of any single Characteristic is small, but
taking personality characteristics together, the consequences for group
behaviour are of major significance.

GROUP ROLES

GROUP ROLES - In formal groups, roles are usually predetermined and assigned to members. Each role will have specific responsibilities and duties. There are, however, emergent roles that develop naturally to meet the needs of the groups. These emergent roles will often replace the assigned roles as individuals begin to express themselves and become more assertive. Group roles can then be classified into work roles, maintenance roles, and blocking roles.

*Work roles are task-oriented activities that involve accomplishing the group's goals. They involve a variety of specific roles such as initiator, informer, clarifier, summarizer, and reality tester.

*Maintenance roles are social-emotional activities that help members maintain their involvement in the group and raise their personal commitment to the group. The maintenance roles are harmonizer, gatekeeper, consensus tester, encourager, and compromiser.

*Blocking roles are activities that disrupt the group. They make take the form of dominating discussions, verbally attacking other group members, and distracting the group with trivial information or unnecessary humor. Often times the blocking behavior may not be intended as negative. Sometimes a member may share a joke in order to break the tension, or may question a decision in order to force group members to rethink the issue. The blocking roles are aggressor, blocker, dominator, comedian, and avoidance behavior. The aggressor criticizes members' values and makes jokes in a sarcastic or semi-concealed manner.

Group

Group -

1. A collection of individuals who have regular contact and frequent interaction, mutual influence, common feeling of camaraderie, and who work together to achieve a common set of goals.

A number of people or things that are located close together or are considered or classed together.

GROUP STRUCTURE - Group structure is a pattern of relationships among members that hold the group together and help it achieve assigned goals. Structure can be described in a variety of ways. Among the more common considerations are group size, group roles, group norms, and group cohesiveness.

GROUP SIZE - Group size can vary from 2 people to a very large number of people. Small groups of two to ten are thought to be more effective because each member has ample opportunity to participate and become actively involved in the group. Large groups may waste time by deciding on processes and trying to decide who should participate next. Group size will affect not only participation but satisfaction as well. Evidence supports the notion that as the size of the group increases, satisfaction increases up to a certain point. In other words, a group of six members has twice as many opportunities for interaction and participation as a group of three people. Beyond 10 or 12 members, increasing the size of the group results in decreased satisfaction. It is increasingly difficult for members of large groups to identify with one another and experience cohesion.
 

Taylor's 4 Principles of Scientific Management

Taylor's 4 Principles of Scientific Management
After years of various experiments to determine optimal work methods, Taylor proposed the following four principles of scientific management:

Replace rule-of-thumb work methods with methods based on a scientific study of the tasks.
Scientifically select, train, and develop each worker rather than passively leaving them to train themselves.
Cooperate with the workers to ensure that the scientifically developed methods are being followed.
Divide work nearly equally between managers and workers, so that the managers apply scientific management principles to planning the work and the workers actually perform the tasks.
These principles were implemented in many factories, often increasing productivity by a factor of three or more. Henry Ford applied Taylor's principles in his automobile factories, and families even began to perform their household tasks based on the results of time and motion studies.

Types of groups

Types of groups -

There are various ways of classifying groups, for example in terms of their purpose or structure, but two sets of categories have retained their usefulness for both practitioners and researchers. They involve the distinctions between:

• primary and secondary groups; and

• planned and emergent groups.

Primary and secondary groups

Charles Horton Cooley (1909) established the distinction between 'primary groups' and 'nucleated groups' (now better known as secondary groups):

*Primary groups are clusters of people like families or close friendship circles where there is close, face-to-face and intimate interaction. There is also often a high level of interdependence between members. Primary groups are also the key means of socialization in society, the main place where attitudes, values and orientations are developed and sustained.

*Secondary groups are those in which members are rarely, if ever, all in direct contact. They are often large and usually formally organized. Trades unions and membership organizations such as the National Trust are examples of these. They are an important place for socialization, but secondary to primary groups.
Planned and emergent groups

Alongside discussion of primary and secondary groups, came the recognition that groups tend to fall into one of two broad categories:

*Planned groups. Planned groups are specifically formed for some purpose – either by their members, or by some external individual, group or organization.

*Emergent groups. Emergent groups come into being relatively spontaneously where people find themselves together in the same place, or where the same collection of people gradually come to know each other through conversation and interaction over a period of time.

Types of plans

Types of plans:
A)Objectives:-Objectives or goals are the end which towards the activity is aimed.The process of objective setting is directed by management and it is the first step in planning

B)Purpose of missions:-The mission or purpose identifies the basic function or task of an enterprise or agency .Every kind of organized operation has ,or at least should have a purpose or mission .for ex the purpose of a business is the production and distribution of goals and services.

c)POLICIES:-Policies are guide to action. They include how resources are to be allocated and how tasks assigned to the organization might be accomplished .
Policies define a area within which a decision is to be made and ensure tat the decision will be consistent with and contribute to ,an objective.Plicies help decide issuses before they become problems ,make it unneccery to analyze the same situation every time it come up and unify other plans
•Policies are general statements or understanding which provides guidance in decision making of the subordinate.

D)STRATEGIES--A strategy is a unified, comprehensive, and integrated plan that relates the strategic advantages of the firm to the challenges of the environment. It is designed to ensure that the basic objectives of the enterprise are achieved through proper execution by the organization" (William F. Glueck, and Lawrence R. Jauch). The role of strategy is to identify the general approaches that the organization utilize to achieve its organizational objectives.
•Strategies are the complex of plans for bringing the organization from a given posture to a desired position in thefuture period of time.

E)PROCEDURES:-It Prescribe the manner or method by which the work is to be performed and Specific tasks, time to perform, persons who will perform.Procedures are plans in that they establish a method for handling future activities.Procedure explains how each of its tasks will take place and by whom it is to be performed.

Once the procedure is established, this can be used over and over again.
F)Rules:-–a decision made by the management regarding what is to be done and what is not to be done in a given situation.

What is the Purpose of Organizational Structure?

What is the Purpose of Organizational Structure?---
The purpose of an organizational structure is to define the guidelines, parameters and the procedural process necessary for a group to accomplish a main objective.
An organizational structure organizes priorities hierarchically by means of identifying tasks critical to a group realizing an end goal.It's primary purpose is facilitating the achievement of organizational goals in an efficient manner.
a)Distribution of Authority:-Determining how an organizational structure distributes tasks involves identifying if the structure will adopt a decentralized strategy .
b)Span-of-Control:-Span-of-control portion of an organizational structure defines the amount of employees an authority figure is responsible for.The span-of-control is expressed one of two ways: a wide span of control where managers supervise many employees; a narrow span of control where managers supervise few employees.
c)Line vs. Staff Structures:-An organizational structure may adopt a live structure or a staff structure or both to achieve their main objectives.Line structure identifies the activities directly responsible for the organization's main goal, such as the labor involved in making an actually product. A staff structure is the support staff or network assisting the line structures in their goals.
d)Organizational Height:-Organizational height defines how many levels or layers from the decision makers and down there are. Organizational height is expressed as tall organizations with many levels or flat organizations with few levels.
c)Departmentalization:-It determine, categorize, and organize the variety of tasks to be accomplished when achieving a main goal and decide how to separate specific tasks from others.

Systems Approach to Management

Systems Approach to Management--It coordinative relations between all related business systems.
The systems approach to management is a concept which views a company as an interconnected purposive system that consists of several business sections. It is a management approach which enables the leadership to see the company as a unified part or a major section of the larger outside corporate environment. Even a small activity in a part has a substantial effect on other sections in the company. Such a system may be biological, physical or social; and may enable the management to efficiently determine the long-term goals of the company.
* Contributions of Systems Approach To Management :-
Under systems approach, managers have a good view of the organisation.
It gives importance to interdependence of the different parts of an organisation and its environment.
It foretastes consequences and plans actions.
Systems thinking warns managers against adopting piecemeal approach to the problem-solving.

WHY DO PEOPLE WORK IN GROUPS

WHY DO PEOPLE WORK IN GROUPS ?
1.Security--By joining a group, individuals can reduce the insecurity of “standing
alone.” People feel stronger, have fewer self-doubts, and are more
resistant to threats when they are part of a group.
2.Status--Inclusion in a group that is viewed as important by others provides
recognition and status for its members.
3.Self-Esteem--Groups can provide people with feelings of self-worth. That is, in addition
to conveying status to those outside the group, membership can also
give increased feelings of worth to the group members themselves.
4.Power--What cannot be achieved individually often becomes possible through
group action. There is power in numbers.
5.Goal Achievement--There are times when it takes more than one person to accomplish a
particular task; there is a need to pool talents, knowledge, or power in
order to complete a job.

Role of Project Manger

Role of Project Manger -
A project manager is charged with the responsibility for managing a specific project.

In this context, his role is as follows:

1. A project manager is required to accomplish specific project that requires personnel outside his direct control.

2. The project manager acts as a focal point to permit the major project considerations, such as the determination of basic policy and making strategic decisions. Since, he has an overall view of the project, he has the perspective necessary to consider cost, performance and schedule aspects of the project.

3. The project manager acts as an integrator. He integrates the efforts of functional managers to

accomplish the goals of the project and the organization. As a unifying agent for the total management function, he has no line authority to act but depends upon other manifestations of authority to attain the objective.

4. In co-ordinating various professionals, the project manager's role requires the use of different management techniques than i simple superior-subordinate relationship. His techniques of motivation, persuasion, an control should be thoroughly suited to highly competent professionals.

MBO

MBO-(MBO) is a process of defining objectives within an organization so that management and employees agree to the objectives and understand what they need to do in the organization.

"The superior and subordinate managers of an organisation jointly define its common goals, define each individual's major areas of responsibility in terms of the results expected of them and use these measures as guides in operating the unit and assessing the contribution of each of its members."
Management by objectives (MBO) is a systematic and organized approach that allows management to focus on achievable goals and to attain the best possible results from available resources.
*Goals--It aims to increase organizational performance by aligning goals and subordinate objectives throughout the organization. employees get strong input to identify their objectives, time lines for completion, etc. MBO includes ongoing tracking and feedback in the process to reach objectives.
MBO --
-participate in the strategic planning process, in order to improve the implementability of the plan, and
-implement a range of performance systems, designed to help the organization stay on the right track.

*Main Principle--The principle behind Management by Objectives (MBO) is to make sure that everybody within the organization has a clear understanding of the aims, or objectives, of that organization, as well as awareness of their own roles and responsibilities in achieving those aims. The complete MBO system is to get managers and empowered employees acting to implement and achieve their plans, which automatically achieve those of the organization.

Management Thoughts

Management Thoughts -

*Classical Thought - The classical management thought emerged throughout the late 1800s and early 1900s as a result of the Industrial Revolution. Since the beginning of time, managers have needed to know how to perform the functions discussed earlier. The Industrial Revolution emphasized the importance of better management as organizations grew larger and more complex. As industry developed, managers had to develop systems for controlling inventory, production, scheduling, and human resources. It was the managers who emerged during the Industrial Revolution, many who had backgrounds in engineering, who discovered that they needed organized methods in order to find solutions to problems in the workplace.

*Classical management - In this, theorists thought there was one way to solve management problems in the industrial organization. Generally, their theories assumed that people could make logical and rational decisions while trying to maximize personal gains from their work situations. The classical school of management is based on scientific management which has its roots in Henri Fayol's work in France and the ideas of German sociologist Max Weber. Scientific management is a type of management that bases standards upon facts. The facts are gathered by observation, experimentation, or sound reasoning.

*Behavioral Management Thought - It was because the classical management theorists were so machine-oriented that the behavioralists began to develop their thinking. The behavioral managers began to view management from a social and psychological perspective. These managers were concerned about the well-being of the workers and wanted them to be treated as people, not a part of the machines.

In the behavioral management period, there was a human relations movement. Advocates of the human relations movement believed that if managers focused on employees rather than on workers would become more satisfied and thus more productive laborers. Human relations management supported the notion that managers should be paternalistic and nurturing in order to build work groups that could be productive and satisfied.

The behavioral science movement was also an important part of the behavioral management school. Advocates of this movement stressed the need for scientific studies of the human element of organizations. This model for management emphasized the need for employees to grow and develop in order to maintain a high level of self-respect and remain productive workers. The earliest advocates of the behavioral science movement were Abraham Maslow (1908-1970), who developed Maslow's hierarchy of needs, and Douglas McGregor (1906-1964), who developed Theory X and Theory Y. These theories are discussed in depth in other articles.

*Contemporary Management Thought - In more recent years, new management thoughts have emerged and influenced organizations. One of these is the sociotechnical system. A system is a set of elements that function as a unit for a specific purpose. Systems theorists believe that all parts of the organization must be related and that managers from each part must work together for the benefit of the organization. Because of this relationship, what happens in one part of the organization influences and affects other parts of the organization.Management Thought--
*Behavioral Management Thought - It was because the classical management theorists were so machine-oriented that the behavioralists began to develop their thinking. The behavioral managers began to view management from a social and psychological perspective. These managers were concerned about the well-being of the workers and wanted them to be treated as people, not a part of the machines.

In the behavioral management period, there was a human relations movement. Advocates of the human relations movement believed that if managers focused on employees rather than on workers would become more satisfied and thus more productive laborers. Human relations management supported the notion that managers should be paternalistic and nurturing in order to build work groups that could be productive and satisfied.

The behavioral science movement was also an important part of the behavioral management school. Advocates of this movement stressed the need for scientific studies of the human element of organizations. This model for management emphasized the need for employees to grow and develop in order to maintain a high level of self-respect and remain productive workers. The earliest advocates of the behavioral science movement were Abraham Maslow (1908-1970), who developed Maslow's hierarchy of needs, and Douglas McGregor (1906-1964), who developed Theory X and Theory Y. These theories are discussed in depth in other articles.


Role of Functional Manager

Role of Functional Manager  -
A functional manager is charged with managing a functional entity in support of the system of projects that are flowing through the organization -

In this context, the role of a functional manager is as follows:

1. A functional manager is responsible for one of the principle elements of the organization, such as production, marketing, finance, etc. He has to provide functional services in his disciplines and for supporting all; the projects in the organization.

2. The functional manger has line authority over this personnel in the project. He is responsible through the chain of command for his department. A functional manager tends to concentrate on the activities of his discipline.

3. Each functional manger tends to emphasize his own function. Sometimes, this tendency creates conflict in the organization. Since the responsibility of the functional manager is limited to his area, he seeks to make that area as efficient and effective as possible, often without regard to the effect of his function on others or on the basic task which the organization has to perform. 

Tuesday, December 13, 2011

FUNCTIONS OF MANAGEMENT

FUNCTIONS OF MANAGEMENT

Planning
*Look ahead and chart out future course of operation
*Formulation of Objectives, Policies, Procedure, Rules, Programmes and Budgets

Organising
*Bringing people together and tying them together in the pursuit of common objectives.
*Enumeration of activities, classification of activities, fittingindividuals into functions, assignment of authority for action.

Directing
*Act of guiding, overseeing and leading people.
*Motivation, leadership, decision making.

Controlling
*Laying standards, comparing actuals and correcting deviation-achieve objectives according to plans.

Co-ordination
*Synchronizing and unifying the actions of a group of people.

Monday, November 28, 2011

Function of Loader

A loader is a system program, which takes the object code of a program as input and prepares it for execution.

Loader Function : The loader performs the following functions :

1.)Allocation - The loader determines and allocates the required memory space for the program to execute properly.

2.)Linking -- The loader analyses and resolve the symbolic references made in the object modules.

3.)Relocation - The loader maps and relocates the address references to correspond to the newly allocated memory space during execution.

4.)Loading - The loader actually loads the machine code corresponding to the object modules into the allocated memory space and makes the program ready to execute.

Linking vs. loading

Linking vs. loading:- 1.)Program loading: Copy a program from secondary storage into main memory so it's ready to run.
Loading just involves copying the data from disk to memory, or it involves allocating storage, setting protection bits, or arranging for virtual memory to map virtual addresses to disk pages.
2.) Relocation:-Relocation is the process of assigning load addresses to the various parts of the program, adjusting the code and data in the program to reflect the assigned addresses.
If a program is created from multiple subprograms, all the subprograms have to be loaded at non-overlapping addresses.
Linker creates a program from multiple subprograms, and create one linked output program that starts at zero, with the various subprograms relocated to locations within the big program.
#)Linker is a program that takes one or more objects generated by a compiler and combines them into a single executable program.

#)Loader is the part of an operating system that is responsible for loading programs from executables (i.e., executable files) into memory, preparing them for execution and then executing them.

Linker

Linker :-Link editors are commonly known as linkers. a computer program that takes one or more objects generated by a compiler and combines them into a single executable program.or, a linker is a program that combines object modules to form an executable program.
Many programming languages allow to write different pieces of code, called modules, separately. This simplifies the programming task because we can break a large program into small, more manageable pieces. So,we need to put all the modules together. This is done by linker.A linker also replaces symbolic addresses with real addresses.

Header file

header file:- the c standard library contains files containing the function .these files are known as header file .Heaedr file provide function prototype ,definition for library function .Data tpe and constants used with the library function are also defined on them .
Some of these are :-
1.stdio.h:-this header file define type and macro needed for the standard i/o package .this defin i/o predefined stream e.g. stdin,stdout ,stderr.
2.string.h:- this header file declare several string manipulation and memory manipulation routine .the function are-
memccpy,stdcp,strtok.
3.math.h:- this header file declar prototype for the math function and math handlers .The routine in math.h file perform mathematical calculation and conversion.
4. stdlib.h:-this header file file declare several commonly used routine like conversion routine ,search routine .

Macro definition or Expansion

• Macro definition consists of
i) macro prototype ii) one of more model iii) macro preprocessor
• Macro definition is in between a macro header statement and a macro e statement.
• Syntax of macro prototype statement < macro name> [ < formal parameter spec> [; ... ]] where < macro name> = It is in the mnemonic field of an assembly statement < formal parameter spec > is in the following form < parameter name > [ < parameter kind > ]
• Syntax of the macro call is < macro name> [ < actual parameter spec> [; ... ]]

Macro Expansion:-
• Macro call leads to macro expansion.
• Macro call statement is replaced by a sequence of assembly statement in macro expansion.
• Two key notions are used in macro expansion
a)Expansion time control flow
b)Lexical substitution
• Algorithm for macro expansion

Difference in External or Internal commands of DOS

The internal commands reside in COMMAND.COM, which loads into memory when the computer system is started; these commands do not reside on disk. It has 1 of the major file command.com that loads when you boot system in dos.dir, date, etc are internal command i.e. part of command.com and is already loaded in memory and can be executed any time when you are using dos system.
The external commands are files that do reside on disk and have an extension of .COM, .EXE, or .BAT. format, fdisk are external command. They are in form of separate files (format.exe, fdisk.com etc) and if you don't have this files, you cannot execute this commands.
Both command types are executed from the MS-DOS prompt.

Difference between one pass and two pass assemblers

The difference between one pass and two pass assemblers are:-
A one pass assembler passes over the source file exactly once, in the same pass collecting the labels, resolving future references and doing the actual assembly. The difficult part is to resolve future label references and assemble code in one pass.
A two pass assembler does two passes over the source file ( the second pass can be over a file generated in the first pass ). In the first pass all it does is looks for label definitions and introduces them in the symbol table. In the second pass, after the symbol table is complete, it does the actual assembly by translating the operations and so on.

Device driver

Device driver:-A device driver is a program that controls a particular type of device that is attached to the computer. Device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device.
A driver typically communicates with the device through the computer bus or communications subsystem to which the hardware connects.There are device drivers for printers, displays, CD-ROM readers, diskette drives, and so on.
A device driver essentially converts the more general input/output instructions of the operating system to messages that the device type can understand.
For example, all printers come accompanied with drivers to install that tell the operating system exactly how to print information on the page.

Debugger

Debugger:-A debugger or debugging tool is a computer program that is used to test and debug other programs .
In writing the program certain errors ,called bugs ,can occur in the program.This cause to not function as the original output .Sometimes these errors are easy to fix, while some bugs are very difficult to trace.So we use a program called debugger.
Debuggers help software developers find and eliminate bugs while they are writing programs. A debugger tells the programmer what types of errors it finds and often marks the exact lines of code where the bugs are found.
Debuggers also allow programmers to run a program step by step so that they can determine exactly when and why a program error occur.
Function performed by debugger:
1.)What statement or expression was the program executing at the time of a fatal error?
2.)If a fatal error occurs while executing a function, what line of the program contains the call to
that function?
3.)What are the values of program variables (including parameters) at a particular point during
execution of the program?
4.)What is the result of evaluating a particular expression at some point in the program?
5.)What is the sequence of statements actually executed in a program?

CPU parts

The CPU has two main parts.
1. The Control Unit.
2. Arithmetic Logic Unit.
The parts of the CPU are usually connected by an electronic component referred to as a Bus, which acts as an electronic highway between them. The CPU has special purpose storage devices called registers, helps in storing data and instructions.
1. Control Unit: It is responsible for directing and coordinating most of the computer system activities. It does not execute instructions by itself. It tells other parts of the computer system what to do. It determines the movement of electronic signals between the main memory and arithmetic logic unit as well as the control signals between the CPU and input/output devices.
2. Arithmetic logic Unit: ALU performs all the arithmetic and logical functions i.e. addition, subtraction, multiplication, division and certain comparisons. These comparisons include greater than, less than, equals to etc. The ALU controls the speed of calculations.
3. Registers: It is a special temporary storage location within the CPU. Registers quickly, accept, store and transfer data and instructions that are being used immediately (main memory hold data that will be used shortly, secondary storage holds data that will be used later). To execute an instruction, the control unit of the CPU retrieves it from main memory and places it onto a register. The typical operations that take place in the processing of instruction are part of the instruction cycle or execution cycle. The instruction cycle refers to the retrieval of the instruction from main memory and its subsequence at decoding. The process of alerting the circuits in CPU to perform the specified operation. The time it takes to go through the instruction cycle is referred to as I-time.

4. Bus: The term Bus refers to an electrical pathway through which bits are transmitted between the various computer components. Depending on the design of the system, several types of buses may be present. The most important one is the data bus, which carries the data through out the central processing unit. The wider the data bus, the more data it can carry at one time and thus the greater the processing speed of the computer.

C compiler preprocessors

C compiler preprocessors:-Preprocessor commands are executed before the compiler compiles the source code.
#include preprocessor directive
• causes a copy of a specified file to be
included in place of the directive
• Two versions:
– #include “filename”
preprocessor searches in the same directory as
the file being compiled for the file to be
included
– #include <filename>
used for standard library header files, the
search normally performed through predesignated
directories
2
7
#define preprocessor directive
• creates symbolic constants and
macros.
ex- #define PI 3.14159
identifier replacement-text
replaces all subsequent occurrences of the
symbolic constant PI with the numeric
constant 3.14159.

#include :-insert a source file.
#define :-Define a preprocessor constant.
#if :-Branch based on an expression.
#ifdef :-Branch if preprocessor constant has been defined?
#ifndef :-Branch is a preprocessor constant has NOT been defined.
#line :-Specify the number of the next source line.
#undef :-Remove a preprocessor constant.
#pragma:-Perform an implementation dependent action???
#else :-Executed if #if #ifdef or #ifndef fails.
#error :-Write an error message.
#elif :-Executed when an #if fails.
#endif :-Close #if #ifdef or #ifndef

Components of computer

Components of computer are :-
1.)Input Unit:
Computers need to receive data and instruction in order to solve any problem. Therefore we need to input the data and instructions into the computers. The input unit consists of one or more input devices. Keyboard is the one of the most commonly used input device. Other commonly used input devices are the mouse, floppy disk drive, magnetic tape, etc. All the input devices perform the following functions.
a.)Accept the data and instructions from the outside world.
b.)Convert it to a form that the computer can understand.
c.)Supply the converted data to the computer system for further processing.

2.)Storage Unit:
The storage unit of the computer holds data and instructions that are entered through the input unit, before they are processed.
1. Primary Storage: Stores and provides very fast. This memory is generally used to hold the program being currently executed in the computer, the data being received from the input unit, the intermediate and final results of the program. The primary memory is temporary in nature. The data is lost, when the computer is switched off. In order to store the data permanently, the data has to be transferred to the secondary memory.
2. Secondary Storage:-The programs that we run on the computer are first transferred to the primary memory before it is actually run. Whenever the results are saved, again they get stored in the secondary memory. The secondary memory is slower and cheaper than the primary memory. Some of the commonly used secondary memory devices are Hard disk, CD, etc.
3.)Output Unit:
The output unit of a computer provides the information and results of a computation .
Printers, Visual Display Unit (VDU) ,monitor are the o/p unit.
4.)Arithmetic Logical Unit:-All calculations are performed in the Arithmetic Logic Unit (ALU) of the computer. It also does comparison and takes decision. The ALU can perform basic operations such as addition, subtraction, multiplication, division, etc and does logic operations viz, >, <, =, ‘etc. Whenever calculations are required, the control unit transfers the data from storage unit to ALU once the computations are done, the results are transferred to the storage unit by the control unit and then it is send to the output unit for displaying results.
4.)Control Unit:
It controls all other units in the computer. The control unit instructs the input unit, where to store the data after receiving it from the user. It controls the flow of data and instructions from the storage unit to ALU. It also controls the flow of results from the ALU to the storage unit. The control unit is generally referred as the central nervous system of the computer that control and synchronizes its working.
5.)CPU (Central Processing Unit):-The processor or CPU controls the computer.
This makes your computer run. it executes instructions and transports data round the computer system.
The control unit and ALU of the computer are together known as the Central Processing Unit (CPU). The CPU is like brain performs the following functions:
• It performs all calculations.
• It takes all decisions.
• It controls all units of the computer.

Task of compiler

Software that converts a set of high-level language statements into a lower-level representation.
or, A compiler is a computer program that transforms human readable source code of another computer program into the machine readable code that a CPU can execute.
A compiler usually generates assembly language first and then translates the assembly language into machine language. A utility known as a "linker" then combines all required machine language modules into an executable program that can run in the computer.

The act of transforming source code into machine code is called "compilation".

Task of compiler:-The most important task is to translate the code into machine code. The computer itself cannot understand C++ or Java or any other high level language. The task of compilers and interpreters is to translate the programming language into a language the computer understands and can execute.

Differences between .cmd and .bat

Differences between .cmd and .bat execution in the Windows NT family

The only known difference between .cmd and .bat file execution is that in a .cmd file the ERRORLEVEL variable changes even on a successful command that is affected by Command Extensions (when Command Extensions are enabled), whereas in .bat files the ERRORLEVEL variable changes only upon errors.

Bitwise operation

A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits.
NOT:-The bitwise NOT, or complement, is a unary operation that performs logical negation on each bit, forming the ones' complement of the given binary value.
NOT 0111 (decimal 7)
= 1000 (decimal 8)
The ~ (tilde) operator performs a bitwise complement on its single integer operand.
OR:-A bitwise OR takes two bit patterns of equal length, and produces another one of the same length by matching up corresponding bits .
0101 (decimal 5)
OR 0011 (decimal 3)
= 0111 (decimal 7)
The | (vertical bar) operator performs a bitwise OR on two integers.
The bitwise OR may be used in situations where a set of bits are used as flags;

XOR:-A bitwise exclusive or takes two bit patterns of equal length and performs the logical XOR operation on each pair of corresponding bits. The result in each position is 1 if the two bits are different, and 0 if they are the same. For example:
0101 (decimal 5)
XOR 0011 (decimal 3)
= 0110 (decimal 6)
The ^ (caret) operator performs a bitwise exclusive-OR on two integers.
0 1 0 1 0 1 1 0
^ 0 0 1 1 0 0 1 0
---------------
0 1 1 0 0 1 0 0
Bit shift:-
The << operator shifts its first operand left by a number of bits given by its second operand, filling in new 0 bits at the right.
The >> operator shifts its first operand right. If the first operand is unsigned, >> fills in 0 bits from the left, but if the first operand is signed, >> might fill in 1 bits if the high-order bit was already 1.
For example, 0x56 << 2 is 0x158:
0 1 0 1 0 1 1 0 << 2-------------------
0 1 0 1 0 1 1 0 0 0
And 0x56 >> 1 is 0x2b:
0 1 0 1 0 1 1 0 >> 1
---------------
0 1 0 1 0 1 1
AND:-A bitwise AND takes two binary representations of equal length and performs the logical AND operation on each pair of corresponding bits.
the result is 1 if the first bit is 1 AND the second bit is 1. Otherwise, the result is 0. For example:
0101 (decimal 5)
AND 0011 (decimal 3)
= 0001 (decimal 1)
The & operator performs a bitwise AND on two integers.
0 1 0 1 0 1 1 0
& 0 0 1 1 0 0 1 0 --------------
0 0 0 1 0 0 1 0

Bit shifts or bitwise operations

Bit shifts:-The bit shifts are sometimes considered bitwise operations, since they operate on the binary representation of an integer instead of its numerical value;
The bit shifts operators are used to perform bitwise operations on the binary representation of an integer instead of its numerical value.

Sign Bit:-A sign bit is found in the left most position of the number and is know as most significant bit (MSB) which indicates the status of a number i.e. the number is positive or negative. If the value of the sign bit is 0 then the number is positive; otherwise the number is negative, if the value of the sign bit is 1.
I. Signed Left Shift ("<<") :-The signed left shift ("<<") operator shifts a bit (or bits) to the left by the distance specified in the right operand.
II. Signed Right Shift (">>") :-The signed right shift (">>") operator shifts a bit (or bits) to the right by the distance specified in the right operand and fills the left most bit by the sign bit.

III. Unsigned Right Shift (">>>"):-The unsigned right shift (">>>") operator behave like the signed right shift operator. i.e. it shifts a bit (or bits) to the right. But unlike ">>" operator, this operator always shifts zeros into the leftmost position by the distance specified in the right operand. So the result of applying the >>>operator is always positive.

For example, the expression "14>>>2"; shifts all bits of the number 14 to the right placing a zero to the left for each blank place Thus the value 1110 becomes 0011 or 3 in decimal.

Batch file

A batch file is a text file that contains a sequence of commands for a computer operating system. It's called a batch file because it batches (bundles or packages) into a single file a set of commands that would otherwise have to be presented to the system interactively from a keyboard one at a time. A batch file is usually created for command sequences for which a user has a repeated need. Commonly needed batch files are often delivered as part of an operating system.
a batch file is a text file containing a series of commands intended to be executed by the command interpreter.

In the Disk Operating System (DOS), a batch file has the file name extension ".BAT". (The best known DOS batch file is the AUTOEXEC.BAT file that initializes DOS when you start the system.) In UNIX-based operating systems, a batch file is called a shell script. In IBM's mainframe VM operating systems, it's called an EXEC.

Array and Pointer and Difference

*pointer of array:-All the variables can be manipulated in the memory by their addresses. CPU uses these addresses to fetch them, change them and save them. So, all variables have an address (not only those that you pointed to them). We can find out the address of a variable by (&) operator, in form of:
1.int* ptr=&intvar

array of pointer:-
An array is just a sequence of variables.

Differences:

1) A pointer is a place in memory that keeps address of another place inside, while an array is a single, preallocated chunk of contiguous elements (all of the same type), fixed in size and location.

2) Array like pointers can't be initialized at definition like arrays.
char car[3]={'a','b',66};
char* cpt=new char[3];

3) When we allocate memory for a pointer to use it as a dynamic array. The memory can be resized or freed later. But this is not the case for arrays.

For example:
char* pta=new char[12];
4.)Pointers are used to manipulate data using the address. Pointers use * operator to access the data pointed to by them.Arrays use subscripted variables to access and manipulate data.Array variables can be equivalently written using pointer expression.