General Instructions. You can use QtSpim simulator to work on these assignments.

Similar documents
The assignments will help you learn Verilog as a Hardware Description Language and how hardware circuits can be developed using Verilog and FPGA.

CSC201, SECTION 002, Fall 2000: Homework Assignment #2

(Type your answer in radians. Round to the nearest hundredth as needed.)

Data Structures and Algorithms 2018

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

15-110: Principles of Computing, Spring 2018

Subject: Computer Science

CS 3204 Operating Systems Programming Project #2 Job / CPU Scheduling Dr. Sallie Henry Spring 2001 Due on February 27, 2001.

Computer Organization and Architecture (CSCI-365) Sample Final Exam

Programming Using C Homework 4

COSC2430: Programming and Data Structures Sparse Matrix Multiplication: Search and Sorting Algorithms

CpSc 1111 Lab 9 2-D Arrays

COSC2430: Programming and Data Structures Sparse Matrix Addition 2 2: Non-recursive and recursive; arrays and linked lists

CS & IT Conversions. Magnitude 10,000 1,

Binary Search. Roland Backhouse February 5th, 2001

SPIM & MIPS. Department of Information and Management. Computer Organization and Structure 年 9 月 29 日星期 一

COMP2611: Computer Organization. Data Representation

Chapter Three. Arithmetic

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

CS 352 : MIPS & Amicable Numbers

Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays)

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

List of Practical for Class XII Computer Science

Knowledge: This lab will help you become familiar with the following content knowledge:

Unit: Rational Number Lesson 3.1: What is a Rational Number? Objectives: Students will compare and order rational numbers.

UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING

Characters, Strings, and Floats

Instructions PLEASE READ (notice bold and underlined phrases)

CS2630: Computer Organization Homework 1 Bits, bytes, and memory organization Due January 25, 2017, 11:59pm

Lecture 6 Sorting and Searching

These are reserved words of the C language. For example int, float, if, else, for, while etc.

CMPSCI 145 MIDTERM #2 SPRING 2017 April 7, 2017 Professor William T. Verts NAME PROBLEM SCORE POINTS GRAND TOTAL 100

Getting started with Java

COMP 2421 Computer Organization. Lab 1

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Octal and Hexadecimal Integers

Computer System and programming in C

ECE2049: Homework 1. Consider the following code to compute the average of your exam grades: #define NUM_EXAMS (3)

Chapter 3: Arithmetic for Computers

Sample Examination. Family Name:... Other Names:... Signature:... Student Number:...

Computer Programming: C++

a name refers to an object side effect of assigning composite objects

CSc 110, Spring 2017 Lecture 39: searching

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

CS33 Project Gear Up. Data

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

Wednesday January 31, 2:30-4pm ENGMC 103

EENG 212 Lab 2. Recursive Functions

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

EE 3613: Computer Organization Homework #2

Recursion continued. Programming using server Covers material done in Recitation. Part 2 Friday 8am to 4pm in CS110 lab

CS 101: Computer Programming and Utilization

This exam is worth 24 points, or 24% of your total course grade. The exam contains six

Introduction to Computer Science Midterm 3 Fall, Points

UNIVERSITY OF WISCONSIN MADISON

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

PIC 10B Lecture 1 Winter 2014 Homework Assignment #2

(the bubble footer is automatically inserted into this space)

Lab 6 Sorting. Sup Biotech 3 Python. Pierre Parutto

CS61C : Machine Structures

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

Co-processor Math Processor. Richa Upadhyay Prabhu. NMIMS s MPSTME February 9, 2016

3.5 Floating Point: Overview

CpSc 1111 Lab 5 Formatting and Flow Control

PROGRAMMING IN C AND C++:

Question Points Score Total: 100

CS13002 Programming and Data Structures, Spring 2005

Arithmetic for Computers

Week 0. Net Salary =Earnings- deductions; Read the employee number, Basic Print employee Number, Earnings,Deductions and Net salary.

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0

CS 31: Introduction to Computer Systems. 03: Binary Arithmetic January 29

Hexadecimal Numbers. Journal: If you were to extend our numbering system to more digits, what digits would you use? Why those?

Final Labs and Tutors

Computer Science 4U Unit 1. Programming Concepts and Skills Algorithms

Representing numbers on the computer. Computer memory/processors consist of items that exist in one of two possible states (binary states).

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

SEE2030: Introduction to Computer Systems (Fall 2017) Programming Assignment #2:

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

COSC 6385 Computer Architecture - Exercises

CS 61B Summer 2005 (Porter) Midterm 2 July 21, SOLUTIONS. Do not open until told to begin

Revised time table of BCA (2011 admission) record submission

Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

CS2 Practical 1 CS2A 22/09/2004

How to declare an array in C?

Data Representation Floating Point

Number representations

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Homework 1. Problem 1. The following code fragment processes an array and produces two values in registers $v0 and $v1:

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Data Representation Floating Point

North Thurston Public Schools Sixth Grade Math Power Standard 1 Unit Assessment #1 and #3

Computer Science 217

Sai Nath University. Assignment For MCA 1 st

COSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture)

Data Structure and Algorithm Homework #3 Due: 2:20pm, Tuesday, April 9, 2013 TA === Homework submission instructions ===

Transcription:

General Instructions You can use QtSpim simulator to work on these assignments. Only one member of each group has to submit the assignment. Please Make sure that there is no duplicate submission from your group. The assignments have to be submitted through CANVAS. The maximum possible deadline extension is 2 days. For the extension for one day after the deadline, there will be a penalty of10% of the grade. For the second day extension, the penalty is another 20% of the grade. No assignment submission will be accepted after 48 hours of the deadline. Sharing of the solution outside the group is strictly prohibited. groups will get 0 in the assignment. If found guilty, both the involved Each group member should equally contribute to every assignment and should fully understand the submitted solution. The TAs may ask some groups to come to the lab during the designated lab session and may ask a group member to explain the solution.

Deadline (11:59pm on January 29, 2017) Q 1: (5 points) Write a MIPS Assembly Language program that is equivalent to the following C function: int func (int x, int y) { int u; u = -5 * x - 7 * y; if (u < -35) return -35; else if (u > 35) return 35; else return u; } Q 2: (5 points) Write a program in MIPS assembly language program to convert all occurrence of lower case letters in a user given string to upper case letters. The string may contain any ASCII character. Page 2 of 5

Deadline (11.59 pm on February 5, 2017) Q 1: (5 points) Write a MIPS program to convert a user given integer to a binary number. Consider both the positive and negative integers. In case of a negative integer, the output has to be in 2 s complement form. Print the binary number as a string. Q 2: (5 points) Write a MIPS program to add two rational numbers and print the result in normalized scientific format with two digits after the decimal point ((+/-)X.YYe(+/-)ZZ). To convert the rational number output to a floating point number with 2 digits after the decimal point, you have to round the result up-to two decimal place. The numerators and denominators of the two numbers are given as inputs by a user. Example: 201 Inputs: 5, 13 6 Output: 4.24e+01 Page 3 of 5

Deadline (11:59 pm on February 12, 2017) Q 1: (5 points) The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34,.... Any number in the series is found by adding up the two numbers before it. Write a MIPS program to perform the following: Given a positive integer 0 n 20, store the first n numbers of the Fibonacci series in memory and print them. Q 2: (5 points) Write a MIPS program that given a number N and N integers can print the integers in a sorted order using Bubble Sort. Bubble Sort algorithm involves swapping of two numbers. Write a procedure for swapping two numbers separately and use it in the sort function. Page 4 of 5

Deadline (11:59 pm on February 19, 2017) Q 1: (5 points) Binary Search is an algorithm to search a value in a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly check until the value is found or the interval is empty. (NIST Definition) Suppose that a sorted array of positive integers is stored in the memory. Write a MIPS program that accepts a positive integer from a user and returns the leftmost index of the element in the array if the element is present in the array. Otherwise, the program returns 1. Q 2: (5 points) Write a MIPS program to multiply two matrices. The two matrices are stored in the memory as two dimensional array in row-major order. The elements of the matrices are given in double-precision floating point format. Store the result matrix in the memory and print it. Page 5 of 5