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

Tanglewood case 5 disparate impact analysis - L98a2 cadet gp rifle - Nursing.pearsonhighered.com - Determination of copper in brass lab report - Reference Page for Mexico City Sinking - Presentation - Vending machine java program - 2014 hsc past paper - A christmas carol stave 2 questions and answers pdf - Pb h3po4 h2 pb3 po4 2 - Week 4 - Assignment 4 - NURS561PROMPT2REPLY - ____ is an example of offshoring - Connecting wires in physics lab - Convention on biological diversity australia - Newly revised strong interest inventory - Lyrics to abc song by jackson 5 - What is the lactate inflection point - Bromide detox symptoms iodine - Rolls royce marine ålesund - Example Memo Prompt - Communication During Covid - ART 10000 Question - Oral presentation marking sheet - Busi 301 quiz 1 - Garden glory project questions answers - Selmer oboe serial number search - Excel manufacturing ltd huddersfield - Joe bloggs mystery disease diagnosis - Swot analysis example for mechanical engineering - MANAGEMENT AND ORGANIZATIONAL BEHAVIOR - William d moseley hotel tampawilliam d moseley hotel tampa - Discussion - Ones tens hundreds thousands - Ware town council planning - Solahart hot water system booster switch - Cavities of the body diagram - Cat topics to write about - How to do anova in excel 2007 - Calculating electrolytes in tpn - Physical features of india - Heartbeat by david yoo questions and answers - Pmol l to mmol l - Enthalpy of formation of solid ammonium chloride from the elements - Reading summary - Lillian gilbreth was one of the earliest advocates of - Dr chan perth breast augmentation - Week 6 data mining - Mysteries of god revealed - I am a bit confused - The sun has long been set questions and answers - Case study on capital budgeting with solution - Adaptation worksheet answer key - William james cash value - Why do employees resist organizational change - Three figure bearing examples - Compex ex01 04 course - Mount buangor state park - Limit calculator using l hopital's rule - Information technology for managers reynolds pdf - Jane eyre chapter 1 - Uk network of mindfulness teacher training organisations - Comprehensive women's health soap note - Cold ash alpaca walking - Data flow diagram level 1 2 3 - Discussion 2: Genes and Personality - Key control in hotel housekeeping - Capella clinical mental health counseling - Discuss the transactional model of communication - Logical Database Design - Which family of instruments does a trumpet belong to - Project manager - George and jones understanding and managing organizational behavior - Themes of contemporary art pdf - Canton and hall daytripper watch review - Case Study5 - C717 task 2 - Otto von trapezoid and the empress of thieves - Kfc issues in india - Strategic Human Resource Management - Valleylab force triad service manual - Westfield black friday opening times - Name the ionic compound v2o5 - Respondo fifo - Leadership traits of martin luther king jr - Ammonia gas and hydrogen chloride gas equation - This is me passport - Capella university writing center - Multi-threading computer science assignment - 75 mason street hawthorn - Computing the sample correlation coefficient aleks - Repeated measures anova research question - Give me liberty history textbook - Cultural constraints in management theories - Marketshare simulation - Thom jones dialect coach - The sagebrush state free pdf - Examples of professional growth plans for speech-language pathologists - Vertical wall air conditioner - The crucible creative response - What is an interpretive text