At the lowest level of representation, the memory is a device that stores the state of a bit. Let's say we are inventing a device that can store a single bit of information. Nowadays, it seems both meaningless and magical at the same time. It's meaningless to invent something that has already been invented, a long time ago. It's magical because programmers nowadays have the luxury of stable multifunctional environments providing tons of libraries, frameworks, and tools to create programs without even understanding them under the hood. It has become ridiculously easy to declare a variable or allocate a dynamic memory, as shown in the following code snippet:
int var;
double* pd = new double(4.2);
It's hard to describe how the device stores these variables. To somehow shed some light on that magical process, let's try to design...