AST10201 Computer Organization Assignment

Assignment Help Assembly Language
Reference no: EM132413926 , Length: word count:500

AST10201 - Computer Organization - City University of Hong Kong

A. Objective
1. Solve real life problem using MIPS assembly language
2. Evaluate the performance of a program in QtSpim
3. Understand how computer organization affects the execution time of computer programs.

B. Requirements of the MIPS assembly program
Write an MIPS assembly program named as "numberConverter_[studentID].s". The requirements for this program are listed below:
Step 1: The program allows user to input any number such as binary number with prefix "b", octal number with prefix "0" (noted that it is not "o"), decimal number without any prefix, hexadecimal with prefix "0x". Assume the input number is a unsigned 32-bit number.

Hints:
1. You may create an enough buffer for the input string. For example: You define a buffer with 33 bytes in .date.
buffer: .space 33
Later on, in .text you can save the input number into buffer you define, using following instructions:
la $a0, buffer li $a1, 33
li $v0, 8 # read String syscall

2. You may want to know which base of number user input. Using the following instructions, you can read the first character from buffer into $s0:
lb $s0, 0($a0) # first character in buffer
If $s0 is equal to ‘b' then you know the input number should be binary, and so on.

3. You may also want to know the length of number user input. Using the following instructions, $a1 would be equal to the digits user inputs excluding the prefix, assuming now $a0 is the address of the first digit (not prefix, you need to modify
$a0 first):
length: lb $s0, 0($a1)
beq $s0, 10, endString # 10 is the ascii code of new line
addi $a1, $a1, 1 j length
endString:
sub $a1, $a1, $a0

Step 2: Convert the number user entered to another 3 different number systems.

Step 3: In console window, the program will ask user "Do you wanna continue (y/n)?". If enter "y", Step 1 and Step 2 are repeated. If enter "n", it responses "End" to indicate the end of the program.

Your program result should be the same as the following figure. The underlined number or characters in the following figure are inputted by user.

C. Report
Write a report named "report_[studentID].docx". The requirements for this report are listed below:

1. Assume now user inputs b10100. Explain how many instructions will be executed in "str2int" procedure.

2. If your program is run on a pipelined CPU with MIPS architecture, which kind of hazards will happen in your program? Indicate and explain them.

3. Explain which part of your code can be optimized to reduce the execution time of the program. Can you try to make the size of file, numberConverter_[studentID].s, not greater than 5 KB?

Attachment:- Computer Organization.rar

Reference no: EM132413926

Questions Cloud

Facilitating payments in developing countries : Is there any evidence of how these ethical codes of practice are operationalised within the organisation?
Relation of reflective thinking to the educative process : How we think: A restatement of the relation of reflective thinking to the educative process. Boston: D.C. Health.
Define the limits of the principle of commonality : Define the limits of the principle of commonality in regards to individuals, government, and corporations
Develop statement of business ethics-code of ethics : Develop statement of business ethics, code of ethics, for your startup company. Our Company expects all employees to maintain high level of ethical standards
AST10201 Computer Organization Assignment : AST10201 Computer Organization Assignment Help and Solution, City University of Hong Kong - Assessment Writing Service - Solve real life problem using MIPS.
Find the error in argument by providing a counterexample : Find the error in the following argument by providing a counterexample. "The reflexive property is redundant in the axioms for an equivalence relation
Management perceptions of customer expectations : What comment can be made about there often being a gap between customer expectations and management perceptions of customer expectations
Explain what controling means in a business setting : Explain what controling means in a business setting. Explain why GoFast needs to be concerned wuth the results for the mini-car
Possible for everyone to have more economic pie : How providing handouts to those who need it will eventually increase production thereby making it possible for everyone to have more economic pie?

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd