+1-415-315-9853

info@mywordsolution.com

Engineering

 Civil Engineering Chemical Engineering Electrical & Electronics Mechanical Engineering Computer Engineering Engineering Mathematics MATLAB Other Engineering Digital Electronics Biochemical & Biotechnology

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

A company develops a new security product using the extreme

A company develops a new security product using the extreme programming software development methodology. Programmers code, then test, then add more code, then test, and continue this iteration. Every day, they test the ...

Conduct research and reading to understand how

Conduct research and reading to understand how multimegawatt induction generators can be controlled by vector control. Assume devices capable of handling high voltages and high currents, maybe not possible to operate wit ...

Create a drop box list for the applications applet to

Create a Drop box List for the application's applet to include:* Beginning locations (at least six) * Destination locations (at least six)* Vehicle size (compact, mid, luxury, SUV)* Gas type (leaded, unleaded, super unle ...

In the dhke protocol the private keys are chosen from the

In the DHKE protocol, the private keys are chosen from the set Why are the values 1 and p - 1 excluded? Describe the weakness of these two values. We now want to consider the importance of the proper choice of generators ...

1 what is a virtual switching element2 why should a small

1. What is a virtual switching element? 2. Why should a small business opt to virtualize its computing resources? 3. In recent years, there has been a phenomenal growth in the business use of computing virtualization tec ...

1 why does the bankaccount class not have a reset method2

1. Why does the BankAccount class not have a reset method? 2. What happens in our implementation of the BankAccount class when more money is withdrawn from the account than the current balance? 3. What is the this refere ...

1 what is the clock cycle time with and without this

1. What is the clock cycle time with and without this improvement? 2. What is the speedup achieved by adding this improvement? 3. Compare the cost/performance ratio with and without this improvement. 4. Problems in this ...

An isp is granted the block 807056021 the isp needs to

An ISP is granted the block 80.70.56.0/21. The ISP needs to allocate addresses for two organizations each with 500 addresses, two organizations each with 250 addresses, and three organizations each with 50 addresses. a. ...

The random class implements a random number generator which

The Random class implements a random number generator, which produces sequences of numbers that appear to be random. To generate random integers, you construct an object of the Random class, and then apply the nextInt me ...

Suppose an n x n image u is mapped into a row-ordered n2 x

Suppose an N x N image U is mapped into a row-ordered N 2 x 1 vector IP. Show that the N 2 x N 2 one-dimensional Hadamard transform of IP gives the N x N twodimensional Hadamard transform of U. Is this true for the other ...

• 13,132 Experts

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.

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