Pages

Saturday, August 6, 2011

physical address of computer


 physical address of computer :

All the c variables are stored in the residence memory.
In turbo C 3.0, 20 bits address of the memory cell is
known as physical address or real address. In 20 bits,
we can represent address   from 0x00000 to 0xFFFFF. That
is all c variables must have memory address within this
range.



























A C programmer cannot not decides what will be the memory
address of any variables. It is decided by compiler. For Example:


What will be output of following c code?

#include<stdio.h>
int main(){
    int a;
    printf("%x",&x);
    return 0;
}

Output: We cannot predict.

But we can say in 16 bits compilers address must be
within 0x0000 to 0xFFFF and in 32 bits compilers memory
address must be within 0x00000000 to 0xFFFFFFFF.

Note: Suppose your c compiler is based on the
microprocessor which total address buses are 32 then its
total size of addressable memory will be:






= 2 ^ 32 bytes
= 4 GB

No comments:

Post a Comment