Download presentation
Presentation is loading. Please wait.
1
M211 – Central Processing Unit
2
At the end of this lesson, students should be able to:
Learning Outcomes At the end of this lesson, students should be able to: Describe how data is processed by the CPU Control Unit (CU) Arithmetic Logic Unit (ALU)
3
Central Processing Unit
‘Like human beings, computers too have a ‘brain’ that processes raw information into unusable data.’ Users input data into the computer system and it is then processed by the Central Processing Unit or the CPU. The result of the processed data is then sent to an output device as usable data.
4
The Central Processing Unit or CPU is a microprocessor (or processor for short)
It is an integrated circuit chip that is capable of processing electronic signals. A CPU is the most important element in a computer system. It interprets instructions given by the software and carries out those instructions by processing data and controlling the rest of the computer’s components.
5
Nowadays, processors are found in all kinds of electronic devices such as cell phones, calculators, automobile engines, and even industrial and medical equipment. They process information so that humans can enjoy their effective and efficient operation.
6
A CPU consists of two subcomponents; the Control Unit (CU) and the Arithmetic Logic Unit (ALU)
7
Control Unit (CU) Basically the control unit’s function is to direct the CPU to process data. The control unit extracts instructions from memory and decodes and executes them. Under the direction of a program, the control unit manages a four-step basic operation which is called a machine cycle or processing cycle. Fetch and decode is in the instruction cycle whereas execute and store is in the execution cycle. Today’s microprocessor can go through this entire four step process billions of times per second.
8
Arithmetic Logic Unit (ALU)
Control Unit Bus Memory Decode Prefetch The Arithmetic Logic Unit (ALU), as its name implies, can perform all arithmetic and logical operations. Arithmetic operation is an operation that performs a function of two numbers. This function is usually one of the class of operations: add, subtract, multiply and divide. Logic operation is an operation on logical values, producing a Boolean result. In general there are 16 logic operations over one or two operands; they include AND, OR, NOT, NAND, NOR, XOR and equivalence.
9
How Data Is Processed by The CPU
When a user starts a program, its instructions are transferred from the storage device to the memory. The user enters the data needed by the program. The control unit then interprets and executes instructions in the memory. The Arithmetic Logic Unit then performs calculations on the data in the memory. As a result, information is then stored in the memory. Information can then be sent to an output device or a storage device.
10
Machine Cycles Each time the CPU executes an instruction, it takes a series of steps. The completed series of steps is called the machine cycle. A machine cycle itself can be broken down into two smaller cycles: the instruction cycle and the execution cycle. At the beginning of the machine cycle (that is, during the instruction cycle), the CPU takes two steps:
11
Fetching. Before the CPU can execute an instruction, the control unit must retrieve (or fetch) a command or data from the computer’s memory and puts it into a register. Decoding. The control unit then decodes (or decides what it means) the command into instructions that correspond to those in the CPU’s instruction set. It also determines the memory location of the data required. The first 2 steps together are called instruction time, or I-time.
12
At this point, the CPU is ready to begin the execution cycle:
Executing. When the command is executed, it is the arithmetic / logic unit executes the arithmetic or logical instruction. The ALU is given control and performs the actual operation on the data. Storing. The control unit may be required to store the results of an instruction in memory or in a register (but this condition is not always required). Steps 3 and 4 together are called execution time, or E-time.
13
Although the process is complex, the computer can accomplish it at an incredible speed, translating millions of instructions every second. In fact, CPU performance is often measured in millions of instructions per second (MIPS). Newer CPUs can be measured in billions of instructions per second (BIPS).
14
Even though most microprocessors execute instructions rapidly, newer ones can perform even faster by using a process called pipelining (or pipeline processing). In pipelining, the control unit begins a new machine cycle – that is, it begins executing a new instruction – before the current cycle is completed.
15
Executions are performed in stages:
When the first instruction completes the “fetching” stage, it moves to the “decode” stage and a new instruction is fetched. It is helpful to think of a pipeline as an assembly line. Each instruction is broken up into several parts. Once the first part of an instruction is done, it is passed to the second part. Since the first step in the line is now idle, the pipeline then feeds a new step one. Using this technique, newer microprocessors can execute up to 20 instructions simultaneously.
16
Modern operating systems, support the running of many programs, or multitasking. The CPU may be asked to perform tasks for more than one program. To make this work, the OS and the CPU create threads. A thread is one instruction from a program. The CPU will execute one thread from a program at one time. Since the CPU can perform each thread quickly, the user thinks that each program is being run at the same time. Newer processors support hyperthreading. Hyperthreading allows multiple threads to be executed at one time.
17
End of M211
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.