Computer Memory

What memory do you need? He is able to process.  i think many of you do. But the computer that will process,
what will be the process? Surely data. So we need to keep the data somewhere, otherwise the computer will remember what the Lord that he will have to process a thing?
Because you already know that the computer is calculating that, no matter what the big hisebai, ultimately empty and the only one using the computer calculated (this calculation karatakei we sometimes say that the process). So these are 0 and 1, we need to keep our place. The computer memory of the place. The 0 and 1, these are each bit (in English bit). That would be a bit of a kind, is going to be zero (0) is not one (1). So much can be done with a bit are two different things, when the bit is 0, then one thing, then another thing again when 1. With the addition of two bits can be many different things? So as you think about it. End figure on the table below:
1st bit in the second bit
0 0
0 1
1 0
1 1
If the two bits, four different things can be laid side by side, 00, 01, 10 and 11. Now working for you. Put down with pen and notebook in three and four bits for the number of different things to keep it out. The answer is, respectively, 8 and 16. So it stands 2, 3 and 4 respectively, and bits of 4, 8 and 16 can be separate things.

As I understand it more, you can easily say, 5 to 32 bits, 6 bits for the 64, 128 for 7 bits to keep things separate. So much for the 8 bits? The answer is 256. And those who have little mathematical sense, but now I think they have let slip out a formula. 2n if n bits to keep things separate.
Surely you have heard the term byte? English byte.
The meaning of the word but does not bite, the English bite. A byte is eight bits are placed side by side. If the number of bytes can be different things? I know that you will be able to say sackcloth, 256 cases.
All the characters you type (char) variables are familiar with.
Now, you must understand that a character type variable can hold up to 256 separate thing. That’s why we have a variety of letters, numbers, symbols and keep them in a variable of type character. Each character has a value that can be expressed with numbers. As the value of a- 97, b- value of 98, c- value of 99, the value of z- 122. Again, the value of A- 65, B- value of 66, C- value of 67, the Z- value of 90, from 0 to 9, 48 to 57 signs respectively. The ASCII value of the standards.
ASCII is the acronym for American Standard Code for Information Interchange-. English All the characters are all set ASCII standard. Now the question might arise in your mind, the rest of the languages ​​of the world, what’s wrong?
Why does not the standard ASCII characters for all of them? In fact, we are in total 256 thing can be 8 bit, so it was not possible to accommodate everyone. For all other languages ​​are Unicode.
Come on now, sackcloth wrote a few programs. You must manually type in the codes and run. I will not explain the programs, you will understand their thinking. The main problem is that our students are lazy brain, thinking does not understand anything. I want you to put into your brain a little.
Our first program
#include <stdio.h>
int main ()
int i;
for (i = 33; i <= 126; i ++) {
printf ( “ASCII code for% c is% dn”, i, i);
return 0;
Our second program
#include <stdio.h>
int main ()
char small_letter, capital_letter;
printf ( “Please enter a small letter:”);
small_letter = getchar ();
capital_letter = small_letter – 32;
printf ( “The capital letter is:% cn”, capital_letter);
return 0;
Your job will be to write a function, which is a character-type variable as a parameter, and it will be an address (digit) is, however, returns 1, and will return 0 if not. When done right, we go back to the memory of the talks.
The size of a variable of type integer is four bytes, ie 32 bits. This 32-bit, we can keep the number of 232 T or T 4294967296. Now, if we want to keep only the positive numbers, then you can be from 0 to 4294967295.
Unsigned variables such as variable. And the positive and negative variables – both numbers may be, he signed as a variable, but do not mention it separately in this case.
We could not understand why the variable of type int from -2147483648 2147483647 to keep the number of unsigned int type, and why the number can be variable from 0 to 4294967295.
Byte is the smallest unit of computer memory.
Number of consecutive bytes of memory are arranged. Again, there are certain address or the address of each byte. When you declare a variable that character, it will take over a byte of memory. Again, if you declare integer variables, the four bytes of memory will be occupied. It is thought to indicate the bottom of the image.
There are ten houses you see in the image. Each cell size is one byte. Again, each room has a different address or addresses. Let’s address the first cell 100. If the address of the house will be the next 101, the next 102 will be the address of the house, so. The film addresses the main room, another room has been written down.
100 101 102 103 104 105 106 107 108 109
Now, when you declare variables in any of the memory cell will be occupied, but you do not have it, it will set the operating system. Again, when you declare an array, the array of memory elements in a row, but it takes place.
Now type the following program runs as quickly. Warning will be compiled, it will be ignored, and the program will run.
#include <stdio.h>
int main ()
char ch1 = ‘A’, ch2 = ‘B’;
int n1 = 100, n2 = 100000;
unsigned int address1 = & ch1;
unsigned int address2 = & ch2;
unsigned int address3 = & n1;
unsigned int address4 = & n2;
printf ( “% c,% un”, ch1, address1);
printf ( “% c,% un”, ch2, address2);
printf ( “% d,% un”, n1, address3);
printf ( “% d,% un”, n2, address4);
return 0;
What is the output? Different people, different kinds of output, because some variables will have a place of memory, there is no right. As of now, if a variable is n, then the address is & n. Ekaranera we are using scanf function to input variables use the variable name & symbol. But it is not to the array morning, because the array is namatitei address to the beginning of the array. That is, if an array int ara [10], there needs to print the value of ara- array of available addresses.
Now the program will run as before (warning does not need to care).
#include <stdio.h>
int main ()
int ara [5] = {50, 60, 70, 80, 90};
printf ( “% d,% d,% d,% d,% dn”, ara [0], ara [1], ara [2], ara [3], ara [4]);
printf ( “% un”, ara);
printf ( “% un”, & ara [0]);
printf ( “% un”, & ara [1]);
return 0;
The first line of the program will print the array elements. The second line will print the address of the beginning of the array. Different people will vary the output of the computer. The second line, which will print, and the third line is exactly what will be printed, because the first element of the array starting address and the address array of the same thing. The fourth line will print the address of the array elements of the second, which is four more than the first component addresses.
The first element will be occupied by the four bytes. Although you might think, why 50 would place four bytes, so write a baitei, but when you will be int data type, then four bytes will be replaced.
C has an operator called sizoeof, which tells how many bytes the size of any of the variables. Below are the exact type program, then compile and execute. Now think yourself to understand how to use sizeof.
#include <stdio.h>
int main ()
int num;
char ch;
double d_num;
float f_num;
printf ( “% lun”, sizeof (int));
printf ( “Size of int:% dn”, sizeof (num));
printf ( “Size of char:% dn”, sizeof (ch));
printf ( “Size of double:% dn”, sizeof (d_num));
printf ( “Size of float:% dn”, sizeof (f_num));
return 0;
Now, let’s assume that the computer has many types of memory.
A computer memory can be divided into two broad spots, temporary and permanent.
English as a volatile (volatile) and non-volatile (non volatile). The data stored in memory even when the computer is off, called a permanent (non volatile) memory, such as a hard disk, ROM, DVD, USB drive. Turn off the computer and the data memory (sectoral program) is lost if, they say, the temporary memory, such as random access memory (RAM). Temporary memory when working with computer programs using the data. Standing memorigulo was quite slow, which is not used.
But the memory that the computer processor, the processor has the most to register, and then the cache memory. If you want to register for any of the variable C, we can declare this: register int number ;. We will try to register the variables that are most commonly used in the program. Though he did not like to register now, kampailaragulo where they took to be a variable. Register larger than the size of the cache memory, which means that can contain more information, but a little less speed.
Then comes the RAM. RAM processor is connected to the motherboard. RAM- quite large compared to the size of the cache, but less speed. Now you may ask, what is the problem if the register was more the size of the cache? Why am just RAM- use? In fact, the cost of producing the highest register memory, then cache memory. RAM is pretty cheap compared to them. Then comes RAM- virtual memory. RAM- this is not the place, the hard disk of a computer’s operating system memory to be used as part of the programs. That’s slower than the course of RAM-. Refer to the picture below at naoh
Here are some easy things have been written, you can learn it better when you will study computer architecture. The concept of memory, at least for the time being exempt. And now we say RAM- memory programming time to understand who, like the rest of the book will be written. The pointer to the next chapter, we will discuss.
This is my ‘computer programming (Part II) “, the first chapter of the book. There will be more books pointers, rikarsana, structures, etc. are discussed. Like the first volume, want to learn programming in C language learning will be more towards strength. The next fair will before the end of the book, let’s see what happens.