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

Describe the characteristics of the near field why is the

Describe the characteristics of the near field. Why is the near field less important for antenna analysis than the far field?

Apply the chain algorithm to the mediator querywith the

Apply the Chain Algorithm to the mediator query With the following adornments at the sources for R, S, and T. If there is more than one adornment for a predicate, either may be used. In each case: v i. Indicate all possi ...

Data fileswrite a 200- to 300-word short-answer response

Data Files Write a 200- to 300-word short-answer response for the following: Think of a programming task-other than the individual or team assignments in this course-in which you would choose to use a data file. Write th ...

I draw a pm that accepts the language oddpalindromeii draw

(i) Draw a PM that accepts the language ODDPALINDROME. (ii) Draw a PM that accepts the language PALINDROME.

1 articulate how the law develops via adjudication of

1. Articulate how the law develops via adjudication of cases. 2. Differentiate between subject matter jurisdiction and personal jurisdiction. 3. List the types of controversies over which federal courts have subject matt ...

Please provide a one page executive summary on the blackout

Please provide a one page executive summary on the Blackout of 2003. Your summary should not exceed one single spaced page and should include Who, What, When, Where, Why and How the situation could have been handled or p ...

Finally you will use these tools to play your favorite

Finally, you will use these tools to play your favorite song. a. Find the music for your favorite song and translate it into the symbology of Problem 14.6. b. Write a script that uses the playNote function to play your s ...

What are integrity constraints describe four different ways

What are integrity constraints? Describe four different ways to handle integrity constraints. Which approach is the most desirable?

What do you feel is the relationship between personal

What do you feel is the relationship between personal ethics and business ethics? Are they or should they be the same?

Read the following article about using social media for

Read the following article about using social media for evangelism and respond to the question below: Social networking online: Incredible spectrum for evangelism: http://www.internetevangelismday.com/social-networking.p ...

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate