علوم مهندسی کامپیوتر و IT و اینترنت

داده های چند مرحله ای

dadehaye_chand_marhale`ee

در نمایش آنلاین پاورپوینت، ممکن است بعضی علائم، اعداد و حتی فونت‌ها به خوبی نمایش داده نشود. این مشکل در فایل اصلی پاورپوینت وجود ندارد.






  • جزئیات
  • امتیاز و نظرات
  • متن پاورپوینت

امتیاز

درحال ارسال
امتیاز کاربر [0 رای]

نقد و بررسی ها

هیچ نظری برای این پاورپوینت نوشته نشده است.

اولین کسی باشید که نظری می نویسد “داده های چند مرحله ای”

داده های چند مرحله ای

اسلاید 1: Department of Computer and IT EngineeringUniversity of KurdistanMIPS datapath (Multi-Cycle)By: Dr. Alireza Abdollahpouri

اسلاید 2: A Multi-cycle MIPS processorAny instruction set can be implemented in many different waysMIPS ISASingle CycleMulti-CyclePipelinedShort CPILong CCTLong CPIShort CCTShort CPIShort CCT2

اسلاید 3: A Multicycle ImplementationSingle-cycle versus multicycle instruction execution. 3

اسلاید 4: نگرش Multicycle Datapathهر دستور به تعدادی مرحله کوچکتر تقسیم شده و هر یک از این مراحل در یک کلاک اجرا میشوند. بدین ترتیب برای اجرای هر دستور به تعدادی کلاک کوچک تر نیاز خواهیم داشت.مراحل طوری انتخاب میشوند که کار انجام گرفته در آنها متعادل باشد.در هر مرحله فقط از یکی از بلوک های سخت افزاری اصلی استفاده میشود.هر دستور تعداد متفاوتی کلاک لازم دارد.فقط به یک حافظه نیاز دارد. البته در هر سیکل فقط میتوان یکبار به حافظه دسترسی داشت.فقط به یک ALU/adder نیاز دارد. البته در هر سیکل بیش از یکبار از ALU نمیتوان استفاده نمود.4

اسلاید 5: در این معماری مقادیری که در سیکلهای بعدی دستور مورد نیاز هستند در رجیسترهائی ذخیره میشوند. در نتیجه باید اجزای زیر به معماری افزوده شوند:IR – Instruction RegisterMDR – Memory Data RegisterA, B – regfile read data registersALUout – ALU output registerنگرش Multicycle Datapath AddressRead Data(Instr. or Data)MemoryPCWrite DataRead Addr 1Read Addr 2Write AddrRegisterFileRead Data 1Read Data 2ALUWrite DataIRMDRABALUout5

اسلاید 6: Our new adder setupWe can eliminate both extra adders in a multicycle datapath, and instead use just one ALU, with multiplexers to select the proper inputs.A 2-to-1 mux ALUSrcA sets the first ALU input to be the PC or a register.A 4-to-1 mux ALUSrcB selects the second ALU input from among: the register file (for arithmetic operations),a constant 4 (to increment the PC),a sign-extended constant (for effective addresses), anda sign-extended and shifted constant (for branch targets).This permits a single ALU to perform all of the necessary functions.Arithmetic operations on two register operands.Incrementing the PC.Computing effective addresses for lw and sw.Adding a sign-extended, shifted offset to (PC + 4) for branches.6

اسلاید 7: The multicycle adder setup highlightedResultZeroALUALUOp0Mux1ALUSrcA0123ALUSrcBReadregister 1Readregister 2WriteregisterWritedataReaddata 2Readdata 1RegistersRegWriteSignextendShiftleft 2PC40Mux1 RegDst0Mux1 MemToReg0Mux1IorDAddressMemoryMemDataWritedataMemReadMemWritePCWrite7

اسلاید 8: Eliminating a memorySimilarly, we can get by with one unified memory, which will store both program instructions and data. (a Princeton architecture)This memory is used in both the instruction fetch and data access stages, and the address could come from either:the PC register (when we’re fetching an instruction), orthe ALU output (for the effective address of a lw or sw).We add another 2-to-1 mux, IorD, to decide whether the memory is being accessed for instructions or for data.8

اسلاید 9: The new memory setup highlightedResultZeroALUALUOp0Mux1ALUSrcA0123ALUSrcBReadregister 1Readregister 2WriteregisterWritedataReaddata 2Readdata 1RegistersRegWriteSignextendShiftleft 2PC40Mux1 RegDst0Mux1 MemToReg0Mux1IorDAddressMemoryMemDataWritedataMemReadMemWritePCWrite9

اسلاید 10: Intermediate registersSometimes we need the output of a functional unit in a later clock cycle during the execution of one instruction.The instruction word fetched in stage 1 determines the destination of the register write in stage 5.The ALU result for an address computation in stage 3 is needed as the memory address for lw or sw in stage 4.These outputs will have to be stored in intermediate registers for future use. Otherwise they would probably be lost by the next clock cycle.The instruction read in stage 1 is saved in Instruction register.Register file outputs from stage 2 are saved in registers A and B.The ALU output will be stored in a register ALUOut.Any data fetched from memory in stage 4 is kept in the Memory data register, also called MDR.10

اسلاید 11: The final multicycle datapathResultZeroALUALUOp0Mux1ALUSrcA0123ALUSrcBReadregister 1Readregister 2WriteregisterWritedataReaddata 2Readdata 1RegistersRegWriteAddressMemoryMemDataWritedataSignextendShiftleft 20Mux1PCSourcePCA4[31-26][25-21][20-16][15-11][15-0]InstructionregisterMemorydataregister IRWrite0Mux1 RegDst0Mux1 MemToReg0Mux1IorDMemReadMemWritePCWriteALUOutB11

اسلاید 12: 12مسیر داده چند سیکله مسیر داده چند سیکله سه تفاوت عمده با مسیرداده تک سیکله دارد:1- حافظه برنامه و داده ادغام شده است2- تعدادی رجیستر برای ذخیره داده های میانی اضافه شده است3- واحد ALU وظیفه مدارات جمع کننده (برای مقصد پرش و محاسبه آدرس بعدی) را نیز انجام میدهد

اسلاید 13: Multicycle Datapath with Control 13

اسلاید 14: Multicycle control unitThe control unit is responsible for producing all of the control signals.Each instruction requires a sequence of control signals, generated over multiple clock cycles.This implies that we need a state machine.The datapath control signals will be outputs of the state machine.Different instructions require different sequences of steps.This implies the instruction word is an input to the state machine.The next state depends upon the exact instruction being executed.After we finish executing one instruction, we’ll have to repeat the entire process again to execute the next instruction.14

اسلاید 15: در معماری Multicycle سیگنالهای کنترل را نمیتوان فقط از روی بیت های دستورالعمل بدست آورد. از اینرو از یک ماشین FSM برای طراحی واحد کنترل استفاده میشود.تعدادی state محدود برای پردازنده فرض میشود که در state reg ذخیره میشوند.state بعدی از روی state فعلی ومقادیر ورودی تعیین میشوند.واحد کنترل MulticycleCombinationalcontrol logicState RegInstOpcodeDatapathControl pointsNext State. . .. . .. . .15

اسلاید 16: Finite-state machine for the control unitInstruction fetchand PC incrementRegister fetch andbranch computationEffective addresscomputationMemoryreadRegister writeOp = LW/SWOp = SWOp = LWMemorywriteR-type executionOp = R-typeR-type writebackBranch completionOp = BEQEach bubble is a stateHolds the control signals for a single cycleNote: All instructions do the same things during the first two cycles?????????

اسلاید 17: Stage 1: Instruction FetchStage 1 includes two actions which use two separate functional units: the memory and the ALU.Fetch the instruction from memory and store it in IR. IR = Mem[PC]Use the ALU to increment the PC by 4.PC = PC + 417

اسلاید 18: Stage 1: Instruction fetch and PC incrementResultZeroALUALUOp0Mux1ALUSrcA0123ALUSrcBReadregister 1Readregister 2WriteregisterWritedataReaddata 2Readdata 1RegistersRegWriteAddressMemoryMemDataWritedataSignextendShiftleft 20Mux1PCSourcePCABALUOut4[31-26][25-21][20-16][15-11][15-0]InstructionregisterMemorydataregister IRWrite0Mux1 RegDst0Mux1 MemToReg0Mux1IorDMemReadMemWritePCWritePC = PC + 4IR = Mem[PC]18

اسلاید 19: Stage 1 control signalsInstruction fetch: IR = Mem[PC]Increment the PC: PC = PC + 4We’ll assume that all control signals not listed are implicitly set to 0.SignalValueDescriptionMemRead1Read from memoryIorD0Use PC as the memory read addressIRWrite1Save memory contents to instruction registerSignalValueDescriptionALUSrcA0Use PC as the first ALU operandALUSrcB01Use constant 4 as the second ALU operandALUOpADDPerform additionPCWrite1Change PCPCSource0Update PC from the ALU output19

اسلاید 20: Finite-state machine for the control unitIorD = 0MemRead = 1IRWrite = 1ALUSrcA = 0ALUSrcB = 01ALUOp = 010PCSource = 0PCWrite = 1ALUSrcA = 0ALUSrcB = 11ALUOp = 010Instruction fetchand PC incrementRegister fetch andbranch computationEffective addresscomputationMemoryreadRegister writeOp = LW/SWOp = SWOp = LWMemWrite = 1IorD = 1ALUSrcA = 1ALUSrcB = 10ALUOp = 010MemRead = 1IorD = 1RegWrite = 1RegDst = 0MemToReg = 1MemorywriteR-type executionOp = R-typeALUSrcA = 1ALUSrcB = 00ALUOp = funcRegWrite = 1RegDst = 1MemToReg = 0R-type writebackBranch completionOp = BEQALUSrcA = 1ALUSrcB = 00ALUOp = 110PCWrite = ZeroPCSource = 120

اسلاید 21: Implementing the FSMThis can be translated into a state table; here are the first two states.You can implement this the hard way (hardwired control).Represent the current state using flip-flops or a register.Find equations for the next state and (control signal) outputs in terms of the current state and input (instruction word).Or you can use the easy way.Write the whole control signals into a memory, like a ROM.This would be much easier, since you don’t have to derive equations.Current StateInput (Op)Next StateOutput (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Output (Control signals)Current StateInput (Op)Next StatePC WriteIorDMemReadMem WriteIR WriteReg DstMemToRegReg WriteALU SrcAALU SrcBALU OpPC SourceInstr FetchXReg Fetch10101XX00010100Reg FetchBEQBranch compl0X000XX0011010XReg FetchR-typeR-type execute0X000XX0011010XReg FetchLW/SWCompute eff addr0X000XX0011010X21

اسلاید 22: Control UnitControl memoryControl Unit (micro-program)CAR: Control Address RegisterCARControl word To DataPathدر كنترل به صورت Micro program اطلاعات كنترلي در حافظه اي موسوم به حافظه كنترلي ذخيره ميگردد.22

اسلاید 23: 23CARControl Unit (micro-program)

اسلاید 24: Dispatch ROM 1Dispatch ROM 2OpOpcode nameValueOpOpcode nameValue000000R-formatRformat1100011lwLW2000010jmpJUMP1101011swSW2000100beqBEQ1100011lwMem1101011swMem1Microprogram containing 10 microinstructionsDispatch Table 2Dispatch Table 124Control Unit (micro-program)

اسلاید 25: در کامپیوترهای پیچیده تر حافظه کنترلی ممکن است شامل خانه های تکراری باشد حافظه كنترلي (کنترل به روش ریزبرنامه)25

اسلاید 26: 26حافظه كنترلي دو سطحی (استفاده از نانو حافظه)اگر در یک سیستم نیاز باشد که تعداد بسیار زیادی سیگنال کنترلی تولید شود و نیز تعداد سیگنالهای کنترلی مجزا محدود و تعداد کمی باشند، به جای قرار دادن تمامی این سیگنالها در حافظه میکرو، فقط سیگنالهای مستقل را در یک حافظه تحت عنوان حافظه نانو قرار داده و در حافظه میکرو آدرس این سیگنالها(کلمات) کنترلی را مشخص میکنیم. در این حالت، ما دیگر تعداد زیاد و تکراری کلمات کنترلی را در حافظه میکرو نداریم و به جای آن آدرسهای تکراری که حافظه کمتری اشغال میکنند را داریم. .مثال 1مثال 2

اسلاید 27: 27مثال: فرض کنید که در یک سیستم تعداد 300 کلمه کنترلی را داریم. از این 300 تا تعداد 60 کلمه مستقل هستند(240 تا تکراری هستند). اگر طول کلمات کنترلی 150 بیت باشد(تعداد سیگنالهای کنترلی 150 باشد) خواهیم داشت: 1- در حالت معمول و بدون استفاده از حافظه نانو، حجم حافظه میکرو برابر 300*150 است. 2- در صورت استفاده از حافظه نانو ، حجم این حافظه برابر 60*150 است. زیرا در این حافظه فقط قرار است که کلمات کنترلی مستقل و غیر تکراری قرار گیرند. در حالت دوم، حافظه میکرو فقط باید آدرس 300 تا کلمه کنترلی مورد نیاز را از حافظه نانو مشخص نماید. برای مشخص کردن (آدرس دهی) 60 کلمه کنترلی، به 6 بیت احتیاج داریم. چون سیستم به 300 سیگنال کنترلی نیاز دارد، پس در این حالت حجم حافظه میکرو برابر است با: 300*6. میزان صرفه جویی: bits 34200 = (300*6 + 150*60)-(300*150)حافظه كنترلي دو سطحی (استفاده از نانو حافظه)

اسلاید 28: 28حافظه كنترلي دو سطحی (استفاده از نانو حافظه)یک پردازنده دارای ۱۷۵ سیگنال کنترلی و ۲۵۰ ریزدستور است. اگر۲۰۰ ریزدستور متفاوت در این پردازنده وجود داشته باشد‌، حجم کل حافظه واحد کنترل در صورت استفاده از حافظه نانو چقدر است؟ الف- ۲۸۰۰۰بیت ب- ۳۲۰۰۰بیت ج- ۲۴۰۰۰بیت د- ۳۷۰۰۰بیت

اسلاید 29: SummaryA single-cycle CPU has two main disadvantages.The cycle time is limited by the worst case latency.It requires more hardware than necessary.A multicycle processor splits instruction execution into several stages.Instructions only execute as many stages as required.Each stage is relatively simple, so the clock cycle time is reduced.Functional units can be reused on different cycles.We made several modifications to the single-cycle datapath.The two extra adders and one memory were removed.Multiplexers were inserted so the ALU and memory can be used for different purposes in different execution stages.New registers are needed to store intermediate results.29

اسلاید 30: 30Questio

18,000 تومان

خرید پاورپوینت توسط کلیه کارت‌های شتاب امکان‌پذیر است و بلافاصله پس از خرید، لینک دانلود پاورپوینت در اختیار شما قرار خواهد گرفت.

در صورت عدم رضایت سفارش برگشت و وجه به حساب شما برگشت داده خواهد شد.

در صورت نیاز با شماره 09353405883 در واتساپ، ایتا و روبیکا تماس بگیرید.

افزودن به سبد خرید