When I Was Asked To Convert A Small C Program Fragment To Mips Assembly Language I Produced The Following Code Version 1 (64.66 KiB) Viewed 27 times
When I Was Asked To Convert A Small C Program Fragment To Mips Assembly Language I Produced The Following Code Version 2 (56.28 KiB) Viewed 27 times
When I Was Asked To Convert A Small C Program Fragment To Mips Assembly Language I Produced The Following Code Version 3 (43.74 KiB) Viewed 27 times
When I was asked to convert a small C program fragment to MIPS assembly language, I produced the following code (version ck): add $2,$5, $6 1w $3,20 ($4) sub $1,$2,$3 17-18-FA CS281 Final 1/5 However, when I compiled the C code with gcc-02-mips 1, the gcc compiler produced the following code (version gcc): 1w $3,20 ($4) add $2,$5, $6 sub $1,$2,$3 where the option -mips1 is telling the compiler to produce code for the MIPS architecture. Explain in detail WHY the compiler rearranged the code? Use the figures on the following pages to: Describe in detail what happens inside the pipelined processor when the three instructions of the gcc version go through the pipeline. Explain how data flows inside the processor and what exactly is done by the Forwarding unit. Focus on the clock cycle when the SUB instruction is in the Execute stage. How many hazzards are present? What are these hazzards? Highlight the paths of data flow during this clock cycle. Show the values of all the signals of the forwarding unit and explain why the signals have those values.
PC Instruction [25-0] 26 Instruction [31-26] Instruction [25-21] Read address Instruction [20-16] Instruction [31-0] Instruction Instruction [15-11) memory Instruction [15-0] Add Jump address [31-0] PC +4[31-28] RegDst Jump Branch MemRead MemtoReg ALUOP MemWrite ALUSIC RegWrite Shift left 2/ 28 Control XERO Read register 1 Read data 1 Read register 2 Write Read register data 2 Write data Registers 16 Sign- extend, Instruction [5-01 32 Shift left 2 ALU result Add, OMUX- Zero ALU ALU result ALU control MUX אכב Read data Address Write Data data memory MUKD
PCWrite Instruction memory IF/DWrite IF ID Instruction Hazard detection unit o 01 XEM Registers IFAD.RegisterRs IF/ID.RegisterAt IF/ID.RegisterAt IF/ID.RegisterRd ID/EX.RegisterAt ID/EX.MemRead ID/EX WB M EX led Rs XEM) XEM EX/MEM WB M ALU Forwarding unit Data memory MEM/WB WB
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!