Thursday, December 25, 2008

Difference between RAM & ROM

RAM

ROM

Random Access Memory

Read Only memory

User can read & write into it

User can only read from it

For any type of processing, user must store program & data into RAM

Manufacturer stores instruction into ROM permanently

Temporary or volatile memory

Permanent or non-volatile memory

Cache Memory or High Speed Buffer



















Cache Memory

Cache memory is high-speed memory that holds the most recent data and instructions that have been loaded by the CPU.

Cache is located directly on the CPU or between the CPU and RAM, making it faster than normal RAM.

CPU-resident cache is called Level-1 (L1) cache. External cache is called Level-2 (L2) cache.

The amount of cache memory has a tremendous impact on the computer's speed.

Secondary Memory or Secondary Storage Devices

Secondary Memory

Ø Nonvolatile

Ø Slow compared to primary memory

Ø Less costly & high capacity


Categorizing Storage Devices

The hardware that writes data to or reads data from a storage medium is called a storage device. A floppy disk drive is a storage device.

Storage devices hold data, even when the computer is turned off.

The two primary storage technologies are magnetic and optical.

Magnetic storage are:

-Diskettes (floppy disks)

-Hard disks

Optical storage are:

-Compact Disk Read-Only Memory (CD-ROM)

-Digital Video Disk Read-Only Memory (DVD- ROM)

Comparison of primary & secondary memory

Characteristics

Primary

Secondary

Location with respect to the CPU

Directly accessible

Indirectly accessible

Cost

More expensive

Less expensive

Capacity

Lower than secondary memory

Several thousand times higher than primary

Means of storing information

Semiconductor chips

Magnetic and optical

A Program that will Find the Two Numbers Addition

First Method:

#include
Void main ()
{
int a, b, sum;
sum = a + b
printf ("Enter Two Numbers :\n");
scanf ("%d %d\n", & a, & b);
printf ("Sum of two Numbers: \n", sum);
}

Second Method:

#include
int main ()
{
int a, b, sum;
sum = a + b
printf ("Enter First Input:\n");
scanf ("%d\n", & a);
printf ("Enter Second Input:\n");
scanf ("%d\n", & b);
printf ("Sum is: \n", sum);
}

A Program that will Count Temperature From Celcius to Farenite

#include
void main ()
{
float cel, faren;
printf ("Enter value in celcius:\n");
scanf ("%f\n", &cel);
faren = 18*cel+32;
printf ("Farenite Result is :\n", faren);
}