hardware lesson 1 1. find an online shop selling computers and find out the specific details of one...

26
Hardware Lesson 1 1

Upload: octavia-anna-copeland

Post on 28-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Hardware

Lesson 1

1

Find an online shop selling computers and find out the specific details of one of the computers they are selling:

1. How large is the hard drive?2. How much RAM does it have?3. What is the speed of the computer?4. How many cores does it have?

Starter

2

3

Objective of the LessonExplain what a CPU is and its role within a computer.

• All of you will:– Give a basic explanation for what a CPU does and how data is

stored in the memory.

• Most of you will:– Explain the roles of the CPU, the ALU and cache memory.– Explain what is meant by the phrase “clock speed”.

• Some of you will:– Describe the 3 levels of cache memory and how a bus transfers

data around the system. – Explain what factors can affect the speed of the processor.

4

• Everybody should complete Task 1. You need to write a definition in your own words for the key terms.

• Some of you may also want to get the extra marks by watching video and writing down 5 interesting facts that you have learnt.

• This homework is due in next lesson.

• Make sure you have written your homework clearly in your planner.

Homework

5

What is the CPU?• CPU stands for Central Processing Unit. • The CPU is the brains of the computer where

most calculations take place.• Without a CPU the computer would not work.

6

The CPUThe CPU has two main parts:• The Control Unit– This uses machine code (binary) to tell the

computer what to do and where to find the data in the memory.

• The Arithmetic and Logic Unit (ALU)– The performs the calculations such as add,

subtract and compare values (for instance equal to, greater than and less than).

7

How is Data Stored in a Computer?• Memory is split up into many different

sections and all of these locations have a location (“address”) which helps the computer find the data again.

• The data is stored in binary form as this is how a computer understands numbers.

Location 1 Location 2 Location 3 Location 4101010 100101 110110 000000

8

Role PlayI need 6 volunteers:• 1 person will be the CPU• 1 person will be the Arithmetic and Logic Unit• 1 person will be Memory Location 1• 1 person will be Memory Location 2• 1 person will be Memory Location 3• 1 person will be the Bus which carries the

instructions and data to the different parts.

9

Role Play Rules• The CPU is in charge of the rest of the volunteers.• In order to store or retrieve data, the CPU must tell the

Bus what to do.• In order to perform a calculation, the CPU must tell the

ALU what data to use, the calculation (add, subtract etc.) to do and where the answer should be stored.

• The Bus will help the ALU to do this by taking to and retrieving data from the relevant memory locations.

• The memory locations just need to remember the current value they have been given.

10

Role Play 1• The CPU must tell the bus to store the value 4

in location 1 and value 5 in location 2.• The CPU must tell the ALU to add these two

values together (it would first of all have to tell the bus to retrieve the data from the relevant locations).

• The answer must be stored in location 3.

11

Role Play 2• Using the values in the memory locations from the last role

play, try this one.• If the value in location 2 is less than location 1 then in location

3 store the value “true”, otherwise display the value “false”.• Make sure the CPU is still controlling what people are doing

and the Bus is retrieving and storing the data as appropriate and the ALU is the only one who is performing calculations. The CPU, the Bus and the memory locations cannot perform calculations themselves.

• The ALU cannot remember any data so it will need to be told the data it is to work with.

12

Role Play 3• CPU to tell the Bus to put the value 10 in

memory location 3.• CPU to tell the ALU unit to add 5 to the value in

memory location 3 and store the answer in memory location 1.

• CPU to tell the ALU to add together location 1 and location 3 and put the answer in location 3.

• CPU to tell the ALU to take location 2 away from location 3 and put the answer in location 3.

13

The Fetch-Execute Cycle• The CPU works on something

called the fetch-execute cycle.• It needs to fetch the data or

instructions from the memory locations (fetch)

• It needs to work out what these data or instruction mean (decode)

• It then performs that task (execute)

• The whole process is repeated again.

Fetch

Decode

Execute

14

What Happens When a Computer is Switched On?

• When the computer is first switched on the CPU will look in a specific location in the Read Only Memory (ROM) to tell it what the first instruction is to load and execute.

• This is what happens when it is “Booting up”. • This takes a little while as the computer has to get up and

running and load the operating system and get the computer started.

• After this process is completed, the CPU will hand over most of the control to the operating system to provide the programs for the computer to run.

15

Clock Speed• Scientists discovered that when an electronic

current is passed through a quartz crystal it vibrates at a constant speed.

• A quartz crystal is used to measure the speed that the fetch-execute cycle takes to complete and this is measured in hertz (Hz). The CPU synchronises all processes in line with this clock speed.

• 4 GHz means that the processor can complete 4 billion cycles every second.

• This means that, in theory, if the computer was doing nothing else it would be able to perform 4 billion simple calculations in a second.

16

Actual Clock Speed• Think back to the role play we did. • What would have happened to the speed of the

fetch-execute cycle if the memory locations were in another building instead of being in the same classroom?

• As the memory locations in the CPU are not located on the chip itself, the speed the computer actually performs its fetch-execute cycle is dramatically lower when the memory is further away.

17

Cache Memory• If the CPU has to wait for the values and instructions

to be returned from the main memory, this affects the speed at which it can work.

• To get around this problem, a cache memory is used which is smaller than the usual memory but is located a lot closer to the CPU.

CPU Cache Memory

Main Memory

Requests data

Data sent to CPU

If data is not in cache then data is retrieved from main memory

Next packet of data

copied to cache ready

18

Size of Cache• The more cache memory there is, the more

likely that the data will have already been requested from the main memory and placed into the cache. Therefore, it is less likely it will have to be retrieved from the main memory so the CPU can run faster.

• The cache memory is very fast but also very expensive so it is a lot smaller than the main memory in a computer.

19

Levels of CacheGenerally there are three levels of cache memory:• Level 1– This is usually located on the CPU chip itself but has a

very low capacity and runs at the same speed as the CPU.• Level 2– This is a little further away from the CPU and is larger but

slower than the CPU.• Level 3– This is the largest of the three levels but also the furthest

away and therefore the slowest.

20

Bus• Data is sent around

the system in “busses”

• A bus is a connection between the different parts of the motherboard.

• This allows data to transfer between the separate areas.

21

BusThe busses also

carry data between the CPU, memory

and the controllers for peripheral

devices such as the monitor, keyboard

and printer.

22

Multi-Core Processors• Instead of having just one processor, a dual-

core processor has two CPUs working together which can each fetch and execute instructions simultaneously - the computer is then able to process more instructions in the same amount of time.

• How many CPUs will a quad-core processor have in it?

23

Speed of a CPUWhat would affect the speed of the CPU?• Processor speed (in GHz)• Bus speed• Amount of Cache available• Number of cores available

24

Parts of a Processor

Work in pairs to join the names to their correct

description.

25

CPU Quiz• Copy the Lesson 1 CPU

Quiz file from the school’s network into your own work area.

• Double-click on the file to run it and try to complete the quiz by clicking on the correct answer.

• If you get an answer wrong you will have to start the quiz again.

26

PlenaryAnswer the following questions:1. What does the CPU do in a computer?2. What does the cache memory do?3. What is meant by level 1 cache?4. What decides how fast the computer can

run?5. What is meant by a quad-core processor?