Docsity

Assignment No. 02Semester: Spring 2020CPEN-21, Assignments of Mathematics

Toggle sidebar
bg1
Assignment No. 02
Semester: Spring 2020
CPEN-2124
(CLO-1)
Total Marks: 100
Due Date: 11/04/2020
Instructions:
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
The assignment is submitted after due date.
The assignment is submitted via email.
The submitted assignment does not open or file is corrupt.
All types of plagiarism are strictly prohibited.
Objectives:
Understanding the MIPS Assembly Language.
Understanding the conversion of Assembly to binary and vice-versa.
Understanding the different components of digital logic
Guidelines:
Perform/write all steps
Assignment
Problem Statement:
1- Convert following hexadecimal machine code into MIPS language
1. 00004020
2. 200A0004
3. 200B0191
4. 00A86020
5. 8D8D0000
6. 01B07020
7. 00887820
8. ADEE0000
9. 010A4020
10. 010BC02A
11. 1700FFF8
2- Depending upon the values of k 1, 7, 13, 19. Write an assembly code for
the following C code?
pf2

Partial preview of the text

Download Assignment No. 02Semester: Spring 2020CPEN-21 and more Assignments Mathematics in PDF only on Docsity!

Assignment No. 02 Semester: Spring 2020 CPEN- (CLO-1) Total Marks: 100 Due Date: 11/04/

Instructions:

Please read the following instructions carefully before submitting assignment: It should be clear that your assignment will not get any credit if:  The assignment is submitted after due date.  The assignment is submitted via email.  The submitted assignment does not open or file is corrupt.  All types of plagiarism are strictly prohibited.

Objectives:

 Understanding the MIPS Assembly Language.

 Understanding the conversion of Assembly to binary and vice-versa.

 Understanding the different components of digital logic

Guidelines:

 Perform/write all steps Assignment

Problem Statement:

1- Convert following hexadecimal machine code into MIPS language

  1. 00004020
  2. 200A
  3. 200B
  4. 00A
  5. 8D8D
  6. 01B
  7. 00887820
  8. ADEE
  9. 010A
  10. 010BC02A
  11. 1700FFF 2- Depending upon the values of k 1, 7, 13, 19. Write an assembly code for the following C code?

switch (k) { case 1: f = i+j+h; break; case 7: f = g+h+f; break; case 13: f = g–h-f; break; case 19: f = i–j+g; break; } Use this mapping: f: $s0 g: $s1 h: $s i: $s3 j: $s4 k: $s Hint: simplify by using if else and write the assembly code. 1- Consider the following fragment of C code: for (i=0; i<=100; i=i+1) { temp = b[i] + c; a[i]= temp+a[i]; } Assume that a and b are arrays of words and the base address of a is in $s0 and the base address of b is in $s1. Register $t0 is associated with variable i and register $s2 with c. Write the assembly code for MIPS. How many instructions are executed during the running of this code? How many memory data references will be made during execution? Deadline: Your assignment must be uploaded/submitted on or before 11th^ March, 2020