# What would be a mathematical rigorous definition of a memory address space?

What is the exact definition of a memory address space?

Is it correct to name the set of all the numbers from 0 to the highest addressable byte the definition of an address space?

EDIT: I would like to know if there is a formal definition of an address space the same way as there is a mathematical formal definition for a Finite State Automata.

• Possible duplicate of What are memory addresses? – gnat Oct 2 '17 at 12:23
• Not necessarily contiguous. By convention labelled with numbers, but they could be labelled in any manner – Caleth Oct 2 '17 at 12:39
• It's fine and good to be speculating, however as a programmer, you should never ever attempt to guess how the operating system handles memory for any reasons other than the two following exceptions: 1) you're writing drivers for your hardware containing onboard memory directly under your control, 2) your program IS the operating system. – Neil Oct 2 '17 at 14:34
• The subset of memory addresses which you can write arbitrary data to and read from, and neither writing nor reading would cause any unforeseeable side effect other than due to code that is written by you. Basically, this is what we mean when we say "this is the part of memory you have allocated; and this is what you are allowed to write to or read from". Although you can write code that will write to or read from addresses which you haven't been given permission to, the possible consequences are truly "unbounded" (unspecified), including e.g. resurrection of dinosaurs. – rwong Oct 3 '17 at 5:54
• There is something wrong from me, you want either the definition of memory address, memory space, or size of addressable memory or size of one addressed block of memory. Moreover, there is a difference between the usage of the memory : it can basically either be instruction to execute, or data. The pointer to the current instruction to execution is called the instruction pointer. You have to know when you pick an address if you're looking for data or instructions. – Walfrat Oct 3 '17 at 11:25

Sure, and it is pretty simple. A linear memory adress space can be mathematically modeled as an `n`-dimensional vector from the set `Mn`, where `M` represents the finite set of numbers which fit into one memory cell (for example, `M={0,...,255}` when the memory is addressed in portions of one byte), and `n` is the maximum number of addresses.