1 / 12

Elements of the Computer (How a processor works)

Elements of the Computer (How a processor works). C.S. French Chapter 19. The Computer itself. Processor. Memory. Control Unit. ALU. 1 2 3 4 5 6 7 8 9 10 11 12. CIR. Accumulator. SCR. Input Output Unit. Peripheral Devices. MAR. MDR. Data Bus. Terms. Memory

libitha
Download Presentation

Elements of the Computer (How a processor works)

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. Elements of the Computer(How a processor works) C.S. French Chapter 19

  2. The Computer itself. Processor Memory Control Unit ALU 1 2 3 4 5 6 7 8 9 10 11 12 CIR Accumulator SCR Input Output Unit Peripheral Devices MAR MDR Data Bus

  3. Terms • Memory • main memory (RAM), electronic, fast, volatile, expensive, holds data currently in use. • made up of many general purpose storage locations. • may hold data or instructions. • locations referred to by their ‘addresses’. • Data Bus • a set of wires for transmitting data. • Processor • controls the computer and carries out processing. • Register • a special purpose storage location in the processor. • Control Unit • controls the loading and execution of instructions. • MDR (Memory Data Register) • holds data temporarily as it enters and leaves the processor.

  4. More Terms • ALU (Arithmetic and Logic Unit) • carries out arithmetic and logic operations. (add, subtract, AND, NOT etc) • Accumulator • holds the result of the last operation carried out by the ALU. • CIR (Current Instruction Register) • holds the instruction that is currently being interpreted and executed by the Control Unit. • MAR (Memory Address Register) • holds the address of the memory location which is currently connected to the data bus. (controls access to memory) • SCR (Sequence Control Register) • holds the address of the memory location of the instruction that is to be executed after the current one is finished. • this is ‘incremented’ by 1 each time it is copied to the MAR.

  5. Peripheral Devices • Input • keyboard, mouse, bar-code readers, camera, microphone etc • Output • screen, printer, plotter, mechanical device etc. • Communications • modem, ISDN adaptor, network card etc. • Backing Storage • slow, non-volatile, usually mechanical, cheap. • floppy disk, hard disk, CDROM, magnetic tape, zip disk

  6. How the computer works. • Machine instructions and data are stored in memory in binary format. • A machine instruction consists of 2 parts: • Operation code: holds the binary code for the operation that is to be carried out by the processor. • Operand address: this is the address in memory where the processor may find the data that is to be operated on. • Machine instructions are ‘fetched’ from memory and then ‘executed’ by the processor. From this slide and the next, 1st years would be expected to be able to describe the principle of the fetch/execute cycle as opposed to the details of how this cycle is implemented.

  7. The Fetch/Execute cycle. • The address of the next instruction to be executed is copied from the SCR to the MAR. • The SCR is incremented by 1. • The information is copied from memory to the MDR. • The contents of the MDR is copied to the CIR. • The operation code part of the instruction in the MDR is copied to the control unit. • The control unit recognises the instruction and executes it (the execution will vary depending on the instruction).

  8. The LOAD instruction.(Not required for 1st years) • Purpose: to load data from memory to the accumulator. • The operation address part of the CIR is copied to the MAR. • The location in memory is copied to the MDR. • The MDR is copied to the accumulator.

  9. The STORE instruction(Not required for 1st years) • Purpose: to copy the contents of the accumulator to a location in memory. • The operation address part of the CIR is copied to the MAR. • The accumulator is copied to the MDR. • The MDR is copied to the location in memory .

  10. The ADD instruction(Not required for 1st years) • Purpose: to add the contents of a memory location to the contents of the accumulator. • The operand address in the CIR is copied to the MAR. • The contents of memory is copied to the MDR. • The MDR contents are copied to the ALU which adds it to the accumulator, placing the result in the accumulator.

  11. The JUMP instruction. (Not required for 1st years) • Purpose: to transfer control in a program to an instruction other than the next one. • The contents of the operand address are copied to the SCR. • Variations: • JUMP NEGATIVE • JUMP ZERO • JUMP POSITIVE • The contents of the operand address are only copied to the SCR if the accumulator is in the correct condition.

  12. Machine language exercises(Not required for 1st years) • Given the binary codes for these machine instructions write the programs described below. • LOAD 0001 • STORE 0010 • ADD 0011 • JUMP 0100 • JUMP + 0101 • JUMP - 0110 • JUMP 0 0111 • Program to add together the contents of memory locations 10 and 11 and store the result in location 12. • Program to count down from 9 to zero.

More Related