How does computer memory work?

980 views

When you physically save a file, like a photo or a word document, how is it physically saved? Where is that document physically? I believe there are two modern memory devices, HDD and SDD, but how do they work? How can a Hard Disk Drive be ‘scratched’ the right way to save my essays? And when I save a file to a flash drive, where on the flash drive are my documents? How can another computer read that flash drive? Is it a series of electrons or switches moved to remember each part of the document, like the 38th word on the 4th page?

In: Technology

4 Answers

Anonymous 0 Comments

>Is it a series of electrons or switches moved to remember each part of the document, like the 38th word on the 4th page?

Yes, effectively.

I don’t know enough about flash drives to ELI5, unfortunately. It’s a big story, but the cool part is it all comes down to quantum mechanics in the end (you could do it other ways, but your flash drive would no longer fit on your keychain. Not by a damn sight).

I’ll instead tell you about that 38th word on the 4th page – but we’ll forget the 4th page, because the word is enough. It’s up to font size and page size to determine what page it lands on.

So those switches can be set to 1 or 0. Your entire essay can be represented as a string of 1s and 0s. Some information has nothing to do with the paper in your hand once you’ve printed it. Things like the filename. Let’s just focus on the text of the essay, and we’ll keep it simple and pretend it’s all one size, one font, no pictures, basically something you’d type in notepad.

[Take a look here](http://sticksandstones.kstrom.com/appen.html)

Every letter of the alphabet (including capital letters) can be coded by an eight-long sequence of 1s and 0s. You could also use that dumb cipher every kid uses once (A = 1, B = 2, …) to encode it, but remember that the switches can only be 1s and 0s for a computer.

So once I knew WHERE on the storage your essay starts, all I have to do is read groups of eight 1/0s and translate them to letters. And then maybe a special sequence of 1/0s tells me when to stop reading. Let’s just pretend it’s 11111111, for the sake of illustration.

You might notice something though. That list I linked didn’t include spaces. Also how would I know when you start a new paragraph? Or punctuation? Or this jerk: ~

Well, there are 2^8 = 256 ways I can write a combination of eight 1s and 0s. And we only used 26 + 26 = 52 of them for letters. The rest can be used to represent “start a new line” or “space” or “~”.

Does that make sense?

You are viewing 1 out of 4 answers, click here to view all answers.