
Previously we looked at the how the CPU work through understanding the CPU architecture. We did talk about memory there but let’s have a deeper look.
What is computer memory? – a scratch
Computer memory like your memory is all about storing things for both a short and long time. Like you a computer has a store of data that it is working on at the moment and then longer storage that we can l reloaded (remembered) when we need. And the comparison with human memory doesn’t stop there.
Memory has limits or size
A super fun game to play when on a super long journey with your family is the “what I packed for my holiday”. The first person gives one item and then the next person recalls this item and then adds another. The game continues with more items added until someone incorrectly recalls all the items. For that person that was the maximum they could store in working memory. The computer has the same challenge – it can only store enough items until there is no where else to put it.
Memory is volatile – use it of lose it
Now for something dark. Imagine your playing the “what I packed on holiday” and your three rounds in: toothbrush, beach ball, sun glasses… when someone bangs you on the head and knocks you out cold. When you wake up a bit surprised you won’t remember what items where in the game. You can’t remember as you held the items in short term memory. If you compare this to a song you have heard many times and can sing along when it comes on the radio. This is long term memory – it doesn’t go away if your turned off.
For computers short term memory is also held in memory and like a human it will disappear if the computer is turned off (metaphorically hit on the head). There are a couple different types of memory and a couple that aren’t really memory which I’ll talk about in a minute but crucially computer memory is volatile – it disappears when the computer has no power.
Some memory is not really memory – it’s just ROM
Things get a little confusing as we have two types of memory that are stable – not volatile. Huh?
There’s bit of history here. In the old days a little bit of stable memory was used to setup the computer when it first started that allows the hardware to talk to the software – firmware. It was memory as it contained the first basic input/output system (BIOS) instructions on what the computer had to operate with – a bit like you making up and your brain telling you you have arms, legs, fingers etc before going on to check other parts of you. This is called Read Only Memory (ROM as you can only read it not write to it stopping you from over writing so it is stable, non-volatile. This is a good thing as you really don’t want the basic instructions to change when a machine is turned on and off everyday.
It falls into the memory category as it’s not used to store data like a program. The reason it’s read only is that you have to have this memory both stable so it’s there on start up and it can’t be changed as that would mean the computer wouldn’t work – it wouldn’t display a screen or recognise a keyboard etc.
Remember ROM is a type of memory but it doesn’t change. Easily. Well… it can and does with changes to the hardware or better firmware being available. In order to update ROM then it needs to be writable but also non-volatile so it remains when the computer is turned off – it needs to be programable ROM (PROM).
Programmable ROM does not need to be updated once the computer has started therefore it rarely changes compared to RAM. The challenge is to have a storage that is stable but easily updatable. On a hard disk drive this is done through a “magnetic writer” that lays down magnetic fields as the disk spins underneath it like having a piece of paper covered in iron fillings and small magnets creating little clusters of filings for 1 bit and no clustering for 0 bit. With PROM there is no mechanical movement that you can see.
There are two types of ways to write to PROM but only one that is used in computers. Remember ROM is used by any electronic system that needs to have instructions and some of those systems are wholly owned by the manufacturer. For these sort of systems the ROM can be updated by the manufacturer every time it wants to update a product either in a new release or even to recall the product. The reason they need to do this is because the ROM can only be updated using a complicated technique involving ionising (creating charged particles) radiation like ultra-violet or even x-ray to change the electronic structure of the ROM. The result is like clearing down a while board to allow new data to be installed on it. The is called Erasable Programmable Read-Only Memory or EPROM.
As you can imagine bringing your computer back to the manufacturer to update the ROM is not practical. To enable a computer to update its own ROM easily another method is used on a different memory which sounds very like EPROM but is fundamentally different. It’s called Electrically Erasable Read-Only Memory – EEPROM – and as you can gather it uses electricity to erase the memory not ultra-violet or x-rays.
EEPROM or E2RPOM has a massive advantage over EPROM in that it doesn’t have to erase all the data but just some. This way it acts more like a hard drive by only writing to certain sections of the memory. EEPROM is what is in most motherboards to allow the boot up ROM to be updated when necessary and quickly – in a flash! And this is where the phase ‘Flash the ROM’ comes from – the ability to easily update the ROM quickly as it just takes a change of voltage across the chip to reset and then rewrite to a new configuration.
Flash ahhh!
EEPROM’s ability to have no moving parts and to have sections that can be written to and stored when the power is off is not only helpful for booting up a computer but for storing user data. Flashing the ROM has scaled from a small amount of memory to very large (but on a tiny space) to provide “Flash Memory”. Flash memory is not memory – it’s storage of data not instructions.
Flash memory is found on a lot of different devices notably USB sticks or thumb drives that allows a computer to access a lot storage externally. Another example is a Flash drive or SD card that are used to store video and sound in digital cameras. They are small, fast to write to and stable so perfect for people wanting to capture large files quickly.
The third type of computer “memory” is also not memory but it is flash. Flash memory is related to the ROM we just talked about
At the basic level memory is a way of storing data (for easy of reading I’ll use data for both singular and plural of datum). At the electronic level “data” is a set of either nothing or a mark on a media. Where there is nothing that is recorded as zero (I will also avoid the existential question if zero is nothing) and where there is something that’s a one. So we have a location which can be recorded as a 0 (zero) or 1 (one) or On or Off or Yes or No – whatever the way it’s described there are only 2 values.
Numbers are just symbols that represent something, We use 10 (ten) symbols (0,1,2,3,4,5,6,7,8,9) which we use to represent things: 4 apples, 10 miles, -15degrees. We can use these numbers to make calculations: I have 4 apples, 1 eat 2 apples, I have 2 apples -> 4 apples – 2 apples = 2 apples. We can use scratches to show a number like the Roman numbering system I, II, III. But this takes time and takes up room so as humans, we agree to use multiple symbols. The Romans used V to represent IIIII or 5, X to represent IIIIIIIIII or 10.
As humans with 10 fingers using 10 symbols or denary. Fun fact denary comes from the Latin deni meaning ‘in tens’. There was a Roman coin, the denarius which was worth 10 asses! Unfortunately “as” in Roman just means unit so 10 units (no donkeys)! Back to numbers. If we had just 1 finger we may use binary (bi meaning “two”) and we would be able to count but it would take up more space and take longer (humans are way quicker than machines at simple maths). For computer space is not a probably as we are recording at the atomic scale so it’s about speed. With speed simplicity wins and we struggle from an engineering view to create components which have to handle multiple inputs and outputs over 2.
In summary computers store data as zeros and ones. In memory these can be physical marked in many different ways but which ever way they are recorded they are held
