Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Interpretation of Data Types Consider the 32-bit string represented as the hexadecimal number x476F 6C66 What value does this number represent for each of

1. Interpretation of Data Types

Consider the 32-bit string represented as the hexadecimal number x476F 6C66

What value does this number represent for each of the following representations?

  1. Unsigned
  2. 2's complement
  3. IEEE 754 floating point
  4. Extended-ASCII string

2. Unsigned representation vs. 2's complement

Order the next two sequences of numbers in ascending order twice. First, assume that the numbers are written in 8-bit unsigned and then in 8-bit 2's complement representation. Remember the different notations for binary, decimal and hexadecimal numbers.

  1. 0111 1100, 0101 1010, xDD, xEA
  2. x71, x8B, 1001 0110, 0110 1001

3. Logical operations

Perform the following bitwise logical operations.

  1. 1000 0111 OR (NOT(0010 1001) AND 1001 1001)

  2. NOT((xC0 AND xFF) OR xEE)

4. Conversion to floating point data type

Convert the following decimal numbers into their 32-bit floating point representation (IEEE single precision). You may use a calculator to do the required multiplications, but you must show your work, not just the solution.

  1. -59.75
  2. 0.3

Hint 1: Not all numbers can be represented exactly using the floating point data type, so do not expect that you will always reach 0 after many multiplications.

Hint 2: A rule of thumb to know if you did your calculations correctly is to convert back to decimal representation to check your answer.

5. Conversion from floating point data type

Convert the following 32-bit floating point numbers (IEEE single precision) into their decimal representation.

  1. 0100 0000 0100 1001 0000 1110 0101 0110

  2. 1100 0101 0001 1111 1000 0000 0000 0000

6. Code transformation

Before a program written in C can be executed on a computer, what step is required to be done first? Briefly explain this step.

7. Basic I/O in C

Write a few lines of code that will accomplish the following:

  1. Ask the user to first enter his/her weight (in pounds) and second enter the age. For every field to be filled in, print on screen the messages "Type your weight: " and "Type your age: " respectively.
  2. Print on screen on different lines the collected information with a message "Your weight is " and "Your age is ".

For this problem, there is no need to write any #include preprocessor directives or main() function in the solution. Just write the C language instructions needed to accomplish the required task, but do not forget to declare the variables needed to store entered value.

8. Operators

What is the value each of the following C expressions evaluate to? Assume a and b have been initialized with 0x3794 and 0x8268, respectively. Write your answers as hexadecimal numbers.

  1. a | b
  2. a ^ b
  3. ~a
  4. a & b

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

How do entrepreneurs and administrators differ?

Answered: 1 week ago