Friday, 1 June 2012

PROGRAM TO SWAP 2 VALUES USING POINTER


#include<stdio.h>
#include<conio.h>
void main()
            {
            int a,b,*p,*q,t;
            clrscr();
            printf("Enter the values of A and B: ");
            scanf("%d%d",&a,&b);
            printf("\nA=%d\nB=%d",a,b);
            p=&a;
            q=&b;
            t=*p;
            *p=*q;
            *q=t;
            printf("\n\nSwapped numbers \n");
            printf("\nA=%d\nB=%d",a,b);
            getch();
            }


OutPut
  ---------
Enter the values of A and B: 2 5

A=8
B=3

Swapped numbers

A=3
B=8

Tuesday, 29 May 2012

BSNL 4g- Wimax

BSNL broadband offers its new BSNL Wimax plan for wireless connectivity of internet. The BSNL WiMax network plan is capable of providing internet speed around 33 mbps.






For Tariff Details.....http://www.kerala.bsnl.co.in/Wimax/wimaxtariff61010.pdf

Monday, 21 May 2012

C-PROGRAM TO PRINT THE SALARY SHEET


#include<stdio.h>
#include<conio.h>
struct employ
            {
            char name[20];
            int id,bp;
            float tot,hra,dr;
            };
void main()
            {
            struct employ list[20],temp;
            char name[30];
            int n,i,j,m;
            clrscr();
            printf("Enter the number of employees: ");
            scanf("%d",&n);
            for(i=0;i<n;i++)
                        {
                        printf("\nEnter the name of employee: ");
                        scanf("%s",list[i].name);
                        printf("\nEnter id number: ");
                        scanf("%d",&list[i].id);
                        printf("\nEnter the basic pay: ");
                        scanf("%d",&list[i].bp);
                        list[i].dr=.2*list[i].bp;
                        list[i].hra=.6*list[i].bp;
                        list[i].tot=list[i].dr +list[i].hra+list[i].bp;
                        }
            for(i=0;i<n;i++)
                        {
                        for(j=0;j<n-i-1;j++)
                                    {
                                    if(strcmp(list[j].name,list[j+1].name)>0)
                                                {
                                                temp=list[j];
                                                list[j]=list[j+1];
                                                list[j+1]=temp;
                                                }
                                    }
                        }
            printf("Salary Sheet is\n");
            printf("NAME   ID NO   BASIC PAY   SALARY\n\n");
            for(i=0;i<n;i++)
                        printf("%s\t%d\t%d\t%f\n",list[i].name,list[i].id,list[i].bp,list[i].tot);
            getch();
            }


/* OutPut
   ---------
Enter the number of employees:2
Enter the name of employee: manu
Enter id number: 101
Enter the basic pay: 4000
Enter the name of employee: mani
Enter id number: 201
Enter the basic pay: 6000 
 
Salary Sheet is
NAME   ID NO   BASIC PAY   SALARY

mani    201     6000    10800.000
manu    101     4000    7200.000

Thursday, 22 March 2012

Floppy Disk-Types and Working


FLOPPY DISK



A soft magnetic disk. It is called floppy because it flops if you wave it (at least, the 5??-inch variety does). Unlike most hard disks, floppy disks (often called floppies or diskettes) are portable, because you can remove them from a disk drive. Disk drives for floppy disks are called floppy drives. Floppy disks are slower to access than hard disks and have less storage capacity, but they are much less expensive. And most importantly, they are portable. Floppy disk are the media used to read and write data is a floppy drive. A floppy is made up of a circular thin Mylar plastic material coated with magnetic particles. Every magnetic particles holds one data bit. The polarity of magnetic orientation will be opposite for 0 or 1,it is difficult to demagnetize a magnetic particle. However, the polarity can be reversed. The medium is permeable having high retentivity. Higher the retentivity, longer the life of information stored. The Mylar disk is enclosed in a plastic jacket to protect its surface. While floppy disk drives still have some limited uses, especially with legacy industrial computer equipment, they have been superseded by data storage methods with much greater capacity, such as USB flash drives, portable external hard disk drives, optical discs, memory cards, and computer networks.




Fig: A Floppy Disk.


Construction and Operation:

 While floppy disk drives vary in terms of size and the format of data that they hold, they are all internally quite similar. In terms of construction and operation, floppy drives are similar to hard disk drives, only simpler. Of course, unlike hard disks, floppy disk drives use removable floppy media instead of integrated storage platters. This section takes a look at the basic components and physical operation of a floppy disk drive.


Read/Write Heads:

       The read/write heads on the floppy disk are used to convert binary data to electromagnetic pulses, when writing to the disk, or the reverse, when reading. This is similar to what the heads on a hard disk do. There are several important differences between floppy disk and hard disk read/write heads. One is that floppy disk heads are larger and much less precise than hard disk heads, because the track density of a floppy disk is much lower than that of a hard disk. The tracks are laid down with much less precision; in general, the technology is more "primitive". Hard disks have a track density of thousands of tracks per inch, while floppy disks have a track density of 135 tracks per inch or less.

Head Actuator:

           The  head actuator is the device that physically positions the read/write heads over the correct track on the surface of the disk. Floppy disks generally contain 80 tracks per side. The actuator is driven by a stepper motor.
Spindle Motor:

         The spindle motor on the floppy is what spins the floppy disk when it is in the drive. When the disk is inserted, clamps come down on the middle of the disk to physically grasp it. These clamps are attached to the spindle motor, which turns the disk as it spins.

Logic Board:

           The floppy disk contains an integrated logic board that acts as the drive controller. Like the rest of the floppy disk this is a relatively simple affair, containing the electronics that control the read/write heads, the spindle motor, head actuator and other components. The circuits on this board also talk to the floppy disk controller over the floppy interface.

Classification of floppy disks

According to the size, floppy disks are generally classified into two:
•             5 1⁄4-inch diskette
•             3 1⁄2-inch diskette
Separate drives are used for these 2 types of diskettes.



5 1⁄4-inch floppy disks:
       This disk has their apertures; the central circular aperture is to allow the diskette to be located on the hub of the spindle motor, which spins the floppy disk. The small circular hole called the index hole lines up with the small hole in the medium when it is rotated.

Index hole:
     This hole is used to locate the starting sector(the 1st sector) of a track on the medium. The elongated aperture will allow the drive to read or write from or to the surface. A notch at the edged of the jacket, called write protect_ notch is to protect the disk from writing on to it, if the notch is closed, the disk is protected from being written over it.


3 1⁄2-inch floppy disk:
            The 3 1⁄2-inch drives use a more rigid plastic case that helps in protecting the disk having high density of data. The metal shutter protects the medium access hole it is spring loaded. The closed shutter will be opened by the drive mechanism. The 3.5-inch (8.9 cm) disk replaced the 5.25-inch (13.34 cm) disk in the early 1990s, capable of holding 1.44 megabytes of information. For a while there were two floppy disk drive types often included with computers.




Fig: Floppy Disks and It’s parts.


Recording format
         Data can be stored on a disk in different ways. There are two types of recording format.
•             FM(frequency modulation)
•             MFM(modified F M)

 Frequency modulation:
          In this format, every data bit cell starts with a flux transaction. Then if the   current        data is ‘1’ a flux transaction will be recorded at the middle of the bit cell.

Modified F.M:
Here there will not be any clock at the start of every bit cell. But as in the case of F.M, a flux transaction will be recorded in the middle of a bit cell if the current data is ‘1’ if the data is ‘0’ there will not be any flux transaction in the bit cell. However, if both the current data & the previous data are 0s,there will be a flux reversal at the starting of the current data bit cell. We will be able to store double the amount of data on the same area by using the MFM format instead of FM format. The recording format will be decided by the operating system.

Hard sector and Soft sector of Disks
    Some disks may have multiple index, one index hole for each sector. So each sector will be identified by an index hole. Such disks are called Hard sectored diskette:. The IBM PC identify sector-1. The sectors are identified by the information recorded at the beginning of each sector. So such diskettes are called soft sector diskettes.

Clusters: DOS rarely deals with individual sectors. Instead, data storage is done in-group of sectors called clusters. The cluster size varies depending on the diskette type its format and the version of DOS.

The Floppy disk  interfaces :
The interface consists of three basic components
•             The Floppy drive controller
•             The power cable
•             The Control/Data cable

The Floppy drive controller:
 The Floppy Disk drive controller is an electronic circuit board that does interface b/w the system and floppy disk driver. The major functions of the floppy disk controller are
•  To translate the logic commands from the computer in to the exact electrical signal that control the disk drive
•  To translate the stream of pulses generated by the floppy drive head into data in the form the computer can deal with

The major function blocks are as follows:
•             System interface logic
•             Floppy disk controller logic
•             Read write logic
•             Drive select logic
•             Control logic






System interface logic:
    The system interface logic communicates with the system and the controller electronics. All the   signals to and from FDC are buffered through I/O slot.

Floppy disk control logic:
The PC can support to floppy drives, the FDC can be programmed to select only of the two drive at any time. The drive select logic energies the respective drive. For a read or write operation after decoding the commands received from the CPU. Before any read/write request is processed the read/write heads to locate the required track. Necessary calculations made setting the current track number and the required sector number. The control logic issues direction and step commands to head assembly to locate it over the desired address. The control logic also analysis the interface signals from write protect index hole and track 00 sensors and inform the CPU about the status of the floppy disk drive.
Decoding the command from CPU either read or write operation is executed by read/write logic. The data received in bytes are serialized and encoded in MFM format by adding necessary clock pulses before writing on to the disk. During  reading, the data bit stream is read from the disk, data bits are separated and deserialised. Then the data bytes are sent to CPU. The DMA request for the data transfer is made by the FDC. At the Completion of the data transfer, Interrupt is raised to inform the CPU about the status by the FDC. The complete activities are sequenced and controlled by the timing and control unit.

How a floppy drive works?
•             When you push 3.5 inch floppy disks into the drive, the floppy presses against a system of leavers. One leaver open’s the floppy’s shutter to expose the cookie-(a thin Mylar disk coated on either side with a magnetic material similar to the coating on a cassette tape that can record data.)
•             Other leavers and gears move two read/write heads until they touch the cookie on either side. The heads, using tiny electromagnets generate magnetic pulses that change the polarity of metallic particles embedded in the disk’s coating.
•             The drives circuit board receives signals including data and instructions for writing the data to disk, from the floppy drive’s controller board. The circuit board translates the instructions into electrical signals that control the movement of the disk and the read write heads.
•             If the signal include instructions to write data to the disk, the circuit board first checks to make sure that no light is visible through a small window in one corner of the disk’s housing. But if the window is open and a beam from a light emitting diode can be detected by a photo sensitive diode on the opposite side of the disk, the drive knows the disk is write protected and refuses to record new data.
•             A motor located beneath the disk spins a shaft, a notch on the hub of the disk causing the disk to spin.
•             A stepper motor-which can turn a specific distance in either directions according to signals from the circuit board moves a second shaft that has a spiral groove cut into it. An arm attached to the read/write headrests inside the shaft’s groove. As the shaft turns, the arm moves back and forth positioning the read/write heads over the disk.
•             When the heads are in the correct position, electrical impulses create a magnetic field in one of the heads to record data to either the top or bottom surface of the disk.
•             When the heads are reading data they react to magnetic fields generated by the metallic particles on the disk by sending electrical signals to the computer.

Tuesday, 20 March 2012

SMPS-WORKING,TYPES AND FUNCTIONS.

-->

SMPS

                                                             The role of a power supply is convert the mains voltage into a lower DC voltage which the components can run on. While there are two types of PSUs out there (linear and switching/switch-mode), we’ll just look at switch-mode power supplies (SMPSs) in this article, since they are the only type of power supply used in computers. The SMPS convert the input AC voltage to a Set of fixed DC Voltage and supplies the necessary power to motherboard, disk drives and all expansion cards. The advantage of using switch mode power supply is that it operates through fewer components such as electronic switches which work in one of two states on or off. These switches dissipate very little power and power convention can be accomplished with minimal power loss which leads to high efficiency. modern PCs use mainly two types of SMPS Units – AT and ATX.

Fig: Interior view of an ATX SMPS



      Types of Power Supplies
  • Ferro – resonant power Supplies
  • Linear Power Supplies 
  •  Switch mode power Supplies

Ferro resonant Power Supplies

Principle of operation: This is the simplest type of power supply, which uses a Ferro resonant transformer. The secondary of the transformer remains instauration, even when the primary is out of saturation.  By secondary saturation we mean the magnetic full density level in the transformer secondary remains more or less constant. Hence, the secondary output voltage will remain constant, regardless of input voltage variations.  The output of the Ferro –resonant transformer is a sine wave.


Linear Power Supplies

They are usually conventional AC to DC supplies and commonly known as “Regulated power supplies”. In Linear supplies regulation taken place after rectification.

Type of Linear Power supplies:-

•             Series regulator
•             Shunt regulator

Switch mode power supplies

In a SMPS the controlling device works like an ideal switch, which is either on or off. By controlling the ratio of the duration of ‘on’ time and ‘off ’ time of a power transistor, which is also known as duty cycle, the power flow can be controlled in a very efficient way.
         In a switching power supply the switching regulations taken place in the primary side, as the main power transformers in switching supplies a constant current flow which is regulated by chopping the input voltage. And controlling the average current by Means of the duty cycle. Then  a higher current is drawn by the load, the control circuit of the SMPS suitably increases the on-time duration to accommodate such change in load current since the switch always operate either in situation on in cut off mode except for a brief transition period between these two states, the switching regulator can achieve very good regulation despite large fluctuations in input voltage and load variations.
















Types of SMPS
•             Fly back mode SMPS
•             Forward mode SMPS
•             Push-pull mode SMPS



Fly back mode SMPS:

     It is normally used in TVs and VCRs. It is relatively simple and cheep since it does not need any output choke. But  it has relatively poor regulation and high ripple context in output.

 Forward mode SMPS:

             Units are used in device requesting 100 to 200 watts of output power and good regulation, forward mode SMPS circuit are also not used in PCs because their power requirements may exceed 200 watts and they need even better regulation.

 Push pull mode SMPS:

                 It is used for output power requirement is high (exceeding 200 watt) and better regulation with low are required. They are preferred choice in PCs. Push-pull designs are relatively complex and costly.


The importance of power supply in a PC:
The SMPS unit in PCs in responsible for converting the standard AC utility power into a form that the computer can use. It is responsible for powering every device in the computer. The power supply plays an important role in the following Areas of a system.
1.  Stability: a high quality power supply with sufficient capacity to meet the demands of the computer will provide years do stable power for
2.  Cooling: the powerfully contains the main farm that controls the flow of air through the PC case. This fan is a major component in the PC’s cooling system.
3.  Expandability: the capacity of the power supply is one factor that determines the upgrade potential of system.
   
PC power Supply Functions

In a PC the SMPS Server three crucial functions
Delivers Required DC Power: In a PC power supply converts the AC main supply voltage to a set of lower and smooth DC voltage +/-5V,+/-12V(and +3.3V in modern ATX system)which are required to operate the electronic components and circuits in the system.
Cooling of the system inside: Modern SMPS units used in PCs are small, highly efficient and are equipped with fans to cool the system inside.
Protection of system components: The SMPS also protects the pc by not switching on the PC of the power supply cannot deliver enough electrical power to the PC.

Output voltages


























+5 Volt Supply: This is the basic supply voltage for nearly all electronic components. Motors now sometimes use the5 volt supply, but usually only in the smaller drives, such are the 2.5 inch and some 3.5 inch drives. The +5 volt supply wires should always be red in any standard PC system.

+12 volt Supply: the main function of the +12V power is to run disk drive motors as well as the higher output processor voltage requirements in some of the newer boards +12V supply is used by any cooling fans in the system.

-12Volt Supply: it is not used by motherboard logic and routed to pin B7 of the A bus slots. Although this voltage can be used by any add-on card plugged into the ISA bus slots, usually only the serial port driver/receiver circuits use it for converting TTL signals rather they use +/-5V. Thus, it may happen that in a modern PC the -12V is left unused.

-5Volt Supply: is the -5V signal is directly rounded to the ISA bus pin B5 for use by add on cables. In earlier floppy drive controller cards; the analog data separator circuit used-5V.

+3.3 Volt Supply: this Supply voltage does not appear on the original XT-AT or mini XT compatible power supplies starting with the ATX design in 1995 any system with ATX compatible power supplies include a 3.3 volt supply  line from the power supply to the motherboard. Most CPUs and DRAM use 3.3 volts, and used as some PCI adapter cards. All high speed PCI adapter cards to use 3.3 volts for all communications with the PCI Bus.

+5VB(+5V, standby mode): the +5 VSB line is a +5 volt supply line that is active any time the AC power input is active regardless of whether the system is turned on the purpose of their supply line is to power standby circuiting, such as the PS-ON circuit the wake on LAN and remote ring on circuitry.

+3.3 Sense: it is used to sense the actual voltage of the 3.3 volt supply after it has reached the motherboard, which allows the power supply to actively adjust the 303 volt output to compensate for line losses between the power supply and the motherboard.

Monday, 19 March 2012

Linux-Gaining More Interest


Linux is a computer operating system which is based on free and open source
software. Although many different varieties of Linux exist, all are Unix-like and based on
the Linux kernel, an operating system kernel created in 1992 by Linus Torvalds.

Linux V/s Windows:-
Linux doesn’t have the virus problems: Even Microsoft’s CEO Steve Balmer
couldn’t clean Windows Viruses. Still not convinced? It’s not that there aren’t any
viruses for Linux but Linux is more secure and less virus prone.
Linux doesn’t need defragging: The Linux file systems work very efficiently such
that it arranges data in a way that it doesn’t require defragging.

Linux doesn’t crash without any apparent reasons: In Linux the core operating 
system (kernel) is separate from the GUl (X-Window) from the applications 
(OpenOffice.org, etc). So even if the application crashes, the core operating 
system is not affected. In Windows (Microsoft prefers to call this tight 
integration) if the Browser crashes, it can take down the entire operating system.

Linux doesn’t crash if you accidentally pulled out your USB key/pen drive: Try 
this a 100 times if you don’t believe me. But don’t blame me if your pen drive 
data gets corrupt.

linux doesn’t require frequent re-installation: In Windows if the OS crashes, there 
is no easy way to recover this. Many IT support staff doesn’t know what to do 
and all they can do is re-install Windows. Which means that users applications 
and preferences are lost, and needs to be installed again. I haven’t seen anyone 
using Linux, requiring re-installing unless there is a hard drive failure. Most 
things in Linux can be fixed without requiring re-installation.
Linux doesn’t require frequent rebooting: Linux runs extremely stable, even if an 
application crashes, there is no need to reboot the whole system, just restart 
that application or service. Linux also doesn’t require rebooting when a new 
hardware device is added configured. Linux doesn’t require rebooting when you 
change any setting or re-configure your Network or when you install a new 
application.

No licensing headaches: Yes Linux is free and you don’t know need to bother 
about the complexion licensing of per user/per PC/per server/etc. Note: Some 
Linux distributions charge a yearly subscription to get the updates and patches, 
however this is still simpler than the proprietary world.
100 File Systems: Linux can read over a 100 different types of file systems. 

Windows is limited to its own two file systems. Well most general users may not 
care about this but its extremely useful is you are working in a mixed 
environment or you need to extract some data from a hard drive formatted on 
another computer.