EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考




您的位置: 主页 > 理科代写案例 > 数学代写案例 >
数学代考:math考试代考,数学作业代写 - math代考
发布时间:2021-07-25 17:21:43浏览次数:
2.4Conditions that the MiniCPU should haltIf one of the following situations is encountered, the global flag Halt is set to 1, and hence the simulation halts.An illegal instruction is encountered. Instructions beyond the list of instructions in Figure 1 are illegal.Jumping to an address that is not word-aligned (being multiple of 4)The address of lw or sw is not word-alignedAccessing data or jump to address that is beyond the memory.2.5Format of the input machine code fileMiniCPU takes hexadecimal formatted machine codes, with filename xxx.asc, as input.  An example of .asc file is shown below. Code after “#” on any line is treated as comments.20010000    #addi $1, $0, 0200200c8    #addi $2, $0, 20010220003    #beq $1, $2, 300000020    #delay slot20210001    #addi $1, $1, 100000020    #no operationThe simulation ends when an illegal instruction, such as 0x00000000, is encountered.2.6Note on branch addressingThe branch offset in MIPS, and hence in MiniCPU, is relative to the next instruction, i.e. (PC+4). For example,3.Resources3.1Files provided Please download from, the following are files after unzip:minicpu.c minicpu.h component.c    incommandtest01.asm test01.asc test02.asm test02.asc Computer Organization代写These files contain the main program and the other supporting functions of the simulator. The code should be self-explanatory. You are required to fill in and modify the functions in component.c. You are not allowed to modify minicpu.c and minicpu.h. All your works should be placed in component.c only. You are not allowed to add new files. Otherwise, your program will not be marked.3.2 MIPS assemblerA simple assembler is provided for your convenience of testing your MinCPU. The command is:$ filename.asm filename.ascwhere filename.asm is your assembly code file and filename.asc is the output machine code file in hexadecimal format. 4.Functions in component.cFirstly, you are required to complete a function (ALU(…)) in component.c that simulates the operations of an ALU.void ALU(unsigned A, unsigned B, char ALUControl, unsigned *ALUresult, char *Zero)if(ALUControl==0x0)*ALUresult=A+B;         //add}ALU(…)Implement the operations on input parameters Aand B according to ALUControl.Output the result to ALUresult.Assign Zeroto 1 if the result is zero; otherwise, assign 0.The following table shows the operations of the ALU. Computer Organization代写