Before understanding that though, I would like to understand at a deep level how a computer stores and represents a number (8 bit, 16 bit, 32, 64, 128, 256, not sure if they can store above that). There are multiple aspects of this:
- How it is stored on disk.
- How it is stored in memory.
- How it is stored in the CPU / ALU / etc. to actually use to manipulate / perform calculations.
I don't need to know all the details of it, just something to point me in the right direction / an overview. I understand a little about flip flops, which store 1 bit in main memory. I am only interested in here in how numbers are stored in memory and in the CPU / ALU, not the disk. But if the disk is simple enough would be nice to know about that.
In terms of main memory, maybe there is somehow 8/16/32/etc. connections of flip-flops, or perhaps no, main-memory is just bits and you point to locations in these bits. I am thinking in terms of the x86
mov instruction, e.g.
mov edx, [ebp + 8], which might move bits between memory or between memory and registers.
In terms of the CPU / ALU, it seems to just boil down to registers, so the numbers would be in the registers. But here they do make the distinction between 8/16/32/etc. bit integers, so maybe there is some electronics structure that implements this.
So this question is about knowing how the following works, at a high level / overview:
- How integers are stored / represented in main memory electronically.
- How integers are stored / represented in the CPU / ALU electronically.