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

Create a cloud of turtles half of them one color and half

Create a " cloud " of turtles, half of them one color and half of them another color. Based on a probability have one color of turtles move up and the other color turtles move down. Label the turtles with their WHO numbe ...

The problem of the dutch national flag involves starting

The problem of the Dutch national flag involves starting out with a row of n buckets, i.e. bucket [1..n], each bucket containing a single pebble that is either red, white or blue. The task is to arrange the pebbles so th ...

A system allows the user to choose a password with a length

A system allows the user to choose a password with a length of one to eight characters, inclusive. Assume that 10,000 passwords can be tested per second. The system administrators want to expire passwords once they have ...

As an international marketer how might you use a middleman

As an international marketer how might you use a middleman in your distribution strategy for the international transaction? How would the middlemen functions of your international strategy differ from a purely domestic o ...

Describe two types of variables or methods that can be used

Describe two types of variables or methods that can be used to exchange data between web pages and give example code of both types.

1 implement a new version of the gameoflifepy program to

1. Implement a new version of the gameoflife.py program to use your SparseLifeGrid class from the previous question. 2. Repeat Exercise 2.5 from Chapter 2 but use your new version of the gameoflife.py program from the pr ...

1 write a program that draws some sort of face2 write a

1. Write a program that draws some sort of face. 2. Write a program that draws a winter scene with a Christmas tree and a snowman. 3. Write a program that draws 5 dice on the screen depicting a straight (1, 2, 3, 4, 5 or ...

1 what techniques can be used to reduce page table

1. What techniques can be used to reduce page table shadowing induced overhead? 2. What techniques can be used to reduce NPT induced overhead? 3. One of the biggest impediments to widespread use of virtual machines is th ...

1 comment on the reasons for the rapid growth of the

1. Comment on the reasons for the rapid growth of the Android operating system. 2. Recently Apple's iOS4 encryption was hacked by a Russian; compare and discuss the weaknesses in the iOS4 disclosed by the Russian company ...

1 what is the difference between half-duplex and

1. What is the difference between half-duplex and full-duplex transmission modes? 2. Name the four basic network topologies, and cite an advantage of each type. 3. For n devices in a network, what is the number of cable ...

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen