World's most popular travel blog for travel bloggers.

[Solved]: How ram is divided

, , No Comments
Problem Detail: 

when I write a program, in a Von Neumann architecture, how the ram will be divided to receive data and instructions? For example if I have 1 MB of ram, the addresses from 0 to 499.999 for data and from 500.000 to 999.999 for instructions? Or I could find instructions mixed with data? Is divided the entire memory for example a side for all data of all programs and the other from all the instructions of all programs or when I load the memory with a single program, is reserved a small space (just for that program) and then that space is divided? Is the compiler to decide or the OS? Thanks in advance

Asked By : user5507798

Answered By : AProgrammer

Is the compiler to decide or the OS?

The architecture put some constraints, then the OS is built to work within these and adds its own constraints, then the compiler does the same thing.

how the ram will be divided to receive data and instructions?

It depends.

Or I could find instructions mixed with data?

You could very well. It's more or less a defining property of Von Neumann architectures.

Is divided the entire memory for example a side for all data of all programs and the other from all the instructions of all programs

That would be rare.

or when I load the memory with a single program, is reserved a small space (just for that program) and then that space is divided?

That's more the case. But you seem to forget segmentation and paging which make it so that the addresses that a program see are not the physical one and what a program see as continuous may be physically interleaved with the memory of other programs.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/50089

3.2K people like this

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback