Mips Definition and 62 Threads
-
Engineering MIPS - Fibonacci Series: Main and fib function
Write and test the fib function in two linked files (Fib.asm, fib_main.asm). Your solution must be made up of a function called fib(N, &array) to store the first N elements of the Fibonacci sequence into an array in memory. The value N is passed in $a0, and the address of the array is passed in...- Margarita0076
- Thread
- Assembly Assembly language Function Mips Series
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
Engineering Assembly Programming (MIPS): Convert BCD to Decimal
I have this code which convert decimal number to binary number, but I do not understand how representation 8762 like 1000 0111 0110 0010. 8 7 6 2 1000 0111 0110 0010 .data strmsg: .asciiz "please Enter a decimal number: " .text #main method .globl main #main function main...- Margarita0076
- Thread
- Assembly Assembly language Convert Mars Mips Programming
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Mips count characters in string
Summary:: Count characterers in a string and display it in hexadecimal [New user has been reminded to show their work on schoolwork problems] Hi, how can I do this in MIPS? Given a string of characters, the program has to count the number of characters in the string, and display it in...- keo
- Thread
- Count Mips String
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
P
Comp Sci MIPS assembly language homework
All I have is li $t0, 0xaaaaaaaa li $t1, 0x24924924 move $s0, $t0 Because I think it is best to hardcode them in.- ParticleGinger6
- Thread
- Assembly Assembly language Homework Language Mips
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
Kindly, help me to understand the given MIPS programming problem
I don't think I understood the problem clearly. What I understood is this: 1. Each food item has a specific major color-component (and, hence, a fixed mode-value of that specific color component). First, I need to calculate all mode values, and use them as constants in my program. 2...- user366312
- Thread
- Mips Programming
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
T
MIPS Number of Instructions Executed and Memory Accessed
Homework Statement The number of instructions a program has is the static instruction count. The number of instructions actually executed (e.g. due to some instructions being repeated, as in a loop) is called the dynamic instruction count. Consider the following code: li $t0, 99...- thchao
- Thread
- Memory Mips
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Why does this MIPS program do what it does?
A recent thread asking what a Python program does induced me to post this MIPS assembly program, and ask why we get the incorrect addition in the second line of output. Here's the output from this code: 5 + 2 = 7 5 + 2 = 3 And here's the code that produces that output. Edit: The first line of...- Mark44
- Thread
- Mips Program
- Replies: 4
- Forum: Programming and Computer Science
-
J
MIPS Pipelining Help: Filling the Timeline w/ & w/o Forwarding
Homework Statement Assembly Code: LW R1, 0(R2) add R4, R3, R1 add R3, R1, R4 What are the dependencies Fill the pipelining timeline if: a. There is forwarding b. There is no forwarding Homework Equations N/A The Attempt at a Solution With forwarding attempt: Without...- jdoe10
- Thread
- Mips
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
R
Why Does MIPS Show a Negative Result for Large Factorials?
when I try to compile the MIPS instruction in order to compute the factorial of n number? i get the following error in the console as: Enter the factorial number: 20 factorial of given number: -2102132736 The output which I am getting as negative integer of a given factorial instead of...- rictor
- Thread
- Instruction Mips Programming
- Replies: 2
- Forum: General Engineering
-
MIPS Through Time: From Honeywell to Raspberry-PI
I saw a reference to MIPS and started wondering about how fast my mac-mini is to what the old Honeywell 6000 mainframe I used to program in the 70's and found this chart: https://en.wikipedia.org/wiki/Instructions_per_second What is remarkable is that even the Raspberry-PI has a MIPS rating...- jedishrfu
- Thread
- Mips
- Replies: 2
- Forum: Computing and Technology
-
N
Help with MIPS Decimal to any base
My teacher gave us an exercise for this week to modify a piece of code that already accepts decimal number and prints all the bases 2-36 we had to make that the output number for each base appear in right order, accept 0 and negative number, but I am stuck with the last part where it has to show...- nhammen
- Thread
- Base Mips
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
I
Extending MIPS datapath to implement SLL and SRL
Homework Statement Here's the datapath: So this seems like a pretty common question but I can't seem to find any answers on how to extend the datapath to implement SLL and SRL.The Attempt at a Solution This is how I would think to do it but I'm not entirely sure: It would need another mux...- izelkay
- Thread
- Mips
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
C
How do you print an image in mips?
hi guys I have been having a bit of trouble with this one and I am a bit all over the place. I know the things like setting up pointers, 2-d array, reserving stack frame space, having offsets. but is printing an image very different from printing a pixel or printing an integer? Also if I need to...- cjj
- Thread
- Image Mips
- Replies: 4
- Forum: Programming and Computer Science
-
MIPS Relocation Table: List Instructions
Homework Statement List instructions that will contribute an entry to the relocation table. 1 funca: 2 la $t0 , n 3 lw $s0 , 0( $t0 ) 4 addi $s2 , $zero , 1 5 sub $s1 , $s1 , $s1 6 loop: 7 sll $t0 , $s2 , 3 1 8 slt $t1 , $t0 , $z e ro 9 bne $t1 , $zero , skip 10 add $s1 , $s1 ...- ElijahRockers
- Thread
- Mips Table
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
D
Help with MIPS Program - Sum of N & Print $sp Address
Hello i need to write a program that computes the value of sum numbers using a recursive subroutine and also i need to print the address of $sp every few steps.. this is the code I've wrote so far but i can't get the result and i also don't know how to print $sp address .text...- Dexterous
- Thread
- Mips Program
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
J
How Do You Program a Sequential LED Light Pattern in MIPS Assembly?
Hi all, I've only just started MIPS and have been stuck on this introductory lab for a while now. I have 8 LEDs each lit by there corresponding bit being a 1. Hence 0010 0101 at the input would light up LEDS 1, 3 and 6. I need to make LEDs 1-5 light up one at a time and extinguish the...- Jd303
- Thread
- Led Light Mips Sequence
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
E
MIPS assembly progr.-factorial calculation
I'm trying to write a MIPS assembly program that implements the calculation of n! Well i wouldn't be here if i were successful.When i try to run the following code on PCSpim this appears on the screen: "Exception 6 [Bad instruction address] occurred and ignored" Can anyone help...- electra123
- Thread
- Assembly Calculation Mips
- Replies: 4
- Forum: Programming and Computer Science
-
C
MIPS assembly programming - converting integer to decimal/binary
I'm writing a MIPS assembly program and I'm trying to figure out a way to display a given integer in either decimal or binary using only one function with two parameters. The function takes in two parameters: an integer and a base (either '2' or '10'). I'd like to not edit anything other than...- colerelm
- Thread
- Assembly Integer Mips Programming
- Replies: 1
- Forum: Programming and Computer Science
-
J
Mips swapping without temp variable
so i have swap.s .text main: la $a0,n1 la $a1,n2 jal swap li $v0,1 # print n1 and n2; should be 27 and 14 lw $a0,n1 syscall li $v0,11 li $a0,' ' syscall li $v0,1 lw $a0,n2 syscall li $v0,11 li $a0,'\n' syscall li $v0,10 # exit syscall swap: L1: .data n1: .word 14 n2...- jiggleswiggly
- Thread
- Mips Variable
- Replies: 1
- Forum: Programming and Computer Science
-
M
Solving MIPS Programming: Enter 5 Ints & Reverse Order
I am trying to teach mips to my self and wrote a fairly simple program and it isn't working and found out that the strings I declared in .data are somehow affecting one of my pointers. Here is the code: #Write a program that allows the user to enter 5 ints and store these ints in an array...- missinglink
- Thread
- Mips Programming
- Replies: 1
- Forum: Programming and Computer Science
-
H
MIPS Input/Output: Translate & Test Program
This is the program I need to translate: main() { int i; int number=0; int result=0; for(i=0; i<10; i++){ printf("Testing:"); scanf("%i",&number); result = PerfectSquare(number); if(result==0) printf("Fail\n")...- heyhey
- Thread
- Mips
- Replies: 1
- Forum: Programming and Computer Science
-
J
MIPS Assembly Code - Convert instruction code to binary
Homework Statement Write a single line MIPS assembly code as an input through the SPIM simulator console and the program will output a 32 bit MIPS machine code through the console. I'm using PCSpim to write the code. An example, I input this instruction in the console. addi...- JSGhost
- Thread
- Assembly Binary Code Convert Instruction Mips
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
M
Solving MIPS Runtime Error: Address Out of Range 0x00000000
Hi there, Not sure if this is the right place to post, but I seem to get a runtime error that says: address out of range 0x00000000. I think that it's probably in the first three lines of my code, but any idea as to what else it may be? Thanks so much! .data save: .word 1,2,4 size...- m00nbeam360
- Thread
- Error Mips Runtime
- Replies: 1
- Forum: Programming and Computer Science
-
K
Re: MIPS - Making a 64 bit number when you only have 32 bit register support
Hey guys I've been working on this program for just over a week now and I just can't seem to find any way around my problem. The problem I'm having is: I'm trying to add 32 bit numbers together and if there is an overflow then I'd like to find a way to output the result as a 64 bit number. I...- Kerren
- Thread
- Bit Mips Support
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
K
MIPS - Making a 64 bit number when you only have 32 bit register support
Hey guys I've been working on this program for just over a week now and I just can't seem to find any way around my problem. The problem I'm having is: I'm trying to add 32 bit numbers together and if there is an overflow then I'd like to find a way to output the result as a 64 bit number...- Kerren
- Thread
- Bit Mips Support
- Replies: 1
- Forum: Electrical Engineering
-
R
What is the endianness of MIPS architecture?
I wrote all this and for some reason it logged me off and I lost my post. So rather than rewrite everything I'm just going to get straight to the point. I'm trying to learn mips and I know it's a little endian architecture. If i want to store 0xABCD9876 which is 10101011110011011001100001110110...- ramhanuman
- Thread
- Architecture Mips
- Replies: 1
- Forum: Programming and Computer Science
-
L
How to Store User Input as Memory in MIPS Assembly
Homework Statement Write a routine that accepts two integers i and j as arguments, calculates the quotient and remainder of i and j, and generates a string in memory that stores "The quotient of i and j is i/j and the remainder is i%j". For example if the arguments was 15 and 7 the string in...- lina29
- Thread
- Input Mips Output
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
U
MIPS Hangman Project - Get Random Word in MIPS
Ok so me and a my group are writing a hangman program in mips, we came up with the idea of dividing the program to 3 subroutines 1 that reads and writes to a file, one that picks a random word from a word bank in the text file i guess, and one that does the rest like getting the word replacing...- unoathingshad
- Thread
- Mips Project
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
J
MIPS programming file I/O problem
Homework Statement Write a PC SPIM program that can (1) Prompt for a complete file name. [Note: Probably should be in the same directory as the program.] (2) Echo the input. (3) Test to see if a file by that name already exists. If it does, query the user to see if destruction of the old...- JAO012
- Thread
- File Mips Programming
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
U
MIPS Subroutines: Get Sum of Decimal Digits
This is the program i was asked to do Write two subroutines, one iterative and one recursive, that gets an unsigned integer as argument and returns the sum of all decimal digits in the integer. For example if the argument is 75080 then the sum to be returned is 20 (7+5+0+8+0). Write a main...- unoathingshad
- Thread
- Mips
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
J
Converting numerical input to corresponding string using MIPS
I am writing a MIPS SPIM program that will take integer input, and output the corresponding words. For example, if 123 is input, then one two three will be output. I can input an integer but I get zero repeating infinite times as the output every time. Any help is appreciated. My source...- JAO012
- Thread
- Input Mips Numerical String
- Replies: 1
- Forum: Programming and Computer Science
-
J
MIPS programming successive addition
Homework Statement I need to create a program that will prompt for two integers, echo those integers, and then multiply them without using the multiplication operation and report the result. Homework Equations The following is what I have so far. The prompts and echoes work, however I do...- JAO012
- Thread
- Addition Mips Programming
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
R
MIPS Assembly and working with bytes
Homework Statement I need to put in a byte in register $s1 that is 0b10101011 Homework Equations add addi lb sb $zero (if needed) The Attempt at a Solution I attempted at putting in a byte in register $s1 as follows: add $s1, $zero, 0b10101011 however it throws an error, I...- RET80
- Thread
- Assembly bytes Mips
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
J
How can I translate this mips code into binary/hexadecimal
Hello I have two doubts, In an exercise I have to convert a MIPS instruction into hexadecimal code. I understand a part of it. The instruction given by the professor is: Exercise 2 : bne $t2, $zero, previous instruction The solution is Co =0b0 00101, $rs =0b0 1010,$rt =0b0 0000, Imm16 =...- John_Brown
- Thread
- Code Mips
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
J
Calculating the MIPS Rating for a Multi-Processor System
I need some help with this problem I am trying to solve if anyone can help. Each instruction on a certain computer system requires 1 cycle for any type of instruction. This system includes N processors and is used to execute a program contain 16 million instructions and 60% of the code...- johnnyrocket
- Thread
- Mips
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
J
Help Needed: Writing a MIPS Program w/ 2 Instructions
I need to write a MIPS program (using only 2 true-ops) to take in 1 signed integer argument into register $a0, and return (into $v0) a 1 if the input was negative, and a 0 (into $v0) otherwise. Can anyone offer help. I'm not sure since I can only use 2 instructions.- johnnyrocket
- Thread
- Mips Program Short
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
H
How Do You Convert Decimal to Binary Using MIPS Code?
Hello. I was simply wondering if anyone has any idea on how to write a MIPS code to convert a decimal number to its binary number. Anyone can help me?- hkboy123
- Thread
- Binary Mips
- Replies: 3
- Forum: Programming and Computer Science
-
S
Show the hex representation of MIPS instructions
Hey all Homework Statement Here i want to translate them and show the hex representation of these instructions: 1)add $t0, $t0, $zero 2)lw $t2, 16($s3) Homework Equations The Attempt at a Solution eg. 2) lw | $s3 | $t2 | 16 I-TYPE then translate the assembly code: 35 | 19 | 10 | 16 The...- shieldcy
- Thread
- Mips Representation
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
T
Anyone familiar with MIPS floating point instructions?
Hello all. My task here was to have an array of floating point numbers, find the largest in the array, and store it back into the array. The first code shows a properly working integer interpretation of the task, and the second shows my interpretation of the floating point. I simply tried to...- trouty323
- Thread
- Floating Mips Point
- Replies: 2
- Forum: Programming and Computer Science
-
C
MIPS Help (converting numbers to diff bases)
Alright, I have a program that converts numbers from base 2-10 and it works just fine but I can not get the program to convert past base 10 whenever i input any char such as 1A it says invalid input. I have tried changing some of the lines in the code but it ends with errors. Right now it is...- CsRookie
- Thread
- Bases Mips Numbers
- Replies: 5
- Forum: Programming and Computer Science
-
T
MIPS Decimal to Hex Conversion: How To Guide
Hello. I was simply wondering if anyone has any idea on how to write a MIPS code to convert a decimal number to its hexadecimal equivalent. I have no idea on how I would go about this. Should I be trying to manipulate the ASCII values in some way? Or should I use some sort of shift/rotation...- trouty323
- Thread
- Mips
- Replies: 3
- Forum: Programming and Computer Science
-
S
Why Is My MIPS Code Printing the Wrong Integer?
I am writing a bigger program, but having trouble right now seeing where my mistake is on the output side of the code. The snippet of code below prints a message to the screen, takes the users input (which is supposed to be an integer), then is supposed to print it back out to the screen. The...- Snoogx
- Thread
- Mips
- Replies: 20
- Forum: Programming and Computer Science
-
T
MIPS Help. Exception error/bad address?
Hello. My task here is to store hard-code data directly into an array, find the largest in the array, then put that number at the end of the array. My code that I have is below, but I am getting an error. The error is: "Exception occurred at PC=0x0040003c" "Bad address in data/stack read =...- trouty323
- Thread
- Mips
- Replies: 4
- Forum: Programming and Computer Science
-
R
How to convert a string into integers (in MIPS)
Hey, I'm working on a project for my Computer Organization class and I have to read in 2 separate times (in military format with no ":" ) as strings and then find and print the time difference. I am able to read in and save the strings no problem, but I don't have a clue as to how I can...- Rat_Rodz
- Thread
- Convert Integers Mips String
- Replies: 1
- Forum: Programming and Computer Science
-
T
MIPS Help. Fahrenheit to Celsius
# Fahrenheit to Celsius .data # following are data prompt: .asciiz "\nPlease input degrees in fahrenheit: " # prompt user for input result: .asciiz "\nDegrees in celsius is: " # display degrees in celsius bye: .asciiz "\nProgram terminated" # display when program terminates...- trouty323
- Thread
- celsius Mips
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
B
Set bits 18, 19, 20, 21 to 1 ( Mips)
Homework Statement Set bits 18, 19, 20, and 21 to 1 in register $v0. $v0's other bits should not change. This can be done in two MIPS instructions. Do not use any pseudo-instructions or load any data from memory. You may use any registers that you wish.Homework EquationsHere is more on the...- basketball853
- Thread
- Bits Mips Set
- Replies: 16
- Forum: Engineering and Comp Sci Homework Help
-
B
How to Translate Machine Code Instructions to MIPS Assembly?
Homework Statement Hey everybody! here is my question: Translate the following machine code instructions to MIPS assembly. What is the format of each instruction? 1. 0000 0000 0000 1010 0100 1010 1000 0000 2. 0000 0000 0010 0010 0010 0000 0010 0101 Homework Equations The Attempt at...- basketball853
- Thread
- Binary Mips
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
B
Converting MIPS Instructions to Binary for Computer Assembly Students
Hey Guys! Thank you for checking out my Thread... I am taking a computer assembly class and i have homework due on Wed but i am stuck on a single problem. I have to convert MIPS instructions into binary, I want to learn how to do this because it will be on a test... and i could just go into...- basketball853
- Thread
- Binary Mips
- Replies: 13
- Forum: Engineering and Comp Sci Homework Help
-
M
Help with mips program that reverses each word.?
Hello, I have a problem that has been driving me crazy. I have a program that reads a string and then reverses the string but what I need is the program to reverse each word like: ("10 is ten" becomes "01 si net"). Can anyone help? Here is what I have: # PROGRAM: .data # Data declaration...- mikebrown
- Thread
- Mips Program
- Replies: 1
- Forum: Programming and Computer Science
-
X
Some help with MIPS assembly code
Hey guys. I'm trying to practice some basic MIPS, but I can't seem to get this right. You just plug in the number and then you follow the code and you'll get obviously the end result. I can't get the result for these here. Does anybody know? I'd really appreciate help. Thank you! 1. $t0 =...- XodoX
- Thread
- Assembly Code Mips
- Replies: 3
- Forum: Programming and Computer Science