Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE 230 Project 3: UART Palindrome Checker Learning Objectives: Create modular code and interface with unfamiliar modularized code The Task In this project, you will

CSE 230 Project 3: UART Palindrome Checker Learning Objectives:

Create modular code and interface with unfamiliar modularized code The Task In this project, you will be writing a program that receives a string of characters via the UART, checks if this string is a palindrome, and then uses a provided print function to print either Yes or No. A more detailed description of the program design can be found in the Program Layout section of this document. A palindrome sequence of characters (typically a word or phrase) that is the same both forwards and backwards. For this project, strings will be terminated using a period (.). You may assume that a string will contain at least one letter in addition to a period (e.g., the input, b., should be considered a palindrome). You will not need to handle empty strings, strings containing only a period, or stings containing characters other than letters, spaces and periods. Your program should be able to handle multiple strings sent one after another or concatenated together. For example, the string: abba. data. should print Yes followed by No on the next line. Spaces should be ignored when checking for a palindrome and the palindrome should not be case sensitive. For example, A nut for a jar of Tuna. would be considered a palindrome. Print Function A skeleton PLP project file is available to download on Canvas. The PLP project includes a second ASM file titled, project3_print.asm. This ASM file contains the print function used in this project. PLPTool concatenates all ASM files within a PLP project into a single location in memory (unless additional .org statements have been added to specify different location for code). No changes to project3_print.asm should be made. This ASM file can be thought of as a library file rather than a part of your project. When called, depending on the value in register $a0, the following string will be displayed on the simulated UART devices output. If $a0 contains a zero then No will be displayed and if $a0 contains a non-zero value (e.g. one) then Yes will be displayed. The print function is called using the following instruction: call project3_print To use the print function, your PLP program needs to initialize the stack pointer ($sp) before performing the function call (or any other operations involving the stack pointer). For this reason, the skeleton project file includes an initialization that sets the stack pointer to 0x10fffffc (the last address of RAM). Program Layout Character Input and Conditioning After initializing any frequently used values in registers, your program should start in a polling loop that waits for a new character sent to the PLP boards UART by the user. It should not proceed beyond this polling loop until a new character has been received. A few checks should take place once the character has been received and the UART has been told the current character has been read from the receive buffer. The first check is if the current character read from the receive buffer is a period. If this is the case, then a palindrome check should start (this is working off the assumption you may make that some set of one or more characters has already been received). The palindrome check itself is described in the next section. The second check is for a space character, which can be skipped. This means you can return to the polling loop to wait for the next character without doing anything with the space character. The third and final check should be for the case of the received character. All lowercase characters should be converted to their uppercase equivalent (e.g. r should be converted to R). Once an uppercase character has been obtained it should be pushed onto the stack and saved in the array allocated by the skeleton file. Space is allocated in the skeleton file immediately following the label, array_ptr. Each character should be written to one word in the array. Palindrome Checking The palindrome check should use your array to check the string in the order it was originally received. To do this you can set a pointer to the location pointed to by the array_ptr label and then traverse the array the same way it was traversed when writing to it. The stack will allow you to simultaneously check the string in the opposite order since the stack will start with the last character received and will move towards the start of the string as values are popped from it. You can either calculate the midpoint of the string and compare characters until you reach it (be careful when handling strings containing an even number of characters) or you can traverse until you have an empty stack (hint: this will occur when your stack pointer reaches its original value). If, at any point during the traversal the character popped from the stack is different from the character read from the array then the palindrome check is complete and the print function should be used to print No. If The entire string has been traversed (or the midpoint has been passed) then the print function should be used to print Yes. After returning from the print function the program should return to a state where it is ready to process a new string. Keep in mind that this should include setting pointers such that data structures are treated as empty.

Submit your program with the format: Firstname_Lastname_project3.plp

Please can someone help with this problem all previous solution are wrong.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago