Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 print function to print either "Yes" or No A palindrome is a 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 eg 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 template PLP project file is available to download on Canvas. The PLP project includes a second ASM file titled,
projectlib.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 projectlib.asm should be made.
When called, depending on the value in register $ the following string will be displayed on the simulated
UART device's output. If $ contains a zero then will be displayed and if $ contains a nonzero value
eg one then "Yes" will be displayed. The print function is called using the following instruction: call projectprint
To use the print function, your PLP program needs to initialize the stack pointer $ before performing the
function call or any other operations involving the stack pointer For this reason, the template project file
includes an initialization that sets the stack pointer to the last address of RAM
Template Structure
The template project file contains six function stubs that need to be implemented. Five are called from the main
loop and the sixth is called from "periodcheck". The template file contains comments with descriptions of what
each function needs to do and how it should be implemented. The table below provides a brief description of
the functions. Debugging Tools
To show that you properly tested your program, please save your program while it is in simulation mode the
blue simulation mode button has been toggled on such that a CPU Memory Visualization window is open and
shows at least the first words of memory in the array. Please keep in mind that the starting address of the
array is relative to the number of initializations placed before the assembler directive allocating space for the
array. If you change your initializations you may need to adjust your CPU Memory Visualization base address.
The Array Example video in this project's module demonstrates how to set up a CPU Memory Visualization
window. It is acceptable to also see program contents in memory these cells will be colored blue For example,
it would be acceptable to see the following in the visualizer after the string, "abcd.", has been sent by the user. Additionally, the watcher window should contain, at minimum, registers $$ and $ You may also include
any other registers in the watcher window that you find useful for debugging.
Points will be deducted if a CPU Memory Visualization window configured to show the start of the array does
not open when simulation mode is toggled on or the watcher window does not include the minimum set of
registers the watcher window does not need to open when simulation mode is toggled on here is template code :org x
# Initializations
# NOTE: You may add initializations after line but please do not
# remove or change the initializations to $sp $s $s or $s
li $spxfffffc # Starting address of empty stack
li $sxf # UART base address
li $s arrayptr # Array head pointer
li $s arrayptr # Array tail pointer
####################################################################
# Do not make changes to the jump to main, the allocation of
# memory for the array, or the main loop
####################################################################
j main
nop
arrayptr: # Label pointing to word array
space
main:
jal pollUART
nop
jal periodcheck
nop
jal spacecheck
nop
jal casecheck
nop
jal arraypush
nop
j use plpassembler to run thiscode
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started