1 / 55

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

Lecture No 9 Central Processing Unit Memory and Its Types Factors Affecting Speed. 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 . CPU’s Two Basic Parts.

millicent
Download Presentation

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

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. Lecture No 9Central Processing UnitMemory and Its TypesFactors 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. CPU’s Two Basic Parts Each CPU has two parts: • Control Unit • Arithmetic Logic Unit

  4. 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.

  5. 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.

  6. The Control unit and ALU also contain set of registers to enhance the computer’s performance. • Registers: - These arehigh 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.

  7. 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

  8. 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)

  9. 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

  10. 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.

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

  12. 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

  13. 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.

  14. 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.

  15. 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.

  16. 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)

  17. 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.

  18. 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.

  19. 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.

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

  21. Bus Types • Industry standard architecture (ISA) bus16 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

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

  23. Creating Computer Programs

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

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

  26. 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.

  27. Interrupt • A preprogrammed set of steps that the CPU follows.

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

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

  30. Source Code • File where programming language results are kept.

  31. 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

  32. Program Control Flow • The order in which program statements are executed

  33. 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.

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

  35. Pseudo code • Simplified text version of programming code.

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

  37. 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.

  38. Examples of Loops • For • While • Do-while

  39. How Programs Solve Problems - Variables and Functions • A variable is a named placeholder for data that is being processed. Programs contain variables to holdinputs 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.

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

  41. 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

  42. Syntax • Programming language rules.

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

  44. Three Programming Categories Based on Evolution • Machine languages • Assembly languages • Higher-level languages

More Related