Understanding computer memory
At the lowest level of representation, 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 was 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 them even understanding them under the hood. It has become ridiculously easy to declare a variable or allocate dynamic memory, as shown in the following code snippet:
int x;double *pd = new double(3.14);
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 a device that stores a bit of information.
Designing a memory storage device
We will use electrical...