1 / 19

A451: Computer Systems and Programming

Learn about the Central Processing Unit (CPU) and its purpose, functions, and components. Discover how the CPU processes data, executes instructions, and affects computer performance.

isteven
Download Presentation

A451: Computer Systems and Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A451: Computer Systems and Programming

  2. 2.1.2The CPU

  3. Learning Outcomes • (a) state the purpose of the CPU • (b) describe the function of the CPU as fetching and executing instructions stored in memory • (c) explain how common characteristics of CPUs such as clock speed, cache size and number of cores affect their performance. • Friday, 26 September 2014

  4. Follow these instructions Please read all of the instructions before doing anything, you are allowed 10 minutes. • Find a pen and paper. • Write your name at the top of the paper. • Write the numbers 1 to 5, one per line. • Draw five small circles beside #1. • Put an "X" in the second and fourth circles next to #1. • On the back of the paper multiply 7 x 9. • Put an X in the lower right-hand corner of the paper. • Draw a circle around the X you just made. • Underline your name. • Say your name out loud. • Draw a circle around #4. • Count the number of words in this sentence and write the answer beside #2 on your paper. • Put a square around #1 and #5. • Punch 3 small holes anywhere in the paper. • Say your name out loud. • Circle every letter 'E' you have written. • Stand up and say 'I HAVE FINISHED FIRST' if you were first, else say 'I HAVE FINISHED' out loud, then sit down. • Now that you read all of the instructions, skip all of them except the first two! If you have followed the instructions correctly, you should only have your name on the paper!

  5. The CPU Think of all the functions that your brain performs and write them down. A CPU is often compared in similarity to a human brain. It is the brain of the computer CPU stands for Central processing unit, it processes all of the data and instructions that it receives and then executes and actions them. It is also referred to as a processor.

  6. Purpose of the CPU and the tasks it performs The CPU communicates between the input and output devices and the computers memory. The CPU receives instructions in machine code / binary and performs calculations. The data and results are stored in the Memory often referred to the IAS, (Immediate access store) or RAM. The result of these calcuations then informs the CPU what instructions to relay back to the input and output devices. If a user clicks the print icon, the instructions for printing are loaded into the computers memory, its RAM. The CPU then collects each instruction and executes it, Then it collects the next instruction and executes that. This continues until the last instruction is processed. This cycle is know as the Fetch, Decode, Execute cycle.

  7. Make-up of the CPU Inside the CPU are two main components that work together with a IAS to process and interpret code. CU ALU ALU – ARITHMETIC AND LOGIC UNIT – performs calculations and comparisons and Boolean operations CONTROL UNIT –Controls hardware and software devices and performs the fetch decode execute cycle IAS IAS – Immediate Access Store – holds data and programs currently in use (RAM)

  8. Functions of the Control Unit The control unit (CU) is responsible for ensuring that the computer executes the current instruction that is stored in memory. Therefore the control unit must communicate with both the arithmetic logic unit (ALU) and main memory (IAS). Inside the CU is an Instruction Register which stores the information about which circuits need to be activated, switched on or off. The program count incrementally updates to keep track of which instruction is currently being executed REGISTER: Stores which circuits should be activated Program Counter: updates by one after every instruction has been executed

  9. Functions of the ALU The control unit then instructs the arithmetic logic unit (ALU) to complete the required mathematical equations or logic operation. The ALU can be thought of as a powerful calculator. Operations include addition, subtraction, multiplication and division, logic operations compare values and conditions such as equal-to, less than and greater-than. Relational operations (=, <, >) are used to describe the comparison operations used by the arithmetic logic unit. The also arithmetic logic unit performs logic functions such as AND, OR and NOT. Once these calculation are completed the Control unit responds to the result and initiates the appropriate output.

  10. Encoding instructions • The result of these calculates and the required data or instructions are encoded and stored as ‘bit patterns”. A combination of zeros and ones that represent a value. • These bit patterns are stored in memory addresses. Imagine a row of houses, each house has an address, when you load a program each of these individual instructions are stored at the next ascending address.

  11. Encoding instructions • The CPU stores the memory address of the of the first instruction. • The contents of this address are then FETCHED. • The CPU DECODES the instruction • The CPU EXECUTES the instruction • The memory address value is incremented by one, (identifying the next memory address location)

  12. CPU Speed A CPU’s speed is referred to as it’s clock speed. This is a measure of the frequency that the CPU completes one instruction and is measured in Hertz. Modern day clock speeds are upwards of 3.5GHertz. This is approximately, 3’500’000’000 instructions being executed a second. • The G stands for Giga which is a prefix for 1 billion or 1’000’000’00 instructions a second. • A CPU executing the code print “hello world” may require several thousand instructions to produce the outcome the user see on the screen.

  13. Moore’s law Moore’s law original stated that, “the number of transistors on integrated circuits doubles approximately every two years”, A transistor is a component which can be switched on or off to amplify a signal. More transistors means a longer string of ‘zeros’ and ‘ones’, therefore more data can be stored or used. Moore’s law implies that a CPU’s capability and performance should double every two years transistors years

  14. Other impacts in speed Clock speed alone is not a true indication of the processing power of a CPU: Cores: Many of todays CPUs are duel or quad core . A core is a mini processor built within CPU. The benefit of this is seen when multitasking as each core can individually process instructions for a particular program without it slowing down overall performance of the computer. Imagine your ability and what you could do if you had four brains instead of one! Cache: This high speed memory storage is closer to the CPU than RAM and can therefore be accessed faster. Frequently used software instructions are stored in the Cache and can be recalled as required. This speeds up the overall processing time.

  15. Game • CPU (Central Processing Unit) • This student is given the program to run and is responsible for telling the other components (students) what they need to do. • ALU/Memory (Arithmetic/Logic Unit & Memory) • This student keeps track of the current values of x and y and performs any math operations requested by the CPU. • Display • This student responds to “plot” commands from the CPU by plotting the x,y values on the display grid.

  16. ALU Display CPU

  17. Discussion • What is the purpose of the exercise? • The single-most important “take-away” from this exercise is the following: • The computer had no idea what was being drawn on the display - it was just mindlessly following the instructions in the program. • Does the computer understand what it is doing? • Drawing a picture of a cat is the same (from the computer's perspective) as drawing a picture of a dog - it's just a series of instructions to execute. • Whose responsibility is it to make sure the computer works properly? • What happens if the CPU tells the display to plot an x or y value that is greater than 9? • What happens if the CPU is faster than the display? • What happens if the display is faster than the CPU?

  18. True OR False • CPU stands for Central Processing Unit • The ALU performs calculates and arithmetic. • Clock speed is a measure of memory • The program counter keeps track of which program instruction is currently being executed • The Central Unit controls the memory • Decode, Fetch, execute • The IAS performs logic calculation • CPU speed is measured in Hertz • processors can only have one core

  19. Plenary “Share with your table one new thing you have learnt today” Log onto Socrative and complete the Learning questions What have you learnt today?

More Related