What is the corresponding base ten value

Assignment Help Programming Languages
Reference no: EM131325449

? Along with your name, include your student ID# and discussion section at the top of your Assignment.

? There are eight problems; we will go over them in dicussion section after the due date.

? The textbook in this context is: R. Bryant, D. O'Hallaron, Computer Systems: A Programmer's Perspective. (3rd Edition)

Problem 1.

Q1. Give the base 10 integer equivalent of the following. Assume 16 bit hex numbers, 16 bit, twos complement.

a) 0xC87A

b) 0x1BCD

Q2. Write a mask (in hexadecimal) to give the value of the last 9 binary digits of the numbers in Q1 above.

Q3: Using your mask from Q2 above, give the equivalent base 10 values represented by the last 9 binary digits for both hexadecimal values from Q1.

Problem 2.

Assume you trying to reconstruct a sequence of 12 bits (call it 'a') where the middle four bits are missing. What you have is the hexadecimal sequence E_E where "_" represents the missing bits. You also have the octal bit sequence representing bitwise NOT(a)which is "_52_". There are two missing digits in this sequence (represented by the '_').

Q1. What is the complete hexadecimal value of a?

Q2. What is the base 10 equivalent of the complete value of a?

Problem 3.

Suppose you are given a positive integer number ‘x'. Give a single expression (using only bitwise operators, shifts, +, -) to find the value of 4.5 * x.

Problem 4. (similar to Problem 2.88 in the text)

Consider the following two 9-bit floating point representations based on IEEE floating point format.

Format A

? There is 1 sign bit.

? There are k = 5 exponent bits. The exponent bias is 15.

? There are n = 3 fraction bits.

Format B

? There is 1 sign bit.

? There are k = 4 exponent bits. The exponent bias is 7.

? There are n = 4 fraction bits.

In the table below, given the bit patterns in Format A , convert to the closest value in Format B and fill in the bit pattern in the "Bits" column under Format B. If rounding is necessary, you should round toward +∞. For both Format A and Format B, fill in the base 10 equivalent values. The first bit sequence is completed for you.

Format A Format B

Bits Value Bits Value

1 01111 001 -9/8 1 0111 0010 -9/8

1 10110 111

0 01101 100

1 00000 100

0 00000 000

0 11000 101

Problem 5.

Assume you have a 16 bit machine with 65536 bytes of memory. Ints are 2 bytes. Assume that variables are placed in memory contiguously in the order they are coded, starting at memory address 0x500. That means that ints and memory addresses are 16 bits long. Given the following code segment:

int x = 4; int y = 3;

int *px = &x; int *py = &y;

printf("starting x) %d\n", x); printf("starting y) %d\n", y); printf("a) %p\n", px); printf("b) %p\n", py);

py = px;

printf("c) %d\n", *px); printf("d) %x\n", &px); *px = 35; y = 120; printf("e) %d\n", *px); printf("f) %d\n", *py); printf("g) %d\n", x); printf("h) %d\n", y);

Give the output of each printf() assuming the %p format specifier prints out a memory address in hexadecimal.

Problem 6. Assume 8-bit twos complement integer representation for the questions that follow:

Q1: Give the bit sequence for the largest positive number.

Q2: Give the base 10 integer equivalent value for the bit sequence in Q1 above.

Q3: Add: 10110110 + 01110111

What is the resulting bit sequence?

What is the corresponding base 10 value?

Does this computation result in an overflow? Briefly explain.

Q4: Add: 01110111 + 01001111

What is the resulting bit sequence?

What is the corresponding base 10 value?

Does this computation result in an overflow? Briefly explain.

Q5: Add: 10111111 + 11111111

What is the resulting bit sequence?

What is the corresponding base 10 value?

Does this computation result in an overflow? Briefly explain.

Problem 7. (taken from the text Question 2.86 page 137)

Intel processors support "extended precision" floating point format with 80 bits that includes a single "integer bit" representing the hidden or implied leading 1 in the IEEE representation. The integer bit is "1" for normalized values (indicating a 1 immediately to the left of the binary point, and it is "0" for non-normalized values. Using a highly abbreviated (8-bit) version of this format with 1 sign bit, 4 exponent bits, the single integer bit, and 2 fraction bits, give the bit representations for the floating point numbers requested below.

Q1: 0.0

Q2: -1.0

Q3: 1/16

Q4: 1.25

Q5: 2.0

Problem 8.

For each of the following propositions in the context of a C program, indicate if they are true or false. If false, give a counter example. Assume that the variables are declared as follows:

int x, y; // 32 bit integers

unsigned u; // 32 bit unsigned integer

and initialized to some unknown values. We have given the first answer as an example.

TRUE/FALSE Counter Example

01..1 + 1 → 10..0 which
If x > 0 then x + 1 > 0 FALSE
is negative

If x < 0 then x -1 < 0

If x > 0 then x * x > 0

(~u <= 0) == FALSE

If x < 0 then u > x

If x > -y then -x < y

(x << m) >> m == x

u & 0 == 0

If x >= 0 then ~x <= -x - 1

Attachment:- Assignment.rar

Reference no: EM131325449

Questions Cloud

Influence the attitudes and behaviors of employees : Choose two organizations that you feel have different organizational cultures - Explain how these organizations' cultures influence the attitudes and behaviors of employees.
What makes communication dynamic : What makes communication dynamic? What is a consequence of too much cohesion in a group
Find the premium on an at the money paylater call option : Find the premium on an at-the-money paylater call option. Then determine the market value of the option nine months later if the stock is at 110.
Type of classes of infections : What type of classes of infections may yeast and molds cause?
What is the corresponding base ten value : What is the resulting bit sequence? What is the corresponding base 10 value? Does this computation result in an overflow? Briefly explain. What is the complete hexadecimal value of a?
Template and newly synthesized strands : Do you expect to find more H2A or more H3 histone molecules in a chromatin? Explain your answer. 4. Draw a DNA replication process in a eukaryotic cell. On your drawing, label:
Determine a fair price for two year assetor nothing option : Determine a fair price for a two-year assetor-nothing option with exercise price of 120.- calculate your profit if the asset price at expiration is (1) 138 and (2) 114.
Summarize the christian worldviews response : Briefly summarize the Christian worldviews response to the problem of evil and suffering. Cite and reference the lecture and/or Chapter 9 in the textbook.
What about the charges at your doctors or dentists office : Are you among those who believe that hospital bills are excessive?What about the charges at your doctor's or dentist's office?Describe an experience with a bill that you received at a hospital or doctor's office.Should the government intervene to con..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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