Computer Organization Executing an Instruction popo Computer Organization

  • Slides: 17
Download presentation
Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction • Fundamental Concepts • Processor fetches one instruction at

Computer Organization, Executing an Instruction • Fundamental Concepts • Processor fetches one instruction at a time and perform the operation specified. • Instructions are fetched from successive memory locations until a branch or a jump instruction is encountered. • Processor keeps track of the address of the memory location containing the next instruction to be fetched using Program Counter (PC). popo

Computer Organization, Executing an Instruction • Fetch the contents of the memory location pointed

Computer Organization, Executing an Instruction • Fetch the contents of the memory location pointed to by the PC. • The contents of this location are loaded into the IR (fetch phase). • IR ← [[PC]] • Assuming that the memory is byte addressable, increment the contents of the PC by 4 (fetch phase). • PC ← [PC] + 4 • Carry out the actions specified by the instruction in the IR (execution phase). popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction • Type of instructions • Transfer a word of

Computer Organization, Executing an Instruction • Type of instructions • Transfer a word of data from one processor register to another or to the ALU. • Perform an arithmetic or a logic operation and store the result in a processor register. • Fetch the contents of a given memory location and load them into a processor register. • Store a word of data from a processor register into a given memory location. • All operations and data transfers are controlled by the processor clock. popo

Computer Organization, Executing an Instruction • Register Transfers popo

Computer Organization, Executing an Instruction • Register Transfers popo

Computer Organization, Executing an Instruction • Performing an Arithmetic or Logic Operation • The

Computer Organization, Executing an Instruction • Performing an Arithmetic or Logic Operation • The ALU is a combinational circuit that has no internal storage. • ALU gets the two operands from MUX and bus. • The result is temporarily stored in register Z. • What is the sequence of operations to add the contents of register R 1 to those of R 2 and store the result in R 3? – R 1 out, Yin – R 2 out, Select. Y, Add, Zin – Zout, R 3 in popo

Computer Organization, Executing an Instruction • Fetching a Word from Memory • The response

Computer Organization, Executing an Instruction • Fetching a Word from Memory • The response time of each memory access varies (cache miss, memory-mapped I/O, …). • To accommodate this, the processor waits until it receives the requested operation has been completed (Memory-Function-Completed, MFC). • Move (R 1), R 2 • MAR ← [R 1] • Start a Read operation on the memory bus • Wait for the MFC response from the memory • Load MDR from the memory bus • R 2 ← [MDR] popo

Computer Organization, Executing an Instruction Execution of a Complete Instruction Add (R 3), R

Computer Organization, Executing an Instruction Execution of a Complete Instruction Add (R 3), R 1 Fetch the instruction Fetch the first operand (the contents of the memory location pointed to by R 3) • Perform the addition • Load the result into R 1 • • popo

Computer Organization, Executing an Instruction • Execution of a Complete Instruction • Add (R

Computer Organization, Executing an Instruction • Execution of a Complete Instruction • Add (R 3), R 1 popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction • Layered view of a computer system • •

Computer Organization, Executing an Instruction • Layered view of a computer system • • The layered hierarchical view of the computer system illustrates how the operating system interacts with the users of the computer system: popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction • A computer system can be divided into four

Computer Organization, Executing an Instruction • A computer system can be divided into four components • Hardware • Operating System • Application programs • Users popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction popo

Computer Organization, Executing an Instruction • Hardware: the CPU, the memory and the I/O

Computer Organization, Executing an Instruction • Hardware: the CPU, the memory and the I/O devices • Provides the basic computing resources for the system • Application programs: - like word processors, spreadsheets, compilers, web browsers • Provides the way in which these resources are used to solve user’s problems • OS: controls and coordinates the use of the h/w among the various application programs for the various user • Users • The ultimate use of the computer is to provide one or set of applications • The user of these applications is called end users • Is not concerned with the computer architecture • User views a computer in terms of an application popo

Computer Organization, Executing an Instruction • That applications can be expressed in a programming

Computer Organization, Executing an Instruction • That applications can be expressed in a programming language and is developed by an application progm • An application is a set of machine instructions that is completely responsible for controlling the h/w • Some of these prog are called utility prog such as • Management of files • Control of i/o • The most important system prog is called OS • Os masks the details of the h/w from the programmer and provide an interface with system • OS acts as a mediator making it easier for the programmer and for the application programs to access and use those facilities and services. popo