程序代写代做代考 C mips assembler • Use basic logic gates to construct 2 inputs XOR gate.(30 marks)

• Use basic logic gates to construct 2 inputs XOR gate.(30 marks)
• Draw out the truth table of XOR gate(5 marks)
• Write out the logic expression of XOR gate(5 marks)
• Draw XOR logic gate by using AND, OR and NOT gates(10 marks)
• Draw XOR logic gate by using only NAND gates(10 marks)

• Write a MIPS assembler program to compute the first 12 numbers of the Fibonacci numbers(30 marks)
Fibonacci numbers
• A sequence of numbers of the following shape
• 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, …
Formula
• Fn = Fn-1 + Fn-2 with F0 = 0, F1 = 1
Requirements
• To compute the first 12 numbers of the sequence(15 marks)
• To store the resulting numbers in an array(5 marks)
• Print out the results(10 marks)
Please follow the template below:
.data
fibs: .word 0 : 12 # “array” F[ ] of 12 words
sep: .asciiz “,” # ascii text terminated by \0

.text
# add code below to calculate Fibonacci number
……
print:
# add code below to print
……
• Given string, char string[]=“Hello Word“; Write a C program to implement following functions(40 marks)
1: Calculate the length of the string (5)
2: Count the how many upper case letters and lower letters in this string? (10)
3: Count how many times a characters “o” can be found in this string?(10).
4: Count how many words in this string? (15)

Please follow the template below:
#include
#include
main(){
char string[] = “Hello World!”;
//put your code below
……….