Loading...
Hey there, welcome back to computer systems. I'm Mac you're computing teacher for this unit.
In this lesson we're going to be learning all about main memory, and I'll be talking to you about RAM and ROM.
For this lesson, you're going to need a notepad and a pen so you can take notes while you're learning.
And I'd also like you to remove all distractions from around you, this includes your mobile phone.
Like usual I've got my water here, and make sure you've got any refreshments you need for the lesson before we start.
If you'd like to pause the video now, and get all the things that you need I'll be here when you get back.
In this lesson, you are going to describe RAM and ROM, we're going to explain the role of main memory and we're also going to define cache, and describe the role of cache in bridging the gap between memory and storage.
So let's first look at what we mean by main memory.
Now you've already got a little bit of learning on this from either your prior experience, or if you've undertaken any of the lessons we've done already in this unit.
So I'd like you to do an activity to start off with, to see if you can recall what we've already talked about.
So if you'd like to pause the video here, I'd like you to have a go at answering this question.
What do the terms RAM and ROM mean in a computer system? If you head over to your worksheet, you've got a table on there with RAM and ROM in it and a space for you to fill in your answer.
So what does RAM mean? And what does ROM mean? I'll see you when you get back.
Hey, there, welcome back.
Hopefully you were able to cool up on that prior knowledge and understand what RAM and ROM were, but let's just double check and make sure you got it right.
RAM is random access memory and ROM is read only memory, both are types of the main memory.
What that means is main memory is directly accessible by the CPU.
There's a direct line via the buses, that you learned about in lesson 3, from memory to the CPU and the components inside of it.
Memory is used to store the instructions, the CPU is going to execute.
And typically they are much faster than secondary storage devices, like a hard drive.
So rather than me just dictating to you what RAM and ROM are and some of their characteristics.
I thought we would play a little game.
So on your worksheet, I've got two comparisons of RAM and ROM for you.
I'd like you to decide either by writing in the columns or by dragging the boxes, which one describes RAM and which one describes ROM.
Use each type only once, so one will apply to RAM and one will apply to ROM.
There's not going to be two of either of them.
If you'd like to pause the video here, and have a go at categorising those comparisons.
Resume when you're done and we'll go through the answers.
Welcome back, I hope you found that okay.
Let's have a look at what the right answers are, so you can check your thinking.
So the first question said, which of these describes RAM and ROM? Which one is read only, and which one is read and write.
ROM is read only it's in the name, right? Read only memory, and RAM can be both read to, read from and written to.
Let's have a go at the next question.
So which of these describes RAM, and which of these describes ROM? Which one stores instructions and data ready for the CPU to execute.
And which one stores permanent instructions, that tell a computer how to boot up.
Hopefully you got this one, let's have a look.
Cool, so the RAM of course stores the instructions and data ready for a CPU to execute, and ROM stores permanent instructions that tell a computer how to boot up.
This is usually called the BIOS.
So main memory.
If a computer system does not have enough RAM, it will run slowly.
As a programme executes, the instructions are loaded into RAM from secondary storage.
The CPU then takes the instructions from RAM to execute them.
There are two key terms we need to know when we talk about main memory.
First one is volatile, which means when the power is turned off, all data is lost.
Non-volatile means the opposite.
When power is turned off, all the data is safe and stored and kept there.
Now I've got another couple of comparisons for you to do on your worksheet.
If you'd like to pause the video here, and categorise those comparisons just like you did for the first two, resume when you're done, and we'll go through the answers.
Welcome back again, hopefully that was okay for you.
Let's have a look at which one was which.
So which describes RAM and which describes ROM? One of them is volatile and the other is non-volatile, which is which? Let's have a look.
So volatile is RAM, so when power is turned off all the data that is stored in RAM is lost.
And ROM is non-volatile so it keeps those instructions, even when there is no power.
You can see how these will be tied to their functions, because RAM needs to be quick, and also should be clear when a computer starts up.
And ROM needs to store permanent instructions, that tell a computer how to boot up.
So the fact that it doesn't lose its data, when power is switched off is very important.
So the next question was about the size.
So do you think RAM or ROM is 6 to 8 megabytes, or 1 to 256 gigabytes.
Which one describes RAM and which one describes ROM? So ROM is usually very small with a limited number of instructions on there just to tell your computer, how to boot up.
They are about 6 to 8 megabytes big, depending on how complicated the startup procedure needs to be.
RAM on the other hand is expandable.
Now that can be anything from 1 to 256 gigabytes.
256 gigabytes is huge, and most commercially available RAM sticks will only go up to about 16 gigs.
You can buy professional PCs, for things like video editing that have more, but those are very expensive and usually very specialised.
Computer systems might also make use of virtual memory.
If we're running out of RAM space, your CPU might reserve some space in secondary storage, to use as an extension of RAM.
This is so it can store any instructions that are not needed until later, but still need to be ready to go, as soon as they are needed in secondary storage and they will be fetched as RAM is cleared.
So I have another pause point for you here.
I'd like you to think about this question and write it in your notes.
Why do computers perform better with more RAM? If you'd like to pause the video here make a note of your answer, try to answer it best you can and using the characteristics we've spoken about already today.
Why would computers perform better with more RAM? Welcome back, so let's have a look at the answer to this.
Why do computers perform better with more RAM? So with more RAM, a computer system has more room to store instructions and data in a location that is very fast to access.
More RAM means less time fetching data and instructions from secondary storage.
This means that the performance of your computer, and the speed it can execute a programme is greatly increased, the more RAM you have.
Next we're going to to look at another form of main memory called cache.
This memory plays an important role in improving the performance of a computer system, by saving frequently used instructions in a location that is even faster to access than RAM.
There are 3 levels of cache, that are commonly found in processors.
They are labelled with L1, L2 and L3 as you can see in the diagram on the right hand side here, L1 is directly inside the CPU, and L2 and L3 sit between the CPU and RAM.
As we go down the levels, the speed at which the data can be read from that part of cache decreases, but the size increases.
In other words, L1 is the fastest read speed but the smallest storage capacity.
And L3 is the slowest to access, although still faster than RAM but has the largest capacity of the 3 types of cache.
And even though level 3 is much slower than the other 2, it is still twice as fast as normal RAM.
So if we could read all of our instructions from L3 cache, our programme would run twice as fast.
Well, roughly twice as fast there are other factors that impact a computer's performance, but more on that in a later lesson.
To show you how cache can help speed up the processing of a programme on your computer.
I'm going to step you through an example programme, and show you the impact cache can have.
So here we have an example programme on the left here, already loaded into RAM, remember a very important stage.
It has to be loaded into RAM before it can be executed.
And a traditional way of executing this would be fetching each one from RAM, decoding it, and then executing it and then moving onto the next instruction.
Fetching it, decoding it, and then executing it.
And then on, and on until our programme is complete and we've output the result in this case.
Let's try running that programme again but, with cache this time to see how it will improve the performance of our processor.
So the process is very similar, but instead of just fetching from RAM our CPU is now going to check cache to see if there is a copy of the instructions saved inside.
For this first instruction input, there isn't one saved so it will be fetched from RAM decoded and executed.
This time we're going to save a copy of the instruction into cache just in case we need it again.
The process is then repeated, we check where the next instruction is and then check cache to see if we have a copy.
For the save instruction, we don't have a copy again.
So once again we're going to fetch it from RAM, decode it and then execute it, saving a copy of it to cache afterwards.
Our next instruction is an input command.
When we check the cache, we can see that we already have a copy of it.
This means that we can grab it from cache instead of RAM, which as I said is much quicker to read from.
We'll then pull that into the CPU, decode it and execute it just like normal.
Now this was a very simple programme where you can, you know, there's a minor benefit just that one instruction, but you imagine how much time this could save if you had a more complicated programme like this one.
You can see here that there are lots of repeated instructions, and the introduction of cache could greatly improve the performance of any computer running this programme.
Cache is great, but you cannot store instructions in cache permanently.
Eventually, they will need to be overwritten for newer instructions.
As I said, it would be great if we lived in a world where all instructions could be stored in L1 but unfortunately due to size limitations, that is not the case.
I've got another pause point for you here, and I'd like you to think about this question.
So out of the 3 levels of cache that we've just discussed, which one do you think would hold the most used commands and why? If you'd like to make a note of this on your notepad, and then pause the video while you're doing that, and then come back and we'll go through the answer.
Welcome back again, hopefully you were able to point out that the most used instructions should be stored in L1 because it is the fastest to access.
So therefore if you're using them more regularly than other instructions, you want them to be quicker to access.
And L3 would hold the least frequently used instructions and data.
That's all from me today.
Thank you so much for joining me for this lesson, and really well done on learning so much about main memory and cache.
The last thing I'd like to do is ask you to share your work with Oak National.
If you'd like to, of course, please ask your parent or carer to share your work on Instagram, Facebook, or Twitter, tagging @OakNational and #LearnwithOak.
I'll see you next time, happy learning.