Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Invalid program counter value mips

20/10/2021 Client: muhammad11 Deadline: 2 Day

Writing The Code And Report

Instruction:

Download CS47ProjectI.zip and unzip it.
Assemble proj-auto-test.asm and execute. Make sure to turn on 'Assembles all files in directory' and 'Initialize program counter to global main if defined' option in MARS tool. It should generate the following output:
Total passed 0 / 40
*** OVERALL RESULT FAILED ***

Complete the following two procedures in CS47_proj_alu_normal.asm and CS47_proj_alu_logical.asm. You may include your required macros (those you write) in the cs47_proj_macro.asm. Do not update proj-auto-test.asm or cs47_proj_procs.asm or cs47_common_macro.asm.
au_normal (in CS47_proj_alu_normal.asm): It takes three arguments as $a0 (First operand), $a1 (Second operand), $a2 (Operation code '+', '-', '*', '/' - ASCII code). It returns result in $v0 and $v1 (for multiplication $v1 it will contain HI, for division $v1 will contain remainder). This procedure uses normal math operations of MIPS to compute the result (add, sub, mul and div).
au_logical (in CS47_proj_alu_logical.asm): It takes three arguments as $a0 (First operand), $a1 (Second operand), $a2 (Operation code '+', '-', '*', '/' - ASCII code). It returns result in $v0 and $v1 (for multiplication $v1 it will contain HI, for division $v1 will contain remainder). The evaluation of mathematical operations should use MIPS logic operations only (result should not be generated directly using MIPS mathematical operations). The implementation needs to follow the digital algorithm implemented in hardware to implement the mathematical operations.
Assemble proj-auto-test.asm and execute. It should generate the following output.
Total passed 40 / 40
*** OVERALL RESULT PASSED ***

NB: Please check each operation result manually from output. Your implementation of normal and logical ALU will be compared against a reference normal and logical ALU result. Therefore it is possible that you may see 40/40 of pass, but in our test it will not be so.
Write a project report including the following sections. It is recommended to write report in IEEE format
[Template and Instructions on How to Create Your Paper (Links to an external site.)Links to an external site. ]. A report written in IEEE format will earn 10% extra credit on top of overall project credit. The final report uploaded
Include clear diagrams for requirement and design
Include code snippet to explain implementation
Include screen shots of testing results
Introduction containing objective.
Requirement
Design and Implementation
Testing
Conclusion
Make sure to
Upload two files in Canvas (No evaluation will be done if both of them are not uploaded)
cs47_proj_report.pdf : Project report
cs47_proj_source.zip: This zip file needs to contain updated CS47_proj_alu_normal.asm, CS47_proj_alu_logical.asmand cs47_proj_macro.asm. No need to upload other files.

CS47ProjectI/cs47_common_macro.asm
# ***** DO NOT MODIFY THIS FILE **** # #<------------------ MACRO DEFINITIONS ----------------------># # Macro : print_str # Usage: print_str(

) .macro print_str($arg) li $v0, 4 # System call code for print_str la $a0, $arg # Address of the string to print syscall # Print the string .end_macro # Macro : print_int # Usage: print_int() .macro print_int($arg) li $v0, 1 # System call code for print_int li $a0, $arg # Integer to print syscall # Print the integer .end_macro # Macro : exit # Usage: exit .macro exit li $v0, 10 syscall .end_macro # Macro: read_int # Usage: read_int() .macro read_int($arg) li $v0,5 # Read intger syscall move $arg, $v0 # move the data to target reg .end_macro # Macro: print_reg_int # Usage: print_reg_int() .macro print_reg_int ($arg) li $v0, 1 # print_int call move $a0, $arg # move the source reg value to $a0 syscall .end_macro # Macro: lwi # Usage: lwi (, , ) .macro lwi ($reg, $ui, $li) lui $reg, $ui ori $reg, $reg, $li .end_macro # Macro: push # Usage: push () .macro push($reg) sw $reg, 0x0($sp) # M[$sp] = R[reg] addi $sp, $sp, -4 # R[sp] = R[sp] - 4 .end_macro # Macro: push # Usage: push () .macro pop($reg) addi $sp, $sp, +4 # R[sp] = R[sp] + 4 lw $reg, 0x0($sp) # M[$sp] = R[reg] .end_macro .macro push_var_value($varName) lw $t0, $varName push($t0) .end_macro .macro push_var_address($varName) la $t0, $varName push($t0) .end_macro .macro call_printf($format) la $a0, $format jal printf .end_macro

CS47ProjectI/CS47_proj_alu_logical.asm
.include "./cs47_proj_macro.asm" .text .globl au_logical # TBD: Complete your project procedures # Needed skeleton is given ##################################################################### # Implement au_logical # Argument: # $a0: First number # $a1: Second number # $a2: operation code ('+':add, '-':sub, '*':mul, '/':div) # Return: # $v0: ($a0+$a1) | ($a0-$a1) | ($a0*$a1):LO | ($a0 / $a1) # $v1: ($a0 * $a1):HI | ($a0 % $a1) # Notes: ##################################################################### au_logical: # TBD: Complete it jr $ra

CS47ProjectI/CS47_proj_alu_normal.asm
.include "./cs47_proj_macro.asm" .text .globl au_normal # TBD: Complete your project procedures # Needed skeleton is given ##################################################################### # Implement au_normal # Argument: # $a0: First number # $a1: Second number # $a2: operation code ('+':add, '-':sub, '*':mul, '/':div) # Return: # $v0: ($a0+$a1) | ($a0-$a1) | ($a0*$a1):LO | ($a0 / $a1) # $v1: ($a0 * $a1):HI | ($a0 % $a1) # Notes: ##################################################################### au_normal: # TBD: Complete it jr $ra

CS47ProjectI/cs47_proj_macro.asm
# Add you macro definition here - do not touch cs47_common_macro.asm" #<------------------ MACRO DEFINITIONS ---------------------->#

CS47ProjectI/cs47_proj_procs.asm
# ***** DO NOT MODIFY THIS FILE **** # .include "./cs47_common_macro.asm" .text .globl printf #----------------------------------------------- # C style signature 'printf(,, # , ... , )' # # This routine supports %s and %d only # # Argument: $a0, address to the format string # All other addresses / values goes into stack #----------------------------------------------- printf: #store RTE - 5 *4 = 20 bytes addi $sp, $sp, -24 sw $fp, 24($sp) sw $ra, 20($sp) sw $a0, 16($sp) sw $s0, 12($sp) sw $s1, 8($sp) addi $fp, $sp, 24 # body move $s0, $a0 #save the argument add $s1, $zero, $zero # store argument index printf_loop: lbu $a0, 0($s0) beqz $a0, printf_ret beq $a0, '%', printf_format # print the character li $v0, 11 syscall j printf_last printf_format: addi $s1, $s1, 1 # increase argument index mul $t0, $s1, 4 add $t0, $t0, $fp # all print type assumes # the latest argument pointer at $t0 addi $s0, $s0, 1 lbu $a0, 0($s0) beq $a0, 'd', printf_int beq $a0, 's', printf_str beq $a0, 'c', printf_char printf_int: lw $a0, 0($t0) # printf_int li $v0, 1 syscall j printf_last printf_str: lw $a0, 0($t0) # printf_str li $v0, 4 syscall j printf_last printf_char: lbu $a0, 0($t0) li $v0, 11 syscall j printf_last printf_last: addi $s0, $s0, 1 # move to next character j printf_loop printf_ret: #restore RTE lw $fp, 24($sp) lw $ra, 20($sp) lw $a0, 16($sp) lw $s0, 12($sp) lw $s1, 8($sp) addi $sp, $sp, 24 jr $ra

CS47ProjectI/proj-auto-test.asm
# ***** DO NOT MODIFY THIS FILE **** # .include "./cs47_common_macro.asm" .include "./cs47_proj_macro.asm" # data section .data .align 2 matchMsg: .asciiz "matched" unmatchMsg: .asciiz "not matched" charCR: .asciiz "\n" testD: .word 0xffffffff var0: .word 0x00000000 var1: .word 0x00000000 var2: .word 0x00000000 var3: .word 0x00000000 testV1Arr: .word 4 16 -13 -2 -6 -18 5 -19 4 -26 testV2Arr: .word 2 -3 5 -8 -6 18 -8 3 3 -64 noTest: .word 10 passTest: .word 0 totalTest: .word 0 opList: .byte '/' '*' '-' '+' testFlag: .word 0x0 as_msg: .asciiz "(%d %c %d) \t normal => %d \t logical => %d \t [%s]\n" mul_msg: .asciiz "(%d %c %d) \t normal => HI:%d LO:%d \t\ logical => HI:%d LO:%d \t [%s]\n" div_msg: .asciiz "(%d %c %d) \t normal => R:%d Q:%d \t\ logical => R:%d Q:%d \t [%s]\n" finalMSG: .asciiz "*** OVERALL RESULT %s ***\n" statPASS: .asciiz "PASS" statFAIL: .asciiz "FAILED" testStatus: .asciiz "\n\nTotal passed %d / %d\n" .text .globl main ##################################################################### # Main Program ##################################################################### main: add $s0, $zero, $zero # $s0 = 0 ; used as index lw $s1, noTest test_loop: mul $t0, $s0, 4 # $s3 = testV1Arr[$s0] la $t1, testV1Arr add $t1, $t1, $t0 lw $s3, 0($t1) # $s4 = testV2Arr[$s0] la $t1, testV2Arr add $t1, $t1, $t0 lw $s4, 0($t1) addi $s5, $zero, 4 op_loop: addi $t0, $s5, -1 la $t1, opList add $t1, $t1,$t0 lb $s6, 0($t1) # increase number of tests lw $t0, totalTest addi $t0, $t0, 1 sw $t0, totalTest # normal operation or $a0, $s3, $zero or $a1, $s4, $zero or $a2, $s6, $zero ori $v0, $zero, 0x0 ori $v1, $zero, 0x1 jal au_normal sw $v0, var0 sw $v1, var1 # logical operation or $a0, $s3, $zero or $a1, $s4, $zero or $a2, $s6, $zero ori $v0, $zero, 0x2 ori $v1, $zero, 0x3 jal au_logical sw $v0, var2 sw $v1, var3 # Set if mul or div # print the result lw $t0, var0 lw $t1, var2 bne $t0, $t1, main_mismatch beq $s6, '*', main_extra_match beq $s6, '/', main_extra_match j main_L6 main_extra_match: lw $t0, var1 lw $t1, var3 bne $t0, $t1, main_mismatch main_L6: push_var_address(matchMsg) lw $t0, passTest addi $t0, $t0, 1 sw $t0, passTest j main_L5 main_mismatch: push_var_address(unmatchMsg) ori $t0, $zero, 0x1 sw $t0, testFlag main_L5: push_var_value(var2) beq $s6, '*', main_ins_1 beq $s6, '/', main_ins_1 j main_L1 main_ins_1: push_var_value(var3) # main_ins_1 main_L1: push_var_value(var0) # main_L1 beq $s6, '*', main_ins_2 beq $s6, '/', main_ins_2 j main_L2 main_ins_2: push_var_value(var1) # main_ins_2 main_L2: push($s4) # main_L2 push($s6) push($s3) beq $s6, '*', main_print_mul beq $s6, '/', main_print_div call_printf(as_msg) j main_L3 main_print_mul: call_printf(mul_msg) # main_print_mul j main_L3 main_print_div: call_printf(div_msg) # main_print_div j main_L3 main_L3: pop($t0) # main_L3 pop($t0) pop($t0) pop($t0) pop($t0) pop($t0) beq $s6, '*', main_pop_2 beq $s6, '/', main_pop_2 j main_L4 main_pop_2: pop($t0) pop($t0) main_L4: addi $s5, $s5, -1 # main_L4 bnez $s5 op_loop addi $s0, $s0, 1 bne $s0, $s1, test_loop # Test statistics lw $t0, totalTest push($t0) lw $t0, passTest push($t0) call_printf(testStatus) pop($t0) pop($t0) # Final msg lw $t0, testFlag beqz $t0, main_pass push_var_address(statFAIL) j main_L7 main_pass: push_var_address(statPASS) main_L7: call_printf(finalMSG) pop($t0) exit

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Assignment Guru
Quality Homework Helper
Professional Coursework Help
Fatimah Syeda
Solutions Store
Top Writing Guru
Writer Writer Name Offer Chat
Assignment Guru

ONLINE

Assignment Guru

I have done dissertations, thesis, reports related to these topics, and I cover all the CHAPTERS accordingly and provide proper updates on the project.

$45 Chat With Writer
Quality Homework Helper

ONLINE

Quality Homework Helper

As per my knowledge I can assist you in writing a perfect Planning, Marketing Research, Business Pitches, Business Proposals, Business Feasibility Reports and Content within your given deadline and budget.

$35 Chat With Writer
Professional Coursework Help

ONLINE

Professional Coursework Help

I have worked on wide variety of research papers including; Analytical research paper, Argumentative research paper, Interpretative research, experimental research etc.

$17 Chat With Writer
Fatimah Syeda

ONLINE

Fatimah Syeda

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$42 Chat With Writer
Solutions Store

ONLINE

Solutions Store

I am a professional and experienced writer and I have written research reports, proposals, essays, thesis and dissertations on a variety of topics.

$38 Chat With Writer
Top Writing Guru

ONLINE

Top Writing Guru

I can assist you in plagiarism free writing as I have already done several related projects of writing. I have a master qualification with 5 years’ experience in; Essay Writing, Case Study Writing, Report Writing.

$26 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Circuit with 2 batteries - Shetland islands council education - Trick to learn f block elements - Esol entry 3 reading exam paper - Center tapped transformer full wave rectifier - Den of thieves epub - Process philosophy and family and marriage - Ben and jerry's swot analysis 2017 - Maxine hong kingston tongue tied - Seven segment display in multisim - Human Services - The ideal lot size for a lean system is - Midland case study solution - Week 6 Organizational Ethics Presentation - Steven universe future episode 1 reddit - Pestel analysis of snack food industry - CPO - Communication skills in pharmacy - Computer science 9608 past papers 2017 - CIS450 Assignment Mod 5: - Discretionary Use of Authority: Scenarios - Ulster hospital contact number - Duckscarves career - DISCUSSION - Bosch ddu 10 price - Film drama reflection - Discussion Board Due 8/26 - Wrench llc v taco bell - Our job is to report the news not fabricate it - Write My Capstone Project For Me - Why is radioactive decay so predictable - Film Study - Distinctive qualities of a text - Atomic number and mass number practice worksheet answers - Essay - Machine guarding ppt presentation - Santa fe grill mexican restaurant case study - Cv1 coffee maker how to use - The college of will writing - Soweto gospel choir darwin entertainment centre 17 july - Samkhya theory of causation - Strategic management 9th edition dess pdf - How to do the tablecloth trick - 124 old coach road maslin beach - Toshiba e studio 2505f driver - International Finance - Richard scrushy net worth 2018 - Rc brushless motor ratings - Additional mathematics textbook form 5 - Communication - Example of hess law of constant heat summation - How does roderigo die - Fallacies in twelve angry men - Water Quality Essay - Chap. 6 Q HR - Higher ability selection test - God will create ease after hardship - Security Proposal - Itute 2015 exam 2 - A life insurance policyowner does not have the right to - Conventions of a feature article - History class - Discussion 08.1: Analysis of Variance (ANOVA) - Current trends and integrative models of family therapy - Kbro3 s kbr s o2 g - Questions about water usage - How could worldcom scandal be prevented - Reply to this discussion - Cw williams dental - Opposite of still life - Psychoanalysis of bruce wayne - Discontinue without fail usyd - Discussion post - Business startegy - Powerpoint title slide apa format - Week 4 disscusion econ - Summarize the great flood of 1927's impact on mississippi - Darry in the outsiders - Concerto meaning in music - Which product of prime polynomials is equivalent to 8x3 2x - Mini cooper trademark - Profit volume ratio in break even analysis - Dry ice is solid carbon dioxide a - Logistic regression java - Mayo doused batter fried grackle bugs with honey walnuts - Will provide upon request - N491 Discussion Mod 4: - Yellowstone wolves food web - Health Care Reform - Rich boys don t have hearts r scarlett epub - Queen mary dentistry admissions - Life space probiotic woolworths - The devil's playground full movie - Nike case study ethics - To convince investors to accept greater volatility you must - Social history questions shadow health - Researching Marketing Questions - Code of ethics for electrical engineers - What is an accounting memo - Alliteration in still i rise - Portfolio Project(Opera Excellence)