انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 2
أستاذ المادة نور كاظم ايوب مهدي المهدي
20/04/2017 09:56:53
Lecture 6: Instruction Fetch Cycle By Noor Kadhum Architecture For 2nd class- Computer Dep. Babylon University -Sciences College For Women Important registers to execute the instruction There are some registers that play important role during the implementation of instructions, these include: 1 - Registers in direct contact with memory: Memory can communicate with the processor through two registers which operate as an interface between the two components: - MDR: Which is used to store data that comes from (read operation) or goes to (write operation) memory. - MAR: Used to store the address of the information read or written. Any information stored in memory is represented by two things: value and address If the CPU writes certain data to memory, it must provide this value in (MDR) and the address where the value stored is placed in (MAR) . If the CPU reads certain data: the processor must provide the address for that value by placing this address in (MAR) and the memory will be equipped with the required data. In turn, the processor will receive this data in (MDR) 2- Other recorders include: - PC (Program Counter) : It is also known as (IP) which is sequencing the instructions that are executed. It always refers to the next address. - IR (Instruction Register): If the information read from the memory is an instruction, it moves from (MDR) to this register, and here the process of decoding is begun. in this phase, information like: a- the type of operation to be executed (through OPCODE field). b- the number of operands. c- the type of operands and the place of storage (through the addressing modes field). Is extracted from instruction. Introduction to ALU The execution of any operation subjects to the control of ALU. In the simplest design, this unit have three inputs and one output, as seen in figure below:
ALU architecture In order to execute any of the four operations, the three entries must take values so that the required operation line can be activated. Note that: - The carry line cannot be activated with Y line. if one is activated, the other will have a value of 0. Set carry makes the value of this line equal to 1 Clear y: used to make the value of Y line equal to 0
- If the computer needs the value of any register, a copy of this value is put on a direct line Fetching an instruction When the program is executed, it is stable in the memory during the working period. the program consists of a set of instructions. In order to implement these instructions, they must be transferred to the processor. The process of reading the instruction from memory and transferring it to the processor is called Fetch Cycle. The following diagram shows the fetching process: address
data (Instruction) Fetch cycle of instruction The steps of Fetch cycle is constant for all types of instructions, these steps are: 1- MAR receive the address of instruction from PC, a copy of PC is now on direct line of ALU. A signal (read) is issued to inform the memory about the type of request. At this point PC and AR have the same address!, for this reason the content of PC must be updated by increasing PC by 1 to indicate the next address. Obviously , pc=pc+1 is a mathematical operation that needs ALU :
Using ALU to implement pc=pc+1 As mentioned, The content of PC is in the direct line, the value (1) is provided by setting carry line which makes Y zero. Now, the entries of ALU is activated so, the CPU can implement pc=pc+1 and the output is stored in Z ,temporary.
Z= Y + Direct+ Carry Z= 0+PC+ 1 Z=PC +1 (the updated PC)
2- The new address is stored in Z and it must be moved to PC . PC= Z
3- After the updating of pc is completed, the instruction is read form memory and it is temporally resident in MDR. Because the read data is an instruction, it will be transferred from MDR to IR to start the next stage, the decoding and execution cycle.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم
|