Monday 31 December 2018

check prime number or not [c programming examples with output]

C programming examples with output:

Prime or Not Prime
Program:

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("Enter any number : ");
scanf("%d",&a);
b=1;
c=0;
while(b<=a)
{
if(a%b==0)
c=c+1;
b++;
}
if(c==2)
printf("%d is a prime number",a);
else
printf("%d is not a prime number",a);
getch();
}

Output:
Enter any number: 2
2 is a prime number

Enter any number:4

Sunday 30 December 2018

Magnetic Core Memory[What Is Magnetic Core Memory]

Magnetic Core Memory

magnetic core memory
Magnetic Core Memory

Magnetic core memory is a non-volatile random access memory. In 1951 at MIT magnetic core memory was developed. Almost all early computers used the magnetic core as their primary internal memory before the wide availability of semiconductor memory. The basic magnetic core memory cell is a small doughnut-shaped core which was made of a ferromagnetic material. These cores are called ferrite cores. Its diameter is almost 0.05 inch. Here in magnetic core memory, there is a small wire which threaded through the centre of the magnetic core. When a current pulse is passed through in this wire, a magnetic flux is set up in the core in a direction that depends on the direction of the current. Because of the magnetic retentivity of the core, it stays magnetized even after the current pulse is terminated. In other words, it is non-volatile. The two directions of magnetization are used to represent 1 and 0, respectively. Stored data are read from a core by magnetizing it in the 0 direction and using a second threaded wire as a sense wire. The size of the voltage induced in the sense wire will be greater if the core is initially in 1 state rather than 0 state. The reading of a magnetic core memory is said to be destructive since it always leaves in 0 state. Thus, the data can be rewritten after a read operation.
The magnetic core memory system has access times from 100ns to 500ns. It can still be found in some old minicomputers and mainframes. But for all practical purposes, their large physical size and complex interface circuitry have made them virtually obsolete.

Saturday 29 December 2018

Ethernet[What Is Ethernet]

Ethernet:

ethernet
Ethernet Connection Cable

Ethernet is a LAN technology with which we can connect many computers together and transfer data between them. To build ethernet connection we use mainly 3types of ethernet cables which are:
1. Coaxial Cable
2. Twisted Pair Cable
3. Optic Fibre Cable

Coaxial Cable:
It is a signal wire. It made with an insulator, metallic shield and plastic. In this cable, insulator controls the signal of our data. Metallic shield controlled electromagnetic interference. And plastic prevents the wire from water and other external strikes.

Twisted Pair Cable:
This cable basically made with 2 or 4 copper wire. To prevent cross talk it patches each other.

Fibre Optic Cable:
Fibre optic cable is totally different from coaxial cable and twisted pair cable. Mainly it transfers data through light. Therefore it's speed is higher than coaxial and twisted pair cable.

In 1970 ethernet was first developed by engineers at Xerox Parc(a Xerox company) in California. After that Ethernet replaced with large LAN technologies such as ARCNET, FDDI and Token ring. When we talk about this kind of large LAN technology. Let's know a little bit of these.
The Token ring is a communication protocol for local area network. There is a three-byte frame which is called as "token" which moves around a "ring". ARCNET is known as Attached Resource Computer Network. It is also a communication protocol like Token ring. And FDDI which is known as Fibre Distributed Data Interface is a data transmission network connection. First, it was built with optical fibre but later with copper cable. That is why it is also called as Copper Distributed Data Interface. The ethernet is divide by many short pieces which is known as frames. These frames are the main part of the ethernet. Basically, it checks the error and checks the destination addresses. Here a new concept comes, which is the MAC address. The Media Access Control(MAC) address also checks the data packet along with the error.                                                                                                                                             
 If two devices try to transfer data between them at the same time then data packets face problem to connect with its destiny. To solve this kind of problem, the IEEE(Institute Of Electrical And Electronics Engineers) developed the Carrier Sense Multiple Access with Collision Detection(CSMA/CD) protocol, which allows devices to check that kind of data transferring problem. So, we can say that Ethernet is a standard type of protocol used to connect devices.

ethernet


How Ethernet Works:
Think with an example that, you have a router. And you have connected all your smart devices together like computer, printer and others. Now when you give a command to your printer to print something then the data command goes into the router and then router send this message to the printer. In the past 30 years, ago there was a fixed coaxial cable which connects this all devices with a single cable. That time if a computer wants to send any data then it had to shout in the network to stop other devices.When other devices stopped then the process starts. If those two devices send that at the same time, then the communication starts with them. But there was a problem with this method. Because if more than two devices send data at the same time, then the ethernet cannot work. To solve this problem MAC or Media Access Control Address concept comes. Every network device has a unique number which is MAC. With this MAC address, every network devices got a globally unique name. Thus the problem solved. Now when we send any data the MAC address goes into the router and then the router sends its prefixed MAC address to another device. Thus the Ethernet works.

Wednesday 26 December 2018

What Is Cache Memory

Cache Memory:

cache-memory

We know that CPUs are faster than memories. Day by day engineers are doing a lot of hardworking to make the chip smallest. They inputting more and more circuits on a single chip and thus they make a CPU so faster. As well as memory designers are also using various of technology to increase the memory capacity but they are not able to make its speed. Actually, the problem is not technology. The engineers are trying to build a memory which will as fast as CPU. But here a problem comes. If we want a high-speed memory then we have to locate it on the CPU and this is not an impossible task. But to locate it on CPU the total size will highly increase. To solve this kind of problem engineers are combining a small amount of fast memory with a large amount of slow memory. And we want huge facilities at a reliable price. And here the concept of cache memory comes. Basically, there are three types of memory is our computer. These are Hard drive, RAM and cache memory.

Cache comes from the French word cacher which means to hide. We can say that cache memory is a storage memory which can store top uses computer programs with a higher speed. It is a volatile memory. It is the fastest memory portion in a computer. But its storing capacity is very low respect to others memory. There are three types of cache memory:
1.   Level 1(L1) cache or Primary cache.
2.   Level 2(L2) or Secondary cache. 
3.   Level 3(L3) or Main Memory.

1. Level 1 or Primary Cache:

 L1 is the fastest cache memory which stays inside the processor. But it is very small than other cache memory. The storing capacity of L1 cache is between 2KB to 64 KB.

2.  Level 2 or Secondary Cache:

 L2 cache can stay inside the processers or others IC chips in processor. But where they stay is not a great matter because these chips are connected by a bus and it is quite fast to process. The storing capacity is between 256KB to 512KB.

3.  Level 3 or Main Memory:

L3 cache is the separate memory which speed is much more than a RAM. And its storing capacity is between 1MB to 8 MB.

How Cache Memory Works:

Basically, cache memory stores our daily important data command. When we give a command to the processor then it gets so many commands and to read or write any data. Here cache memory takes a major role. It stores our frequently used data which we need almost every time to operate the computer. Now when we give a command to computer then it will not go to RAM. First, it will check the cache memory and will take the instruction to process. Otherwise, it will go to RAM to pick up the instruction. So thus cache memory helps the processor to work fast. But sometimes when we give a command to the computer and it fails to find the instruction on the cache memory then again it goes to RAM to find that instruction. In that time the processor does delay which is known as cache latency. Thus cache memory works.
cache-memory
Working Of Cache Memory



Best Budget Laptop For Web Developers 2019