Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPU Processor-on-a-chip.

Similar presentations


Presentation on theme: "CPU Processor-on-a-chip."— Presentation transcript:

1 Lecture No 9 Central Processing Unit Memory and Its Types Factors Affecting Speed

2 CPU Processor-on-a-chip.
The CPU is the computer’s brain that manipulates data. It follows the instructions of the software to manipulate data into information.

3

4 CPU’s Two Basic Parts Each CPU has two parts: Control Unit
Arithmetic Logic Unit

5

6 Control Unit It manages all the computer’s resources.
It tells the rest of the computer system how to carry out a program’s instructions. It directs the movement of electronic signals between main memory and ALU/Input Output Devices. The control unit stores the CPU's microcode, which contains the instructions for all the tasks the CPU can perform.

7 Arithmetic Logic Unit It performs the CPU’s arithmetic and logical operations The actual manipulation of data takes place in the ALU. Arithmetic Operations: Addition, Subtraction, Multiplication and Division Logical Operations: Comparisons, Equal to, Less than, Greater than.

8 The Control unit and ALU also contain set of registers to enhance the computer’s performance.
- These are high speed staging areas that temporarily store data during processing and provide working areas for computation. - These hold material that is to be processed immediately. e.g. Control Unit might load two numbers from memory into the registers in the ALU. Then it might tell ALU to divide the two numbers.

9 Machine Cycle A Machine cycle is a series of operations performed to execute a program instruction. It consists of two parts: Instruction cycle Execution cycle

10 Instruction Cycle Fetching Decoding
During the instruction cycle, the CPU fetches (Gets) a command or data from main memory and decodes it (Determines what it means)

11 Execution Cycle Executing Storing During the execution cycle, the CPU executes the instruction (Performs the Operation on the data), and may store the instruction's result in memory/Register

12 Processing Speeds There are three ways in which processing speeds are measured: Time to complete one machine cycle in fractions of a second. Time to complete instructions in millions of instructions per second. Time in floating point operations per second.

13 Pipelining Also called pipeline processing.
The control unit begins a new machine cycle before the current cycle is completed

14 Memory Allows the CPU to store and retrieve data quickly.
It consists of chips either on the motherboard or on a small circuit board attached to the motherboard. There are two kind of built-in memory: 1) Non-Volatile Memory 2) Volatile Memory

15 Kinds of Memory Read-only memory (ROM): nonvolatile
- These retain the data even when the computer/power is turned off. The data cannot be changed except through a special process that overwrites the data. The Data in these is only read and used.

16 Kinds of Memory Random-access memory (RAM): volatile
A Memory that temporarily holds data and instructions that will be needed by the CPU. Data can be stored and retrieved at random. RAM stores data and program code needed by the CPU. The contents of RAM change rapidly and often.

17 Other Kinds of RAM 1) Dynamic RAM (DRAM) - DRAM Variations
2) Static RAM (SRAM) Dynamic RAM (DRAM) chips must be recharged with electricity very frequently, or they will lose their contents. Static RAM (SRAM) does not need to be recharged as often as DRAM, and can hold its contents longer. Flash memory, can store its contents after power is turned off.

18 Factors Affecting Processing Speed
Registers – temp memory area – 32 bit Memory and computing power - RAM System clock – Hz – cycles - GHz The bus – the highway The data bus – CPU & devices The address bus – CPU & RAM Cache memory – L1(CPU resident), L2 (External)

19 How RAM Affects Speed? More RAM means the computer can use bigger, more powerful programs and those programs can access bigger data files. More RAM can also make the computer run faster. When we run WINDOWS, the program does not need to load all its files into memory to run properly. It loads only the most essential parts into memory. When the computer needs access to other parts of the program on the disk, it can unload or Swap out non essential parts from RAM to Hard disk.

20

21

22 Bus Internal Bus (System Bus):
It refers to the path between the components of a computer. Two main buses: Internal Bus (System Bus): -It resides on the motherboard and connects the CPU to other devices. 2) External Bus (Expansion Bus): - It connects external devices to the CPU.

23 Data Bus It is an electrical path that connects the CPU, Memory and other hardware devices on the motherboard. No of wires in the bus affects the speed at which data can travel between hardware components. 8- wire bus can move 8 bits at a time.

24 Address Bus It is a set of wires similar to data bus.
It connects only the CPU and RAM and carries only memory address

25 Bus Types Industry standard architecture (ISA) bus 16 bit – connect devices Local bus – internal Peripheral Component Interconnect (PCI) bus – fast 32 and 64 bit Accelerated Graphics Port (AGP) bus -video Universal Serial Bus (USB) – fast - no slots IEEE 1394 (FireWire)- fast - no expansion slots

26 Cache memory Speeds processing by storing frequently used data or instructions in its high-speed memory

27 Creating Computer Programs

28 Computer Program A set of instructions or statements, also called code, to be carried out by the computer’s CPU.

29 Examples of Common Program Extensions
Executable (.EXE) files Dynamic link library (.DLL) files Initialization (.INI) files Help (.HLP) files Batch (.BAT) files

30 Files Typically, a program is stored as a collection of files. Some common file types used in programs are: Executable (.EXE) files actually send commands to the processor. Dynamic Link Library (.DLL) files are partial .EXE files. Initialization (.INI) files contain configuration information for a program. Help (.HLP) files contain information for the user.

31 Interrupt A preprogrammed set of steps that the CPU follows.

32 Machine Code Also called machine language.
The 1s and 0s that form the language of computer hardware.

33 Programming Language A Higher-level language than machine language, enables the programmer to describe a program using a variation of basic English.

34 Source Code File where programming language results are kept.

35 Ways to Convert Source Code to Machine Code
Compiler – converts a source code program into machine language. Creates an executable file. C++, Java, COBOL, Fortran, Visual Basic Interpreter – translates the code ‘on the fly’. Results immediately. No executable file produced. BASIC, Unix, Perl

36 Program Control Flow The order in which program statements are executed

37 How Programs Solve Problems – Program Control Flow
The order in which program statements are executed is called program control flow. To determine program control flow, programmers may use a flowchart to map the program's sequence. Programmers may also create a simple text version of a program's code – called pseudo code – to determine how the program will flow.

38 Flowchart A chart that uses arrows and symbols to show the order in which a program’s statement will run.

39

40 Pseudo code Simplified text version of programming code.

41 Algorithm The steps represented in a flowchart that lead to a desired result are called an algorithm.

42 Common Flow Patterns Conditional statement:
- A conditional statement determines whether a condition is true. If so, control flows to the next part of the program. Loop: - A loop repeats again and again until a condition is met. Control then passes to another part of the program.

43

44 Examples of Loops For While Do-while

45 How Programs Solve Problems - Variables and Functions
A variable is a named placeholder for data that is being processed. Programs contain variables to hold inputs from users. A function is a set of steps that are followed to perform a specific task. By assembling a collection of functions together, a developer can build a complete program.

46 Structured Programming
The practice of building programs using a set of well-defined structures.

47 Three Control Structures of Structured Programming
Sequence structure (flow of the program) – branch Selection structures (if blocks – T/F) Repetition or looping structures (checks a condition – loop repeats while condition is true

48 Syntax Programming language rules.

49 Syntax Examples Provide information in a certain order and structure
Use special symbols Use punctuation (sometimes)

50 Three Programming Categories Based on Evolution
Machine languages Assembly languages Higher-level languages

51 Fading Third-Generation Languages
FORTRAN (FORmula TRANslator) COBOL (COmmon Business Oriented Language) BASIC (Beginner’s All-Purpose Symbolic Instruction Code) Pascal

52 Thriving Third-Generation Languages
C C++ Java ActiveX

53 Fourth-Generation Languages (4GLs)
Builds programs with a front end, which is an interface that hides much of the program from the user Provides prototypes, which are samples of the finished programs.

54 Examples of Fourth-Generation Languages
Visual Basic (VB) VisualAge Authoring environments

55 World Wide Web Development Languages
HyperText Markup Language (HTML) Extensible Markup Language (XML) Wireless Markup Language (WML) Dream weaver Flash Director


Download ppt "CPU Processor-on-a-chip."

Similar presentations


Ads by Google