Presentation is loading. Please wait.

Presentation is loading. Please wait.

20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

Similar presentations


Presentation on theme: "20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems."— Presentation transcript:

1 20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems sjmaybank@dcs.bbk.ac.uk Autumn 2015 Week 4b: CPU and the Machine Cycle

2 20 October 2015Birkbeck College, U. London2 Action of a Computer 1  Recall Tom and his boxes  Instruction: add the contents of box a and box b, put the result in box c.  The part of a computer corresponding to Tom is the central processing unit (CPU) 10 acbde f g 512-3111

3 20 October 2015Birkbeck College, U. London3 Action of a Computer 2 Tom has to:  Read the contents 10 of box a and the contents 5 of box b.  Add together 10 and 5 to get 15.  Write 15 in box c. 10 acbde f g 512-3111

4 20 October 2015Birkbeck College, U. London4 Summary of the Actions of the CPU  Obtain an instruction  Read data from main memory  Calculate  Write data to main memory  The CPU has its own memory for calculation

5 20 October 2015Brookshear, Section 2.15 Computer Architecture arithmetic/logic unit register unit central processing unit : registers bus main memory control unit

6 20 October 2015Brookshear, Section 2.16 Central Processing Unit Register: small amount of very fast read/write memory, e.g. enough to store one number. Arithmetic/Logic Unit: operates on data in registers, e.g. addition, subtraction. Control Unit: controls the ALU. ALU Control Unit Register Unit......

7 20 October 2015Brookshear, Section 2.17 Concepts Places for storing bit strings: registers, main memory Transfer of bit strings from one place to another, eg main memory->register Operations on bit strings: produce a new bit string from one or more given bit strings.

8 20 October 2015Brookshear, Section 2.18 Some Actions of a Computer ALU CPU registers bus main memory 1. Take a bit string from main memory and put it in a register. 2. Take a bit string from a register and put it in main memory. 3. Move a bit string from one register to another. 4. Take bit strings bi from registers Ri, i=1, 2. Interpret b1, b2 as two’s complement representations of integers, add them and put the result in the register R3. control unit

9 20 October 2015Brookshear, Section 2.19 Bus Wires connecting CPU to main memory. Read: CPU sends read signal and address of memory cell. Write: CPU sends write signal, address, and data to be written. Length ~15cm. Speed of light = 30cm in 1 ns. Time for CPU to access a register ~ 2.5 ns. The bus should be short.

10 20 October 2015Brookshear, Section 1.210 Logical Structure of Main Memory List of cells addressed from 0 to 2 n -1, where n is a large integer. All cells contain the same number of bytes, e.g. 1 byte. If a register contains 16 bits then the number of cells that can be addressed using the register is at most 2 16.

11 20 October 2015Birkbeck College, U. London11 Memory Access Times Access Time Size CPU registers 2.5ns256 bit RAM60 ns~1 GB Hard disk15 ms2 TB Tape10min10 TB

12 20 October 2015Brookshear, Section 2.112 Stored Program Concept The program is stored in main memory along with the data. The control unit reads both instructions and data from the main memory. This is the von Neumann architecture. Advantage: the program can be changed easily. Disadvantage: high traffic on the bus. This is the von Neumann bottleneck.

13 20 October 2015Brookshear, Section 2.313 The Machine Cycle Fetch next instruction from memory to CPU Decode the bit pattern Execute the instruction Fetch Decode Execute

14 20 October 2015Brookshear, Section 2.314 CPU and Main Memory in More Detail Address | Cells 00 01.... FF Arithmetic/ logic unit control unit Registers.... 0 F 1 Program counter Instruction register Bus Main memory Central processing unit

15 20 October 2015Brookshear, Section 2.315 Special Registers Program counter: contains the address of the next instruction to be executed. Instruction register: holds the instruction which is being executed.

16 20 October 2015Brookshear, Section 2.316 Adding Values Stored in Memory 1.Get the first value from memory and place it in a register. 2.Get the second value from memory and place it in another register. 3.Activate the addition circuitry with the registers in 1 and 2 providing the inputs and another register to hold the result. 4.Store the result in memory. 5.Stop.

17 20 October 2015Brookshear, Section 2.117 Counting Bits No. bits to specify a register: 4 No. bits to specify a memory cell: 8 No. instructions (eg): 13 Instruction: add the contents of two registers, put the result in a third register No. bits: at least 4+(3x4) = 16

18 20 October 2015Brookshear, Section 2.318 System Clock Circuit generating pulses at regular intervals. The computer’s activities are in step with the pulses, e.g. 5 pulses for an addition. Current clock speeds ~ 2 GHz. (=2 pulses per nanosecond). Clock speed only a rough guide to performance, e.g. instructions per second.

19 20 October 2015Brookshear, Section 2.119 Motherboard  Main circuit board of the PC.  Contains the central processing unit (CPU) and the bus.  Components, e.g. memory, hard drive interface, plug into the motherboard to obtain power and communicate with the CPU.

20 20 October 2015Birkbeck College, U. London20 Example of a Motherboard http://en.wikipedia.org/wiki/Motherboard


Download ppt "20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems."

Similar presentations


Ads by Google