What is the exponent after the bias is removed

Assignment Help Computer Engineering
Reference no: EM131905256

Assignment

Exercise 1

Convert each of the following numbers to 8-bit signed magnitude, 8-bit one's complement and 8-bit two's complement. Report your answers in binary.

a. (-97)10

8-bit signed magnitude 8-bit one's complement 8-bit two's complement

b. (-47)10

8-bit signed magnitude 8-bit one's complement 8-bit two's complement

c. (-127)10

8-bit signed magnitude 8-bit one's complement 8-bit two's complement

d. 12610

8-bit signed magnitude 8-bit one's complement 8-bit two's complement

Exercise 2

Convert the following 16-bit two's complement numbers in hexadecimal representation to decimal.

a. AC2416
b. 64A216 c. 5D1716
d. FFFF16

Find the decimal equivalents for the following 8-bit two's complement numbers.

a. 0010 0100 Decimal Equivalent

b. 1010 1001 Decimal Equivalent

c. 1100 0011 Decimal Equivalent

d. 0101 0101 Decimal Equivalent

Exercise 4

Perform two's complement addition on the following pairs of numbers. In each case, indicate the value of the status bits after the addition. Assume NZVC=0000 prior to the addition.

a. 1000 0010 + 1000 0010 =                 NZVC=

b. 1010 1001 + 0110 1100=                  NZVC=

c. 1001 1111 + 1111 1110=                  NZVC=

d. 0111 1010 + 0110 0110=                  NZVC=

Exercise 5

Using the PEP/8 instruction, 72004A, answer the following questions. What is the instruction in binary?

Starting from the left, what do bits 6 - 8 represent? (be specific) For this instruction, what register will be used?

Explain what is stored in mem[004A]?

The following is in single-precision IEEE 754 format, 1 01111111 10110011001100110011010.

What is the sign bit?

Does the sign bit represent a positive or negative number?

What is the bias used in IEEE 754 single-precision format?

As shown above, what is the exponent in binary?

What is the exponent after the bias is removed? (In decimal)

As shown above, what is the significand in binary?

Explain why it is possible for error to be introduced when converting a decimal number to IEEE 754 format.

Exercise 7

Using the PEP/8 instruction, D11AA3, and the following table, answer the following questions.

 

Accumulator

Index Register

Mem[1AA3]

Mem[1AA5]

Mem[1AA7]

NZVC

Content

2A34

FF32

3AF0

2AFF

1AFF

0000

Content before instruction.

What is the instruction?

What is the register?

What is the addressing mode?

What is the content of the accumulator after the instruction is executed, (hex)?

What is the content of the index register after the instruction is executed, (binary)?

What is the content of mem[1AA3] after the instruction is executed, (hex)?

What is the content of mem[1AA5], (binary)?

What is the content of mem[1AA7], (hex)?

What is the RTL specification for this instruction?

What is the value of the NZVC bit after execution?

The following is in Pep/8 assembly language.

LDX 8, i
ORX 0x0030, i
STBYTEX num, d CHARO num, d STOP
num: .BYTE 0
.END

What is the output of this program?

What is ORX doing?

Why is the ORX instruction required?

What is the hexadecimal object code that is suitable for PEP/8. (Include all code necessary for the object code to run on the PEP/8. Use PEP/8 to check your work)

Exercise 9

The following is in Pep/8 assembly language.

DECO 'X', i CHARO '\n',i DECO 0xFFE3, i CHARO '\n',i CHARO 0x003D, i STOP
.END

What is the output of DECO ‘X', i?

What is the output of DECO 0xFFE3, i?

What is the output of CHARO 003D, i?

What is the hexadecimal object code that is suitable for PEP/8. (Include all code necessary for the object code to run on the PEP/8. Use PEP/8 to check your work)

Draw the runtime stack for the following C++ program. (Show any global variables and include main in the runtime stack)

Use

retAddr for the return address retVal for the return value NA not used

#include <iostream> using namespace std; int ounces;
void size(int& ou, int lbs) { ou = lbs*16;
}
int main() {
int lbs;
cout << "Enter number of pounds"; cin >> lbs;
size(ounces, lbs);
cout <<"You have " << ounces << "ounces"; return 0;
}

Draw the call tree, as in Figure 2.30, for the function binCoeff of Figure 2.28 for the call statement from the main program: (e) binCoeff (4, 2)

Part 1) Draw the call tree for the call statement from the main program. (See Fig 2.30 for an example)

Part 2) How many times is the function called?

Part 3) What is the maximum number of stack frames on the run-time stack during the execution, including main).

Part 4) The sequence of calls and returns for the program. (See page 66 below Fig 2.30)

Exercise 12

The Fibonacci sequence is 0 1 1 2 3 5 8 13 21...

Each Fibonacci number is the sum of the preceding two Fibonacci numbers. The sequence starts with the first two Fibonacci numbers, and is defined recursively as:

fib(0) = 0
fib(1) = 1
fib(n) = fib(n-1) + fib(n-2) for n > 1
The C++ program that computes the Fibonacci number is as follows: #include <iostream>
using namespace std; int fib (int n) {
if (n == 0) { return 0;
}
else if (n == 1) { return 1;
}
else {
return fib (n - 1) + fib (n - 2);
}
}
int main () { int num;
cout << "Which Fibonacci number? "; cin >> num;
cout << "The number is " << fib (num) << endl; return 0;
}

Part 1) Draw the call tree for the Fibonacci number fib(5)

Part 2) How many time is fib called?

Part 3) What is the maximum number of stack frames allocated on the run-time stack? (Do not include the main stack.)

Exercise 13

The object code for Figure 6.14 has a CPA at 000C to test the value of j. Because the program branches to that instruction from the bottom of the loop, why doesn't the compiler generate a LDA j,d at that point before CPA.

Exercise 14

Explain the difference in the memory model between global and local variables. How are each allocated and accessed in PEP/8?

Exercise 15

Draw the values just before and just after the CALL at 0022.

37_After execution.jpg

Reference no: EM131905256

Questions Cloud

Write a procedure to transform the vertices of a polyhedron : Write a procedure to transform the vertices of a polyhedron to projection coordinates using a parallel projection with a specified projection vector.
Write a mips asm program that requests for three numbers : Write a MIPS asm program that requests for three numbers from the user. Month, Day, and Year. You may assume that a valid date is given.
The present value of your windfall is : You have just received notification that you have won the $1.6 million first prize in the Centennial Lottery.
What is primary trade-off that results from factoring : What is primary trade-off that results from factoring receivables, from the perspective of the organization that sells the A/R to the factoring?
What is the exponent after the bias is removed : What is the exponent after the bias is removed? Explain why it is possible for error to be introduced when converting a decimal number to IEEE 754 format.
Why es is superior to var as a measure of market risk : What is the difference between VAR and ES?, and why ES is superior to VAR as a measure of market risk?
How and why did banking regulations change : Over the 80+ years which followed, and particularly the last 20 years, how and why did banking regulations change?
List the characteristics that could be changed : What is the product or service you have chosen for the multiplication technique?List its essential components or processes.
Determine sherrys profit or loss : When the settlement date arrived, Sherry closed out her position by selling a Treasury bills futures contract for 95.64. Ignoring transaction costs.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd