Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program using PLP Tool/MIPS that converts an ASCII string into a binary

ID: 667702 • Letter: C

Question

Create a program using PLP Tool/MIPS that converts an ASCII string into a binary value and displays a character on the UART indicating either an error or a successful conversion. An equals character (‘=’) will be used to indicate the end of a number and a negative sign (’-’) before the number indicates that the value is negative. If it is negative then you will need to convert the value to its two’s compliment. This is done by inverting all of the bits and then adding 1. Inverting, or performing a bitwise NOT on all bits, is equivalent to performing a NOR where both inputs to the NOR are the number you wish to NOT. The result of your signed conversion, either positive or negative, should be put in register $v0. Use numbers through the UART to indicate the state of your program after completing a number input attempt. If a number is successfully converted then it should output a ‘0’ character. If a number contains an invalid character (i.e. 3a4 or #5) then it should output a ‘1’ character. If the value is larger than can be stored in a single 32-bit register then it should output a ‘2’ character.

Explanation / Answer

Binary System:

           Binary is the simplest kind of number system that uses only two digits of 0 and 1. By using these digits computational problems can be solved by machines because in digital electronics a transistor is used in two states. Those two states can be represented by 0 and 1. That is why this number system is the most preferred in modern computer engineer, networking and communication specialists, and other professionals.

Ascii:

        ASCII is an encoding system, known as an abbreviation for the American Standard Code for Information Interchange. Designed initially for old type computers and printers from telegraphic codes.The system represents visible characters or commands for printing like "start", "wait", "complete", etc. The latest versions of ASCII systems are very widely used in telecoms equipment and computing.

for example binary to ascii examples are

Binary to ascii text conversion

    (01101001)2 = i
    (01101100011011110111011001100101)2 = love
    (011110010110111101110101)2 = you

This shweet conversion tool will take any text string and convert it into binary code - you know? those little 1's and 0's that make our world go around today... the digital world.

So go ahead, send some coded messages.... That's right! Send a message to friend in digital format and all they have to do is come back here, plug it in to the binary field and Voila!
a special message for you...

010000100110010100100000011100110111010101110010011001
010010000001110100011011110010000001100100011100100110
100101101110011010110010000001111001011011110111010101
110010001000000100111101110110011000010110110001110100
01101001011011100110010100101110

I am trying to convert a 3x8 matrix to an ASCII equivalent and save it to a text file.

Each row represents a 8-bit binary number. The steps I follow is to create a decimal value for each row, then I use char() to convert the decimal to ASCII.

This works OK for alphanumeric inputs. But for an input containing the first three ASCII characters (NUL, SOH and STX), the resultant file is empty.

The code is:

bin_3x8 = reshape(serial,8,[]).'
dec = bin2dec(num2str(bin_3x8))
text = [char(dec).']

fileSave = fopen(filename,'w');
fprintf(fileSave,text);
fclose(fileSave);

Output:

bin_3x8 =
0     0     0     0     0     0     0     0
0     0     0     0     0     0     0     1
0     0     0     0     0     0     1     0

dec =

0 1   2

About ASCII to text converter tool:

Convert text into ASCII number format. For example A is 065. Text in a computer is stored as numbers called ASCII numbers with each letter having its own number. Input text to convert to these ASCII numbers. ASCII is short for American Standard Code for Information Interchange. With applications in computers and other devices that use text, ASCII codes represent text. Based on the English alphabet, ASCII is a character-encoding scheme. ASCII was originally developed from telegraphic codes.

Computers can only understand numbers, and ASCII codes are numerical representations of characters that a computer can understand. Examples of characters are a, 1, or >. For example, 097 is the ASCII numerical representation of the character a. ASCII covers over 100 characters with some of these characters being control characters that control how text appears.

If you prepare a text in ASCII format, you will get plain text with no format such as bold, and any computer can understand the format. Other schemes such as HTML cover formatting.

some examples of string conversation is

String to ascii or hexa or binary Converter

tool converts Character / String to ASCII code, converting to Binary from its ASCII code, conversion of Character / String to Decimal from its ASCII code, calculate or convert Hexa Decimal from its ASCII code.
Type the character / String in the below given field. The values will be converted automatically.


ASCII CODE Chart - Character and their equivalent decimal values
Char   NUL   SOH   STX   ETX   EOT   ENQ   ACK   BEL   BS   HT   LF   VT   FF   CR   SO   SI
DEC   00   01   02   03   04   05   06   07   08   09   10   11   12   13   14   15
                                                               

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote