# Lesson video

In progress...

Hey there, and welcome back to computer systems. I'm Mac, your computing teacher for this unit.

In this lesson, we're going to talk about computer specifications and some of the factors that affect a CPU's performance.

As usual, you're going to need a notepad and a pen to take notes while you're learning, and I'd also like you to remove all distractions from around you.

Like usual, I've also got my water bottle here and I want you to make sure you've got some refreshment if you need it throughout the lesson.

If you want to pause the video here and get everything you need, I'll be here when you get back.

In this lesson, you are going to examine the factors that affect a CPU's performance and evaluate a computer's specifications.

Let's start off by looking at what my CPU won't do.

I'm having a bit of trouble running a computer programme.

I'll be given a list of test scores from pupils across the country and I need to sort them into descending order before I analyse them.

I've run a short programme to test out an algorithm and it currently is taking far too long.

Let's have a look at that programme now.

So this is my programme.

I'm just going to talk you through a few bits of it so you know what's going on.

So first, my programme is going to generate me 150 random numbers.

I'm then going to run a simple sorting algorithm on them, which you can see here.

And I also want to know how long my programme has taken.

So the top here, I set the start time and then I set an end time when my programme is finished running.

So I should get a printout of how long my algorithm has taken at the end of it.

Let's start that going now.

As I said, it's going to take quite a long time so we're going to head back to the slides and then we'll come back to check on it a bit later.

So while that's running, let's have a look at the scope of my problem.

So the programme currently takes about 70 seconds, which might not seem like a long time, but this programme needs to run for every pupil in every subject at school, and that time will really add up.

I think I can solve the problem by upgrading my computer.

Specifically, I think a faster processor will help me out.

What can you use to measure the speed of a processor? If you'd like to pause the video here, I'd like you to make some notes about what sort of things we can use to measure the speed of a processor.

When you resume, we'll head back to the programme and see how long it's taken.

Right, now that we're back in my programme, you can see the time it's taken up in the top.

It's taken about 67 seconds, and that's just for 150 scores so you can see how if I scale this across the thousands of students that are taking every subject in every school across the country, that time will add up to taking absolutely years for my programme to run.

Now, I really need a faster processor to help me out.

Hopefully, in thinking about what we can use to measure the speed of a processor, you noted down a few key areas that we've spoken about already.

So clock speed is one of them, cache size is another, and the amount of cores the CPU has is the third.

We're going to take a deep dive into those issues in this lesson.

I'll see you back at the slides in a second.

Right, so I want to upgrade my processor and I think I found a suitable replacement.

Over on the left-hand side of the slide here, you can see my old processor, which is up at the top that has a clock speed of 1.

5 gigahertz.

And you can see my new processor in the bottom which has a clock speed of 3 gigahertz.

What I'd like you to do is pause the video here and head over to your worksheet and have a go at answering the following two questions.

What is the difference between these two processors? And not just the clock speed has gone up, What is the physical difference, how will they be different at executing programmes? And how will this impact of the execution of my programme? What change will I see? Will it improve it? Will it take longer? I want you to figure out, write down some answers and then head back and we will go through them.

Pause the video now.

I'll see you when you get back.

Welcome back.

How did you get on? Let's have a look at some of the answers now.

So what is the difference between these two processors? Well, the clock speed has increased from 1.

5 gigahertz to 3 gigahertz.

A gigahertz means a billion pulses per second.

So my original processor was capable of doing 1.

5 billion clock pulses per second and the new processor can do 3 billion.

If the clock is pulsing quicker, it means the processor is able to complete more fetch-decode-execute cycles.

How many more cycles do you think it could complete? If you said twice as many, you're not alone.

And in theory, it could do twice as many but in practise, the speed that your computer processes instructions is the result of all the components working together.

A processor that is twice as quick can not make all the other components run twice as fast as well.

So the headline is a faster clock speed improves performance.

So what impact will it have on the processing of my programme? It will go quicker.

It might not necessarily be twice as fast but it will certainly increase the processing speed.

If you want to make a note of this, it's an important point you need to remember.

So a faster clock speed improves performance.

Right then, with that noted down, let's carry on.

So my programme now runs a bit faster.

It's taking about 45 seconds now but it is still too slow on this new processor.

If I extrapolate that 45 seconds across the thousands of students I need to use it on, it's still going to add up to far too long.

I haven't got that much time to run my programme.

So I found another new processor that I'm sure will fix my problem this time.

On the left side here, you can see my two processors again.

So the old one, which is the one we're currently on, has 8 megabytes of cache.

And the new one, which is at the bottom there, has 16 megabytes of cache.

If you remember, cache is the onboard memory of the CPU that bridges the gap between main memory, RAM, and the internal CPU components.

The new processor has twice as much cache as the old processor.

The processing speed would increase as cache size gets bigger.

So this means my programme would take less time the more cache I have, right? So if the processing speed increases, it means the time taken to process goes down.

What are the reasons for that change? I'd like you to pause the video here and head over to your worksheet and have a go at answering this question.

So why does more cache mean my programme takes less time to execute? If you want to presume when you're done, we'll go through the answers.

See when you get back.

Welcome back.

How did you get on? Did you know why it would decrease as my cache size gets bigger? Well, fetching from RAM is much slower than cache.

You remember those three levels are all much quicker than RAM with L1 cache being the quickest.

If less instructions can be stored at any one time in cache, the processor will have to fetch more from RAM.

On top of that, if RAM gets full, then it's even slower to go fetch more instructions from secondary storage.

So with more cache, more instructions can be stored and quickly available to the CPU, which means my speed increases and the processing time will go down.

Again, I'd like you to make sure you have this noted down 'cause it's a very key point you should make sure that you remember.

You want to do that now and we'll carry on afterwards.

Cool, hopefully you got that noted down and you're going to remember it.

Underline it a few times just to make sure.

So just to wrap up, the performance of a CPU core is affected by the clock speed and the cache size, and an increase in either will improve the performance of the processor, right? These are the key points from the activity.

Now let's keep going.

Next, we're going to have a look at the cores of a CPU.

So far, we've been treating every CPU as if it only has one core.

This is not the case for most modern processors.

In fact, most modern processors will have between two, which are called dual-core, and eight, which are called octa-core processors, right? And each core can complete its own fetch-decode-execute cycles.

So I think one last upgrade will really fix my computer problems. This new processor has four cores, whereas my old processor only had two.

Again, in theory, my processor is going to now do twice as many cycles per second, right? If there's twice as many cores and they can complete their own fetch-decode-execute cycles, you would think I could do twice as many fetch-decode-execute cycles in the same time.

But.

Some programmes can be split and executed on each core separately.

If they're very different instructions, they can be executed individually on each core.

But some instructions will need to use data from a previous instruction, right? So if we did a calculation first, we might need that for our next instruction.

And if that instruction was on another core, the data needs to be transferred between them.

So in order to share data, the cores are connected by channels and important data can be sent from one core to another across these channels.

On the right-hand side here, you can see some diagram showing how these channels are set up for different core counts.

So a single core needs no channels, right? Because it's just one core.

It does the same fetch-decode-execute cycles.

Dual-cores will on have one channel connecting the two of them so they can communicate with each other.

Three cores would have three channels.

Four cores would have six channels as you can see in this bottom diagram here, so they're all connected.

Now this means that some of the clock pulses will be used to send data between the cores, slowing the processing speed.

This excess computational cost is called an overhead.

So another activity for you here.

I have a statement: I think the doubling the amount of cores in my processor will make it twice as fast.

I want you to write a response to that statement that begins with I disagree because.

You want to head over to your worksheet, you have all this information there for you to complete the activity.

Come back when you're done and we'll go through it.

I'll see you when you get back.

Welcome back.

I hope you're able to write a statement disagreeing with my statement of doubling the amount of cores will make my process at twice as fast.

Hopefully you've picked up a pattern here.

Let's have a look.

Here's an example answer for you so you can see whether yours matches up.

I disagree with the statement because the extra cores cannot make the other components in my computer run twice as fast.

There is also an overhead computational cost that comes from sharing data between the cores.

For these reasons, the processor will not be twice as fast.

With that over, let's have a look at how we can choose the right computer.

In this activity, I have three computer specifications for you to consider: A, B, and C.

So A has a 1.

5 gigahertz dual-core processor with 4 gigabytes of RAM and 128-gigabyte hard drive.

Computer B has a 2 gigahertz quad-core processor with 8 gigabytes of RAM and a 556-gigabyte hard drive.

And the final computer, computer C, has a 3 gigahertz octa-core processor, 16 gigabytes of RAM, and a terabyte SSD.

So as you can see, they improve as you go up, right? A is the lowest spec'd computer and C is the high spec'd computer.

Now I'm going to show you a task you could use these computers for and I want you to decide which computer is the appropriate one for that task.

Now there isn't anything for you to do on your worksheet this time.

All I want you to do is decide which one it is and point to the screen and then we'll talk about it.

So, which one do you think is, is it A, B or C that you would need for editing Word documents? Now this doesn't mean that all the computers couldn't do it.

I just want you to choose the lowest spec that you possibly need.

Right, have you got it? I'm going to give you three seconds.

Three, two, pick one, point on the screen, one.

Let's have a look.

So for editing Word documents, really, all you need is computer A.

You don't need a huge amount of RAM or a super fast processor to edit Word documents.

In fact, computers like Chromebooks are just for Word processing and they connect you to the internet with barely any onboard components at all.

So if you just need a computer for editing Word documents, you don't need the highest spec.

Let's have a look at another one.

How about playing video games? So some video games can be quite taxing but others are pretty simple.

Which computer do you think has the lowest spec you could use for playing video games? I'm going to give you five seconds to choose.

Five, four, three, choose one, two, one, ready? All right, so in this one, we would use computer B.

Now, as I said, some video games can be quite taxing so having a bigger amount of RAM is very useful, and it's also useful to have a bit of a quicker processor.

The important point here is that you do not need the top spec'd computer if all you're going to be doing is playing video games.

And 556 gigabytes on a hard drive is more than enough room to store the games you'd want to play.

So if you want a computer that's just for playing video games, you can do with a medium spec'd computer, okay? Left have another go.

How about programming? So if you're creating a piece of software and programming, which one of these three computers do you think would be the most appropriate? I'm going to give three seconds for this one to choose.

Have you chosen one? Go.

Now this one was a bit of a trick question because really, there's two computers that might be the right answer and it depends on what you are programming.

If you're just writing simple Python files to test out your computing knowledge and to learn how to code, then a simple computer spec will be more than sufficient.

Computer A would be perfect for you.

However, if you're doing some more taxing programming with things like GUI, graphical user interface applications, you might want something more on the medium spec'd side like computer B.

The point is, again, if you're programming as long as you are not doing anything that requires huge amounts of processing power, you do not need the fastest computer available to complete your tasks.

Let's have at one last one.

How about creating 3D animation? So creating models, rendering lighting, animating them all and putting all the different objects in the scene.

Which of the computers do you think you would need? I'm going to give you three seconds for this one.

You ready? Three, pick one, two, one.

Have you chosen? Right, this is one of the only tasks that you would need a computer like computer C to do.

Creating 3D animations is one of the most taxing things you can do on a computer, and often these actually require much bigger computers than computer C.

The point is you should be able to choose the appropriate spec'd computer for what you're trying to do.

It can be tempting to fall for marketing and say, "Oh, I absolutely need the highest spec'd computer I can possibly get," but you should carefully consider what you're doing on your computer before choosing.

That's all for me today.

Thank you so much for your hard work.

I hope you enjoyed this lesson.

And one last thing before we go, I'd like to ask you to share your work with Oak National.