Write code in C and MIPS to compute and print the Fibonacci word sequence, given values for n and the initial terms F(0) and F(1). The Fibonacci word sequence's components are strings, as opposed to the integers found in the Fibonacci number sequence. For instance, given inputs of n=4, F(0)=a, and F(1)=b, your output should be a b ab bab abbab (hint: memory accesses will require careful attention!). You may assume that n will never be less than 25 and that it will always be positive. You may also assume that the initial terms F(0) and F(1) will only be one character long. The MIPS read function will populate the parameters array with the values of n, F(0), and F(1), in this order. The C language does not allow mixing data types in a single array, so the C read function will instead populate three variables named n, F(0), and F(1). The code needs to be as short as possible.
IN C:
void fibonacci_word(int n, char F0, char F1) {
// TODO: Implement me!
}
IN MIPS:
fibonacci_word:
# TODO: Implement me!
jr $ra