Looking for ECE2071 - Systems programming - S1 2025 test answers and solutions? Browse our comprehensive collection of verified answers for ECE2071 - Systems programming - S1 2025 at learning.monash.edu.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Using the following data (if b prefix, assume binary, otherwise, decimal. I.e. $t0=5 means 101 is stored in the bottom bits of $t0, $t0=b101 means the same thing)
$t1 = b1110 $t2 = 15 $t3 = 12 $t4 = 9 $t5 = b1010 $zero
What is in register $v0 after the execution of each of the following instructions: (answer in decimal, not hexademical or binary)
What single instruction could you use to create the 4-bit one’s complement (inverted) version of the value in register $t1 and store it in $v0?
WARNING: cannot be pseudo - ie “P” type instruction, as these are not “one instruction”.
You should enter your answer as a single instruction in the format:
For example, if your answer was to use the add instruction with $t0, $t1, and $t2, you would enter the text:
add $t0, $t1, $t2
For the table you filled out above, do you notice any patterns?
Suppose we have a single bit, either 1 or 0. We will now consider what might happen if we perform any one of the following operations on this number:
What is the final value? Fill out the table below, using 0 for false, and 1 for true.
0 | 1 | |
AND with 0 | ||
OR with 0 | ||
XOR with 0 | ||
AND with 1 | ||
OR with 1 | ||
XOR with 1 |
Select all of the lines that contains errors in the provided code.
Select all of the instructions from the program above that are pseudoinstructions. (If none are psuedoinstructions, select the "none of the other options" option)
Given the following struct definitions of a linked-list based queue:
struct QueueNode {
struct QueueNode *next;
unsigned int value;
};
struct Queue {
struct QueueNode *front;
struct QueueNode *rear;
};
// <![CDATA[ hljs.highlightAll(); // ]]>
Task 1: Write an insert function to insert an item at the end of the queue. The function prototype has been provided for you below.
void insert(struct Queue* queue, unsigned int value);
Task 2: Write a serve function to serve (remove) an item (from the front) of the queue. The function prototype has been provided for you below.
int serve(struct Queue* queue);
Task 3: In the main function, write code that does the following:
character in the string:
Notes:
Your code MUST be submitted as a .txt file BEFORE the end of the test (copy and paste into a .txt file).
Suppose we have the following program, running on a 64-bit computer:
#include<stdio.h>
#include<string.h>
typedef struct {
int id;
char name[52];
float salary;
} Employee;
void printEmployee(Employee e) {
printf("ID: %d\n", e.id);
printf("Name: %s\n", e.name);
printf("Salary: %.2f\n", e.salary);
}
int main() {
Employee e1;
int e1ID = 1;
e1.id = e1ID;
strcpy(e1.name, "John Doe");
float e1Sal = 50000.00;
e1.salary = 50000.00;
printEmployee(e1);
Employee* e1Ptr = &e1;
return 0;
}
Select the correct statement about the size of variables in the main function from the options below:
Select the false statements from the selection below:
Consider the following C program, which writes a sequence of numbers to a file named “output.txt”. In the answer box below, carefully write the exact contents of “output.txt” after executing the program.
#include <stdio.h>int main() { FILE *file = fopen("output.txt", "w"); if (file != NULL) { for (int i = 1; i/2 <= 2; i++) { fprintf(file, "%d,", i); } fclose(file); } return 0;}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!