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

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C语言代写
您的位置: 主页 > 编程案例 > C语言代写 >
代写C语言:DEV留学生项目:Principle of Computer Organization - C语言代写
发布时间:2021-07-25 14:24:32浏览次数:
nread_register(…)1.Read the registers addressed by r1and r2from Reg, and write the read values to data1and data2respectively.void read_register(unsigned r1, unsigned r2, unsigned *Reg, unsigned *data1, unsigned *data2){ *data1 = Reg[r1]; *data2= Reg[r2];}nsign_extend(…)1.Assign the sign-extended value of offsetto extended_value.void sign_extend(unsigned offset, unsigned *extended_value){}nALU_operations(…)1.Based on ALUOpand funct, perform ALU operations on data1, and data2or extended_value.2.Call the function ALU(…)to perform the actual ALU operation.3.Output the result to ALUresult.4.Return 1 if a halt condition occurs; otherwise, return 0.int ALU_operations(unsigned data1, unsigned data2, unsigned extended_value, unsigned funct, char ALUOp, char ALUSrc, unsigned *ALUresult, char *Zero){ switch(ALUOp){ // R-type case 7: // funct = 0x20 = 32, add if (funct==0x20) ALU(data1, data2, 0x0, ALUresult, Zero); else return 1; //invalid funct break; default: return 1; //invalid ALUop } return 0;}nrw_memory(…)1.Base on the value of MemWrite or MemRead to determine memory write operation or memory read operation.2.Read the content of the memory location addressed by ALUresultto memdata.3.Write the value of data2to the memory location addressed by ALUresult.4.Return 1 if a halt condition occurs; otherwise, return 0.int rw_memory(unsigned ALUresult, unsigned data2, char MemWrite, char MemRead, unsigned *memdata, unsigned *Mem){ if (MemRead==1){ *memdata = Mem[ALUresult 2]; } return 0;}nwrite_register(…)1.Write the data (ALUresult or memdata) to a register (Reg) addressed by r2or r3.void write_register(unsigned r2, unsigned r3, unsigned memdata, unsigned ALUresult, char RegWrite, char RegDst, char MemtoReg, unsigned *Reg){ Reg[r2] = memdata;}nPC_update(…)1.Update the program counter (PC).void PC_update(unsigned jsec, unsigned extended_value, char Branch, char Jump, char Zero, unsigned *PC){ *PC+=4;}The file minicpu.h is the header file which contains the definition of a structure storing the control signals and the prototypes of the above functions. The functions may contain some parameters. Read minicpu.h for more information.5. Notes 1.This project will be compiled and marked using Dev C++. You can download it from the web (http://www.bloodshed.net/dev/devcpp.html) and install it on your computer. Remember you should download and install Dev C++for C/C++.2.Some instructions may try to write to the register $zero and we assume that they are valid. However, your simulator should always keep the value of $zero 0. 3.You should not do any “print” or ”printf()” operation in component.c; otherwise, the operation will disturb the marking process and your marks will be deducted. 4.To run the compiled executable:a.In Windows, open a command prompt.b.Go to your working directory.c.Type: your_executable input_asc_file incommandWhere incommandis the downloaded file. The output shows the values of all registers and memory locations, which allows you to check if your simulator can produce the correct result or not.5.To debug your program, check if the values of all registers and memory match the assembly program. The following is a sample output:6.To submit your work, at the beginning your component.c, type in yourEnglishname, e.g./* * Designer: name, student id, email address*/Email your component.cto yyliang.fit.must@gmail.com. The subject of your email must be: CO101 Project student_name.Appendix

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。