Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

Part A:  Bitwise Logical and Shift Operations

Create a SPARC assembly language program that extracts a bit-field from the contents of register %l0. The position of the rightmost bit of the field is indicated in register %l1, and the number of bits in the field is indicated in register %l2. The extracted field should be put into register %l3, right-shifted so that field starts at bit 0; any bits outside of the extracted field should be set to 0. Structure your program so that it operates on 3 separate inputs, each with different input data, field positions, and field widths. Your TA will provide the inputs to work with. Do not hard code any bit masks; your program should create them using the appropriate bitwise operations. Optimize your program, eliminating nop instructions where possible. Do not use m4.

Use printf() to display in hexadecimal the contents of registers %l0, %l1, %l2 before each extraction, and %l3 afterwards. Also run your program in gdb, displaying the contents of registers %l0, %l1, %l2 before each extraction, and %l3 afterwards. Capture the gdb session using script. On a separate piece of paper, show the bit pattern for each hexadecimal number for the registers %l0 and %l3, circling the extracted field.

Part B:  Integer Multiplication using Add and Shift Operations

prepare a SPARC assembly language program that implements the following integer multiplication algorithm:

negative = multiplier >= 0 ? 0 : 1;
product = 0;
for (i = 0; i < 32; i++) {
    if (multiplier & 1)
        product += multiplicand;
    (product and multiplier registers combined as a unit) >> 1;
}
if (negative)
    product -= multiplicand;


Structure your program so that it shows 3 different multiplications: the first should multiply two positive numbers together, the second should multiply a positive number by a negative number, and the third should multiply two negative numbers together. Your TA will provide the input data to work with. Since we don’t yet know how to create subroutines, you can simply cut and paste the multiplication code to do each multiplication.

Use printf() to display in hexadecimal the contents of the product, multiplier and multiplicand registers before and after each multiplication. Optimize your program, eliminating nop instructions where possible. Do not use m4. Also run the program in gdb, displaying the contents of key registers as the program executes; you should show that the algorithm is working as expected. Capture the gdb session using script. On a separate piece of paper, show the bit pattern (binary number) for each hexadecimal number, and its decimal equivalent (in other words, show the binary and decimal values of the multiplier, multiplicand, and product).

Other Requirements
:

Make sure your code is properly formatted into columns, is readable and fully documented, and includes identifying information at the top of each file. You must comment each line of assembly code. Your code should also be well designed: make sure it is well organized, clear, and concise. Your TA will specify the inputs to use for the above two programs.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91804

Have any Question? 


Related Questions in Computer Engineering

1 if you were setting up an encryption-based network what

1. If you were setting up an encryption-based network, what size key would you choose and why? 2. What is the average key size of a strong encryption system in use today?

Using the internet search for commercial idps systems what

Using the Internet, search for commercial IDPS systems. What classification systems and descriptions are used, and how can these be used to compare the features and components of each IDPS? Create a comparison spreadshee ...

Computer aided engineering final examq1 figure shows a

Computer Aided Engineering Final Exam Q1. Figure shows a concrete reinforced slab undergoing deflection under its own weight. Using the FEM principles (stiffness method), calculate a. Deflection and reactions at the node ...

Do the same as in exercise 114 but for a hash table of size

Do the same as in Exercise 11.4 but for a hash table of size 2031 that contains 999 keys. Exercise 11.4: Consider a hash table of size 501 that contains 85 keys. (a) What is the load factor? (b) What is the average numbe ...

Data structures and algorithms assignmentlearning outcomes

Data Structures and Algorithms Assignment Learning Outcomes - The learning outcomes being assessed in this assignment are listed below: Analyze the various implementations of data structures and algorithms in terms of th ...

Prepare a table showing the storage contents and outputs

Prepare a table showing the storage contents and outputs for the LFSR shown in the accompanying illustration, with initial conditions shown In the delay elements Also, determine the connection polynomial C(D)

1 consider proposed implementations of a systolic array you

1. Consider proposed implementations of a systolic array (you can find these in on the Internet or in technical publications). Then attempt to program the loop provided in Exercise 6.11 using this MISD model. Discuss any ...

Write a program that prompts the user to enter the x- and

Write a program that prompts the user to enter the x- and y-positions of the center and a radius, using JOptionPane dialogs.When the user clicks a "Draw" button, draw a circle with that center and radius in a component.

1 how many point-to-point wans are needed to connect n lans

1. How many point-to-point WANs are needed to connect n LANs if each LAN should be able to directly communicate with any other LAN? 2. When we use local telephones to talk to a friend, are we using a circuitswitched netw ...

The rsa encryption algorithm is based on the fact that it

The RSA encryption algorithm is based on the fact that it is hard to factor a large number (250+ digits). If you were able to factor a large number quickly how would you be able to find the encryption ( e ) and decryptio ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro