0% found this document useful (0 votes)
38 views

CS F342 Computer Architecture BITS Pilani, Hyderabad Campus Assignment - 1 Due Date: On or Before 7 Nov 2013 (By 5:00 P.M)

This document provides instructions for an assignment to implement functions in MIPS assembly language. Students are asked to write three functions: 1) A function to build the adjacency matrix of a graph based on user input of edges. 2) A function to calculate the indegree of a node by counting incoming edges in the adjacency matrix. 3) A function to calculate the outdegree of a node by counting outgoing edges. Students must also write a main function to test these functions, provide comments in the code, and submit a writeup explaining their algorithms.

Uploaded by

Ashish Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

CS F342 Computer Architecture BITS Pilani, Hyderabad Campus Assignment - 1 Due Date: On or Before 7 Nov 2013 (By 5:00 P.M)

This document provides instructions for an assignment to implement functions in MIPS assembly language. Students are asked to write three functions: 1) A function to build the adjacency matrix of a graph based on user input of edges. 2) A function to calculate the indegree of a node by counting incoming edges in the adjacency matrix. 3) A function to calculate the outdegree of a node by counting outgoing edges. Students must also write a main function to test these functions, provide comments in the code, and submit a writeup explaining their algorithms.

Uploaded by

Ashish Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CS F342 Computer Architecture BITS Pilani, Hyderabad Campus Assignment -1 Due Date: On or before 7th Nov 2013 (by

5:00 p.m)
Problem Statement: Suppose G is a simple directed graph with m nodes, and suppose the nodes of G have been ordered and are called v1, v2, v3, ,vm. Then the adjacency matrix A=(aij) of the graph G is the m x m matrix defined as follows aij = 1 if there is an edge (vi,vj) else 0. Implement the following three functions in MIPS. 1. Function to build the adjacency matrix of a graph. In this function the user will be asked for all the edge information. The parameters of the function are the address of the adjacency matrix and the number of nodes n. 2. Function to compute the indegree of a node where indegree is defined as the number of edges coming in. The parameters passed to this function are the address of the adjacency matrix, id of the node whose indegree is to be calculated and the number of nodes n. 3. Function to compute the outdegree of a node where outdegree is defined as the number of edges going out. The parameters passed to this function are the address of the adjacency matrix, id of the node whose outdegree is to be calculated and the number of nodes n. Implement the main function to test the above three functions. Marks will be deducted if the saved registers are not saved and restored back by the called procedure.

Note: The code must be well commented and well indented. You have to submit a writeup explaining the algorithms used for problem. What to submit? 1) .asm file for the problem 2) The write up noted above How to submit? 1) Create a zip file with the name YOURROLL_CA_A1.zip containing the above files 2) Book a time slot with your concern lab section incharge and attend for demo & submission without fail during your slot on or before due date. 3) Submit at : B206 (Section1 students), C316 (Section2 students)

You might also like