I'm trying to understand addressing and memory. the book Embedded Linux primer says
Notice that the process called hello thinks it is executing somewhere in high RAM just above the 256MB boundary (0x10000418). Notice also that the stack address is roughly halfway into a 32-bit address space, well beyond our 256MB of RAM (0x7ff8ebb0). How can this be? DRAM is usually contiguous in systems like these. To the casual observer, it appears that we have nearly 2GB of DRAM available for our use. These virtual addresses were assigned by the kernel and are backed by physical RAM somewhere within the 256MB range of available memory on the Yosemite board.
I have attached Code and output relating to above statement.
I want to understand how 32 bit addressing translates to 2GB of memory. Is each address consists of 4 bits of memory then 0 to 0xFFFFFFFF translates to 2GB of memory.
Calculation: 0XFFFFFFFF in decimal is 4294967295. 4 bits per address . i.e (4294967295*4)/8 = 2147483647.5 bytes = 2.1 GB
- Am i correct that each address can hold 4 bits of memory?
- How is this bits per address decided?
Thanks