80 likes | 292 Views
2013 Computer Architecture Project MIPS Programming : Merge Sort. ChangHyun Yun yunch@korea.ac.kr Room 236, Engineering Building. MIPS Programming : Merge Sort. Main Purpose of this Project Understand MIPS ISA and Recursive Function Algorithm Develop a MIPS machine program SPIM
E N D
2013 Computer Architecture ProjectMIPS Programming : Merge Sort ChangHyun Yun yunch@korea.ac.kr Room 236, Engineering Building
MIPS Programming : Merge Sort • Main Purpose of this Project • Understand MIPS ISA and Recursive Function Algorithm • Develop a MIPS machine program • SPIM • A self-contained simulator that runs MIPS programs • Reads and executes assembly language programs • You can use PCSpim • Download an Installation file from the following website: • http://sourceforge.net/projects/spimsimulator/files/ • How to use PCSpim? • Simple instructions on how to use PCSpim • Write your code in notepad • Save as assembly file (file extension: .s, .asm, etc) • Open your file in PCSpim, and execute
MIPS Programming : Merge Sort • Grade Management Program • Implement grade management system • Each entry has student name field, student number field, and student grade field • Your program has to support following functions: • Insert : add a record • Delete : remove a record • Merge sort : sort records by any field(name, student number, and grade) • The program should be able to sort in any field you want • Show: show current records • Exit: end of program
MIPS Programming : Merge Sort • Before • After (name field) • After (number field) • After (grade field) Name: ccc Number: 201301 Grade: 60 Name: ddd Number: 201306 Grade: 70 Name: aaa Number: 201310 Grade: 20 Name: eee Number: 201304 Grade: 90 Name: bbb Number: 201305 Grade: 45 Name: ccc Number: 201301 Grade: 60 Name: bbb Number: 201305 Grade: 45 Name: aaa Number: 201310 Grade: 20 Name: ddd Number: 201306 Grade: 70 Name: eee Number: 201304 Grade: 90 Name: ccc Number: 201301 Grade: 60 Name: eee Number: 201304 Grade: 90 Name: bbb Number: 201305 Grade: 45 Name: ddd Number: 201306 Grade: 70 Name: aaa Number: 201310 Grade: 20 Name: eee Number: 201304 Grade: 90 Name: ddd Number: 201306 Grade: 70 Name: bbb Number: 201305 Grade: 45 Name: aaa Number: 201310 Grade: 20 Name: ccc Number: 201301 Grade: 60
MIPS Programming : Merge Sort • Merge Sort Algorithm • Divide and conquer algorithm • Average and worst case performance : Θ(nlogn)
MIPS Programming : Merge Sort • What to submit? • A code file [student number.s] : 60% • Ex) 2013000001.s or 2013000001.asm • Must include detailed comments inside your code! • A Word/HWP document that describes your algorithm : 40% • File name is same as code file, ex) 2013000001.doc or 2013000001.hwp • You must explain your code and algorithm in detail! • Your document will be used to determine partial credit if the code fails to run • Compress your code and document into ZIP file • Submit your ZIP file(2013000001.zip) through E-mail ( yunch@korea.ac.kr)
MIPS Programming : Merge Sort • Caution • You can use only Merge Sort algorithm about sorting • You have to use recursive function • Do not use iteration method even if it can improve both speed and space requirements. • Do not copy the code of your friends!!! • Due date : 2013. 5. 7(sun) • If you have any question about this project, • Please send me E-mail (yunch@korea.ac.kr)