Using MIPS assembly language PLEASE HELP ME FIX THE FOLLOWING CODE RUNNING WITH FOLLOWING ERRORS: Error in C:\Users\supre\Documents\Assignment9.asm line 39 column 15: and $t1, $t1, 0b1011 # mask out irrelevant bits Invalid language element: 0b1011 Error in C:\Users\supre\Documents\Assignment9.asm line 45 column 15: and $t2, $t2, 0b0111 # mask out irrelevant bits Invalid language element: 0b0111 Error in C:\Users\supre\Documents\Assignment9.asm line 53 column 15: and $t2, $t2, 0b0001 # mask out irrelevant bits Invalid language element: 0b0001 Error in C:\Users\supre\Documents\Assignment9.asm line 39 column 15: and $t1, $t1, 0b1011 # mask out irrelevant bits Invalid language element: 0b1011 Error in C:\Users\supre\Documents\Assignment9.asm line 45 column 15: and $t2, $t2, 0b0111 # mask out irrelevant bits Invalid language element: 0b0111 Error in C:\Users\supre\Documents\Assignment9.asm line 53 column 15: and $t2, $t2, 0b0001 # mask out irrelevant bits Invalid language element: 0b0001 Assemble: operation completed with errors. Heres the code: # Program to generate Hamming code for an 8-bit byte # Program to generate Hamming code for an 8-bit byte .data prompt: .asciiz "Enter an 8-bit positive integer (0-255): " hamming_label: .asciiz "The Hamming code is: " .text .globl main main: # Prompt the user to input an 8-bit positive integer li $v0, 4 # system call for printing string la $a0, prompt # prompt string syscall   # Read input byte li $v0, 5 # system call for reading integer syscall move $t0, $v0 # store the byte in register $t0   # Calculate ECC Hamming code srl $t1, $t0, 4 # extract the first 4 bits xor $t1, $t1, $t0 # calculate parity and $t1, $t1, 0b1011 # mask out irrelevant bits sll $t1, $t1, 8 # shift left by 8 bits srl $t2, $t0, 4 # extract the first 4 bits again and $t2, $t2, 0b0111 # mask out irrelevant bits or $t1, $t1, $t2 # combine with the second 4 bits sll $t1, $t1, 4 # shift left by 4 bits srl $t2, $t0, 4 # extract the first 4 bits yet again and $t2, $t2, 0b0001 # mask out irrelevant bits sll $t2, $t2, 11 # shift left by 11 bits or $t1, $t1, $t2 # combine with the first two bytes ori $t1, $t1, 0x8000 # set the leftmost bit to 1 for error detection # Print ECC Hamming code in hex li $v0, 34 # system call for printing integer in hex move $a0, $t1 syscall # Exit program li $v0, 10 # system call for exit syscall   im trying to create a MIPS programs that determines what the ECC code should be for a given number (an 8-bit byte). The codes should work for 8-bit positive numbers as these are simpler to work with than larger numbers. The program is to request the user to enter a byte of data (a positive integer in the range of 0 to 255 in decimal) and then create the 12-bit Hamming code as described in your text (see above). The program is to then output this (with an appropriate label) in hex.   When the program runs correctly, it should prompt the user to enter an 8-bit positive integer. After the input is received, the program will calculate the corresponding Hamming code using the algorithm described in the prompt. Finally, the program will output the Hamming code in hexadecimal format, along with an appropriate label.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using MIPS assembly language

PLEASE HELP ME FIX THE FOLLOWING CODE RUNNING WITH FOLLOWING ERRORS:

Error in C:\Users\supre\Documents\Assignment9.asm line 39 column 15: and $t1, $t1, 0b1011 # mask out irrelevant bits
Invalid language element: 0b1011
Error in C:\Users\supre\Documents\Assignment9.asm line 45 column 15: and $t2, $t2, 0b0111 # mask out irrelevant bits
Invalid language element: 0b0111
Error in C:\Users\supre\Documents\Assignment9.asm line 53 column 15: and $t2, $t2, 0b0001 # mask out irrelevant bits
Invalid language element: 0b0001
Error in C:\Users\supre\Documents\Assignment9.asm line 39 column 15: and $t1, $t1, 0b1011 # mask out irrelevant bits
Invalid language element: 0b1011
Error in C:\Users\supre\Documents\Assignment9.asm line 45 column 15: and $t2, $t2, 0b0111 # mask out irrelevant bits
Invalid language element: 0b0111
Error in C:\Users\supre\Documents\Assignment9.asm line 53 column 15: and $t2, $t2, 0b0001 # mask out irrelevant bits
Invalid language element: 0b0001
Assemble: operation completed with errors.

Heres the code:

# Program to generate Hamming code for an 8-bit byte

# Program to generate Hamming code for an 8-bit byte


.data
prompt: .asciiz "Enter an 8-bit positive integer (0-255): "
hamming_label: .asciiz "The Hamming code is: "


.text
.globl main
main:


# Prompt the user to input an 8-bit positive integer
li $v0, 4 # system call for printing string

la $a0, prompt # prompt string

syscall

 

# Read input byte

li $v0, 5 # system call for reading integer

syscall

move $t0, $v0 # store the byte in register $t0

 

# Calculate ECC Hamming code

srl $t1, $t0, 4 # extract the first 4 bits

xor $t1, $t1, $t0 # calculate parity

and $t1, $t1, 0b1011 # mask out irrelevant bits

sll $t1, $t1, 8 # shift left by 8 bits

srl $t2, $t0, 4 # extract the first 4 bits again

and $t2, $t2, 0b0111 # mask out irrelevant bits

or $t1, $t1, $t2 # combine with the second 4 bits

sll $t1, $t1, 4 # shift left by 4 bits

srl $t2, $t0, 4 # extract the first 4 bits yet again

and $t2, $t2, 0b0001 # mask out irrelevant bits

sll $t2, $t2, 11 # shift left by 11 bits

or $t1, $t1, $t2 # combine with the first two bytes

ori $t1, $t1, 0x8000 # set the leftmost bit to 1 for error detection

# Print ECC Hamming code in hex

li $v0, 34 # system call for printing integer in hex

move $a0, $t1

syscall

# Exit program

li $v0, 10 # system call for exit

syscall

 

im trying to create a MIPS programs that determines what the ECC code should be for a given number (an 8-bit byte). The codes should work for 8-bit positive numbers as these are simpler to work with than larger numbers.

The program is to request the user to enter a byte of data (a positive integer in the range of 0 to 255 in decimal) and then create the 12-bit Hamming code as described in your text (see above). The program is to then output this (with an appropriate label) in hex.

 

When the program runs correctly, it should prompt the user to enter an 8-bit positive integer. After the input is received, the program will calculate the corresponding Hamming code using the algorithm described in the prompt. Finally, the program will output the Hamming code in hexadecimal format, along with an appropriate label.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Pipelining
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education