1 / 16

The Computer Processor

The Computer Processor. A closer look. When a program is run, program and data are copied from the hard drive into Main Memory. Program. HARD DISK. MAIN MEMORY. A simple program that has been copied from the hard drive and put into main memory.

nyx
Download Presentation

The Computer Processor

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. The Computer Processor A closer look

  2. When a program is run, program and data are copied from the hard drive into Main Memory Program HARD DISK MAIN MEMORY

  3. A simple program that has been copied from the hard drive and put into main memory von-Neuman machine-Stored Program Approach. Where both the data and program stored in main memory

  4. Fetch-Decode-Execute • Fetch: The next instruction is fetched from Main Memory. • Decode: The instruction gets interpreted/decoded, signals produced to control other internal components (ALU for example). • Execute: The instructions get executed (carried out)

  5. The processor contains a number of special purpose registers. • A register is an extremely fast piece of on-chip memory used for small temporary storage. • Each of the special purpose registers have an important role, when a series of program instructions are fetched-decoded-executed.

  6. Special purpose registers R0 R1 R2 R3 R4 R5 General purpose registers Arithmetic Logic Unit Current Instruction Register Program Counter Status Register Control Unit Memory Address Register Memory Data Register

  7. The Program Counter R0 R1 R2 R3 R4 R5 The program counter holds the address of the next instruction that is to be fetched-decoded-executed. This will increment automatically as the current instruction is being decoded. Arithmetic Logic Unit Current Instruction Register Program Counter: 500 Status Register Control Unit Memory Address Register Memory Data Register

  8. Memory Address Register (MAR) R0 R1 R2 R3 R4 R5 The Memory Address Register (MAR) holds the address of the current instruction being executed. It points to the relevant location in memory where the required instruction is (at this stage the address is simply copied from the Program Counter). Arithmetic Logic Unit Current Instruction Register Program Counter: 500 Status Register Control Unit Memory Address Register: 500 Memory Data Register MAR  [PC] (contents of Program Counter copied to the Memory Address Register)

  9. Memory Data Register (MDR or MBR) R0 R1 R2 R3 R4 R5 The Memory Data Register can contain both instructions and data. At this stage, an instruction has been fetched and is being stored here en route to the Current Instruction Register. The instruction is copied from the memory location pointed to by the MAR. Arithmetic Logic Unit Current Instruction Register Program Counter: 500 Status Register Control Unit Memory Address Register: 500 Memory Data Register: LDA 1000 MBR  [Memory] addressed (Contents of addressed memory is copied to the memory buffer register)

  10. Current Instruction Register (CIR) R0 R1 R2 R3 R4 R5 The Current Instruction Register is used to store the current instruction to be decoded and executed (copied from the MDR). Arithmetic Logic Unit Current Instruction Register: LDA 1000 Program Counter: 500 Status Register Control Unit Memory Address Register: 500 Memory Data Register: LDA 1000 CIR  [MBR] (If contents of MBR is an instruction then it is copied to the Current Instruction Register)

  11. Decoding and executing the instruction R0 R1 R2 R3 R4 R5 The instruction in the CIR gets decoded. In this example, the instruction is telling the processor to load the value in memory location 1000 (03) to the accumulator (one of the general purpose registers are usually used for the accumulator). As this happens the Program Counter automatically increments. Arithmetic Logic Unit Current Instruction Register: LDA 1000 Program Counter: 503 Status Register Control Unit Memory Address Register: 500 Memory Data Register: LDA 1000 PC  [PC] + 1 [CIR] decoded and executed

  12. The Control Unit R0 R1 R2 R3 R4 R5 The control unit co-ordinates all of these fetch-decode-execute activities. At each clock pulse, it controls the movement of data and instructions between the registers, main memory and input and output devices. Arithmetic Logic Unit Current Instruction Register: LDA 1000 Program Counter: 503 Status Register Control Unit Memory Address Register: 1000 Memory Data Register: 03

  13. Status Register R0 R1 R2 R3 R4 R5 The Status Register stores a combination of bits used to indicate the result of an instruction. For example one bit will be set to indicate that an instruction has caused an overflow. Another bit will be set to indicate that the instruction produced a negative result. The Status Register also indicates whether an interrupt has been received (we will look at this later). Arithmetic Logic Unit Current Instruction Register: LDA 1000 Program Counter: 503 Status Register Control Unit Memory Address Register: 1000 Memory Data Register: 03

  14. Arithmetic Logic Unit R0 R1 R2 R3 R4 R5 The Arithmetic Logic Unit carries out any arithmetic and logical operations (calculations and value comparisons) required by any instruction that is executed. For example instruction at 503 would require the Arithmetic Logical Unit to add the number in location 1001 to the value already in the accumulator. Arithmetic Logic Unit Current Instruction Register: LDA 1000 Program Counter: 503 Status Register Control Unit Memory Address Register: 1000 Memory Data Register: 03

  15. Special Purpose Registers R0 R1 R2 R3 R4 R5 Arithmetic Logic Unit Current Instruction Register: LDA 1000 So why use special purpose registers for all of this passing of data and instructions, rather than using main memory? Program Counter: 503 Status Register Control Unit Memory Address Register: 1000 Memory Data Register: 03

  16. How much did you remember ? • Test time!

More Related