22
8/13/2019 The CPU and Memory http://slidepdf.com/reader/full/the-cpu-and-memory 1/22

The CPU and Memory

  • Upload
    rob

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 1/22

Page 2: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 2/22

© Boardworks Ltd 20132 of 22

By the end of this presentation you will have learned :

the purpose of the Central Processing Unit (CPU )

the role of the Control Unit (CU ) and Arithmeticand Logic Unit (ALU)

the fetch, decode, execute cycle

how clock speed and cores affect a processor’sperformance

the main forms of memory: ROM , RAM , cache ,flash , and virtual

the impact of changing technology.

Learning objectives

Page 3: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 3/22

© Boardworks Ltd 20133 of 22

The CPU

CPU stands for Central Processing Unit . It is the core of

every computer and is comparable to the brain because itprocesses all data and executes instructions.

It is often referred to as the processor.

The CPU has two main components:

The control unit (CU ) controls the hardware and softwaredevices and performs the fetch, decode, execute cycle .

The arithmetic and logic unit (ALU)performs all arithmetic and logical operations,such as calculations and comparisons.

Page 4: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 4/22

Page 5: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 5/22

© Boardworks Ltd 20135 of 22

The fetch, decode, execute cycle

Fetch

Execute

Decode

As soon as a computer is switched on, the CPU runs a

recurring fetch, decode, execute cycle.Instructions arefetched from thememory

Instructions aredecoded andprepared

Instructions areexecuted

The cycle is repeated so that more data can be loaded.

Page 6: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 6/22

© Boardworks Ltd 20136 of 22

Key terms

Page 7: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 7/22

© Boardworks Ltd 20137 of 22

The control unit (CU)

The control unit (CU) is responsible for informing the system

what to do so that instructions are executed, a bit like ateacher assigning work to a class.

The CU manages all of the computer’s programs by directingthe flow of data between the CPU and other devices.

The CU must communicate with both the arithmetic logicunit (ALU) and main memory (IAS).

It controls an instruction register that can transferinstructions or data and perform arithmetic and logicalcomparisons at high speed. Registers are used by theCU as temporary, convenient places to store theinformation necessary to decode and execute.

Page 8: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 8/22

© Boardworks Ltd 20138 of 22

Functions of the ALU

The Arithmetic and Logic Unit (ALU) is like a

powerful calculator. It receives codedinstructions from the control unit to completethe required calculations or operations.

The result of these calculations are stored

in an output register.

You may already be familiar with some of thecalculations an ALU carries out:

comparisons use relational operators (=, <, >) todetermine the relationship between values

logical operations use the logic gates AND, OR and NOT.

Page 9: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 9/22

© Boardworks Ltd 20139 of 22

Encoding instructions

Once a calculation is complete, the data is encoded as bit

patterns using the binary number system . These bit patternsare stored in memory addresses .

Memory addresses identify locations in a computer’s storagememory. Every memory address is numbered consecutively

and stores each part of the instruction in the correct order.

The CPU stores thememory address of theof the first instruction.

The addresscontents arefetched.

The CPUdecodes theinstruction

The CPUexecutes theinstruction

The process isrepeated for

the nextinstruction.

Page 10: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 10/22© Boardworks Ltd 201310 of 22

CPU speed

Modern day clock speeds are upwards

of 3.5 GHz. This is approximately3,500,000,000 instructions beingexecuted per second.

A CPU’s speed known as the clock speed . The clock

speed measures the frequency at which the CPU completesan instruction. Clock speed is measured in hertz (Hz ).

The G stands for giga , which is a prefix for 1 billion.

Even a very simple code usually requires several thousandinstructions to produce the outcome seen on the screen.

Page 11: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 11/22© Boardworks Ltd 201311 of 22

Moore’s law

Moore’s law is an observation that the number of transistors

on integrated circuits doubles approximately every two years. A transistor is a component which can be switched on or offto amplify a signal. More transistors means more complexcalculations can be carried out. This means that processor

speed increases.Moore’s law is used by the computer industry inlong-term planning.

Page 12: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 12/22© Boardworks Ltd 201312 of 22

Other impacts on speed

Clock speed alone is not a true indication of a CPU’s

processing power.

Mini processors called cores are built withinthe CPU. Modern CPUs are dual or quad core.This allows multitasking as each core canprocess a program’s instructions without slowingdown the overall performance of the computer.

The cache memory is a special high speed memory that canbe accessed quickly. Frequently used software instructionsare stored in the cache and are recalled when required. As aresult, the overall processing time is much quicker.

Page 13: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 13/22© Boardworks Ltd 201313 of 22

Cache memory

Most computers have several cache stores .

The cache memory stores the most commonly usedinstructions. This speeds up the fetch, decode, execute cyclebecause the data has already been fetched and decoded.

CPU

Cache

RAM

The CPU requests datafrom the cache. If available,the data is sent.

If the data is unavailable, it

is requested from the RAM(memory). Data is thentransferred to the cacheand then on to the CPU.

Page 14: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 14/22© Boardworks Ltd 201314 of 22

RAM and ROM

Memory stores program instructions and data in binary.

Two main types of computer memory that are essential inorder for a computer to run.

RAM stands for Random Access Memory . It

stores all the current instructions that a piece ofsoftware requires to run and temporarily storesdata being processed by the CPU.

ROM stands for Read Only Memory .The contents of ROM are programmedby the manufacturer and can only beread. ROM contains all the informationrequired for the computer to boot up.

Page 15: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 15/22© Boardworks Ltd 201315 of 22

RAM

RAM allows the computer to access any memory address

at random and read or write data to it.It uses electrical charge to determinethe value of a memory address. If theaddress has a charge, the value is 1.If it has no charge, the value is 0.This soon builds a sequence ofbinary code, which the CPU thenconverts into a set of instructions.

RAM is referred to as temporary or volatilememory because data stored as an electricalcharge can be wiped if the power supply is cut.

Page 16: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 16/22© Boardworks Ltd 201316 of 22

Memory space in RAM

When loading and using software, program instructions are

loaded into the RAM. If more software is loaded, morememory space is used. After a while the memory space willrun out and the RAM must overwrite previous addresses.

RAM is measured in megabytes(MB) or gigabytes (GB).

The larger the number, thefaster a program will run.

Increasing the amount of RAM will increase thecomputer’s overall speed.

Page 17: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 17/22© Boardworks Ltd 201317 of 22

ROM

Instructions are permanently saved in ROM and are present

even when the power is turned off ( non-volatile memory ).The contents are programmed by the manufacturer andcannot be deleted.

The transistors in the ROM chip areconnected in a particular way sothat even when the computer isturned off or there is a power failure,data is not lost.

An example of ROM is BIOS (Basic Input Output System ),a chip found in most computers that contains all theinstructions necessary to boot up.

Page 18: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 18/22© Boardworks Ltd 201318 of 22

RAM and ROM

Page 19: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 19/22© Boardworks Ltd 201319 of 22

Flash memory

Flash memory is a non-volatile computer storage

memory that can be electronically erased and rewritten.Flash memory’s proper name is EEPROM (ElectricallyErasable Programmable Read-Only Memory ).

Flash memory is used in SD cards, USB drivesand solid-state drives. It was developed in the1980s as a type of re-writeable ROM. It uses a‘flash’ of electric current to erase all or part ofits contents.

Flash memory devices are easy to manufacture, can holdlarge amounts of data and have no moving parts. They arealso faster, smaller and more durable than CD ROMs.

Page 20: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 20/22© Boardworks Ltd 201320 of 22

Virtual memory

If the RAM is full, content can be temporarily written to thehard disk and retrieved when required. This prevents thecomputer from slowing down.

Virtual memory is located on the hard disk and is used as

storage for program/software instructions that will not fitinto the RAM.

CPU

RAM

Virtualmemory

Page 21: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 21/22© Boardworks Ltd 201321 of 22

Changing technology

Traditionally, a CPU uses the electronic states of

charge/no charge to process instructions in binary code.However, recent advancements in technology have enabledcomputer scientists to create quantum computers .

A quantum computer uses positively chargedatoms to represent 1 and atoms with no chargeto represent 0. Millions of these states can bewritten onto an object the size of a pinhead.

The most significant benefit is that atoms can represent both 0and 1 simultaneously. While current computers perform onecalculation at a time, a quantum computer can perform severalcalculations at once, hugely increasing the clock speed.

Page 22: The CPU and Memory

8/13/2019 The CPU and Memory

http://slidepdf.com/reader/full/the-cpu-and-memory 22/22

True or false?