Presentation is loading. Please wait.

Presentation is loading. Please wait.

Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Similar presentations


Presentation on theme: "Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization."— Presentation transcript:

1 Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization & Assembly Language Lecture 3 (Computer System Organization) Processors

2  From text book: 2.1, 2.1.1, 2.1.2  The Von Neumann Machine  CPU Organization  Instruction Execution  Timing  Control Unit  CISC vs. RISC  Design Principles for modern Computers 2Processors

3 3  The first version of modern computer designed by John Von-Neumann  It is the basis for the majority of digital computer designs  Its main features are:  Using binary arithmetic  Representing the program in a digital form inside the computer’s memory  Organizing the steps of the computer operation into a cycle of decode-fetch- execute.

4 4Processors  It is the brain of the computer  Its function is to execute programs stored in main memory by fetching instructions, decoding them, and executing them. CPU Main Memory (IOP)O-DI-D Registers Control Unit ALU  It consists of 3 main components  Arithmetic Logic Unit (ALU)  Control Unit  Registers

5 5Processors  Internal components of the CPU:  I. ALU: Arithmetic & Logic Unit responsible for manipulating data  II. Control Unit: Directs the flow of information. It controls where every bit of data goes  III. Registers: High speed memory locations used to store temporary results & certain control information CPU MAR Control Unit MDR PC IR R0R0 R1R1 :::::: R n-1 ALU Registers

6 6Processors (A)(A)(B)(B) ALU A + B) A + B A B Registers ALU input register ALU output register ALU input bus

7  The figure corresponds to the data path of a typical Von-Neumann machine  Not all designs have the input registers A & B or the output register.  It consists of:  Registers (Typically 1 to 32)  ALU  Several busses connecting the pieces 7Processors

8 1. The registers feed into the ALU input registers A & B 2. The input registers hold the input data while the ALU does the execution 3. The ALU performs simple operations such as addition, subtraction, and Boolean logic on its inputs 4. The output value is fed into the ALU output register 5. The result is then stored in one of the registers in the register stack 6. The value of the register could be then saved in memory if required 7. The cycle repeats a gain for any other operation in the ALU 8Processors

9 9  The data path is very important in all machines  Not all machines have the input registers A & B or the output register  The process of running two operands through the ALU and storing the result is called the data path cycle.  The faster the data path cycle is, the faster the machine runs.

10 10Processors  Most instructions can be divided into one of the two categories:  Register – Register Instructions: Involve instructions between registers  Register – memory Instructions:  Allow memory words to be fetched into registers, where they can be used as ALU inputs in subsequent instructions.  Allow registers to be stored back into memory.

11 11Processors A machine instruction has two parts: Opcode Operands Specify the type of operationImmediate data or address OpcodeOperand 1Operand 2 16 bits 4 bits6 bits

12 12Processors  There are three main registers in a typical ALU:  Program Counter Register (PC): It holds the address of the next instruction to be fetched for execution  Instruction Register (IR): It holds the instruction currently being executed  Accumulator Register (AC): It accumulates arithmetic results

13 13Processors  The processing required for an instruction is called an instruction cycle.  Instruction cycle = fetch-decode-execute cycle  The program is executed one instruction at a time.  The execution of the program is nothing more than a repeated sequence of fetching, decoding, & executing individual instructions, until the program executes a Halt or until a fetal error occurs

14 14Processors Obtain instruction from program storage Instruction Fetch Instruction Decode Operand fetch Execute Result Store Next Instruction Determine required actions Locate and obtain operand data Compute result value and status Deposit result in storage Determine successor instruction

15 1. Fetch the next instruction from memory into the instruction register 2. Change the program counter to point to the following instruction 3. Determine the type of instruction just fetched 4. If the instruction uses a word in memory, determine where it is. 5. Fetch the word, if needed, into the CPU register 6. Execute the instruction 7. Go to step 1 to begin executing the following instruction 15Processors

16 16Processors Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Program code void main(void) { : a = 2; b = 5; a = a + b; }

17 17Processors Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 357 Start PC AC IR

18 18Processors CPU PC AC IR Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Fetch 357 Fetch Load 100 in AC 358 2 A register

19 19Processors CPU Load 100 in AC PC AC IR Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Execute 358 Execute 2 2 A register

20 20Processors CPU 2 Load 100 in AC PC AC IR Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Fetch 358 Fetch Add 101 to AC 359 5 A register

21 21Processors CPU Add 101 to AC PC AC IR Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Execute 359 Execute 2 + 5 = 7 5 A register

22 22Processors CPU 2 + 5 = 7 Add 101 to AC PC AC IR Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Fetch 359 Fetch Store AC in 100

23 23Processors CPU 7 Store AC in 100 PC AC IR Main Memory 97 98 99 100 101 357 358 359 2 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Execute 359 Execute 7

24 24Processors CPU 7 Store AC in 100 PC AC IR Main Memory 97 98 99 100 101 357 358 359 7 5 Load contents of 100 into AC Add contents of 101 to AC Store contents of AC to 100 360 361 Halt 359

25 25Processors  Can we run a program that imitate the function of the CPU?  Yes, by using an interpreter.  This machine can be much simpler & less expensive than a hardware processor.  A hardware machine should also be provided (in order to run the interpreter)

26 26Processors Voltage Time Train of clock pulses  To ensure that the steps of an instruction are carried out in an orderly fashion a clock circuit controls the processor by generating a train of clock pulses.

27 27Processors  The time interval between two pulses is known as a clock period  The clock rate or speed corresponds to the number of pulses per second, measured in Mega Hertz (MHz). 1 MHz = 1 million cycles per second  The computer circuits perform an operation on the clock pulse  Each step in the instruction execution cycle requires one or more clock periods  If the clock circuit is sped up, the processor could be made to operate faster. However, each processor has a rated maximum clock speed over which it can’t operate properly

28  The control unit of the microprocessor is the one responsible for controlling the sequencing of events needed for the execution of an instruction, as well as the timing of this sequence of events.  It obtains instructions from memory in the proper order, and sends them to IR.  Decode them, and issue the necessary timing and control signals to all other devices so that the instructions can be executed correctly.  The control unit is complemented by a clock or timing generator that helps it trigger the occurrence of each event at the correct point in time. 28Processors

29  There are two major types of control organization:  Hardwired control  Microprogrammed control 29Processors  This control determines the instruction set of the computer and it is mainly split into two main categories:  RISC: (Reduced Instruction Set Computer)  CISC: (Complex Instruction set Computer)


Download ppt "Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization."

Similar presentations


Ads by Google