Hey guys,
I have an assignment that requires me to construct a datapath and an fsm that will tell if a string in a given block of memory is a palindrome.
We are given the following inputs:
A StringAddress(memory address of first byte of palindrome string)
A StringLength(Length of the palindrome string, we are guarenteed that StringAddress + StringLength < 2^16)
Ready (indicates that memory bank has test string and that StringAddress and StringLength have good data), when asserted, do calculation.
2 outputs:
Done: when asserted, the check is complete
isPalindrome: asserted if string is a palindrome.
;;;;;;;;;;;;;;;
So this is what I was thinking,
I would have one part of the datapath that would count upwards from the StringAddress to StringAddress + StringLength.
And then another part of the datapath that would count from StringAddress+StringLength to StringAddress.
The registers for each of these would be connected to the address line for the memory bank, through a mux (whose selector I control).
I don't really know what to do now...
As a summary, i am basically trying to have a counter that starts from the beginning of the memory block, and one that starts at the end of a memory block and at each clock edge, they will be compared to one another using a comparator.
Can anyone guide me through this? I'm really bad at these things. Thank you.
I have an assignment that requires me to construct a datapath and an fsm that will tell if a string in a given block of memory is a palindrome.
We are given the following inputs:
A StringAddress(memory address of first byte of palindrome string)
A StringLength(Length of the palindrome string, we are guarenteed that StringAddress + StringLength < 2^16)
Ready (indicates that memory bank has test string and that StringAddress and StringLength have good data), when asserted, do calculation.
2 outputs:
Done: when asserted, the check is complete
isPalindrome: asserted if string is a palindrome.
;;;;;;;;;;;;;;;
So this is what I was thinking,
I would have one part of the datapath that would count upwards from the StringAddress to StringAddress + StringLength.
And then another part of the datapath that would count from StringAddress+StringLength to StringAddress.
The registers for each of these would be connected to the address line for the memory bank, through a mux (whose selector I control).
I don't really know what to do now...
As a summary, i am basically trying to have a counter that starts from the beginning of the memory block, and one that starts at the end of a memory block and at each clock edge, they will be compared to one another using a comparator.
Can anyone guide me through this? I'm really bad at these things. Thank you.