Question

In: Electrical Engineering

Which of the following number formats can be used to represent all integers in the range...

Which of the following number formats can be used to represent all integers in the range 0 to 4,294,967,295?

A) unsigned integer (32 bits)

B) sign magnitude (32 bits)

C) two's complement (32 bits)

D) floating point format (IEEE754 single precision)

Solutions

Expert Solution

(a) Unsigned Integer (32 bit)

For unsigned Integer repesentation using n bits , the range of numbers that can be represented is 0 to 2n-1.

For example, if we have two bits, then we can represent 0 to 3.

If we have four bits, we can represent 0 to 15.

And if we have 32 bits we can represent 0 to 232-1 i.e., 0 to 4294967295. Hence this representation can be ised.

(B) Sign Magnitude 32 bits.

In this , if we have n bits, the MSB bit is used to represent the sign and the rest n-1 bits are used to represent the magnitude. i.e., here we have 31 bits to represent magnitude. The range is - (2n-1-1)to  + (2n-1-1). The maximum positive value that can be represented using 32 bits is 2147483647. Hence this representation cannot be used.

(C) Two's complement 32 bit

The range of numbers that can be represented using n bit 2's complement is
-( 2n-1) to 2n-1 - 1

Hence this representation also cannot be used. As it would not give the complete needed range.

(D) IEEE754 single precision representation

IEEE 754 32-bit base-2 floating-point variable has a maximum value of (2 ? 2?23) × 2127 ? 3.402823 × 1038. All integers with 6 or fewer significant decimal digits, and any number that can be written as 2n such that n is a whole number from -126 to 127, can be converted into an IEEE 754 floating-point value without loss of precision. Hence this can be used.


Related Solutions

Write a program that inputs three integers in the range [1..13] that represent a hand of...
Write a program that inputs three integers in the range [1..13] that represent a hand of three cards. Your program should output an English evaluation of the hand. In the output, cards will be described as follows: - 2–10 are described by the words for their numeric values: two, three, etc. - 1 is called an ace, 11 is called a jack, 12 is called a queen, and 13 is called a king. The evaluation of a hand is based...
Write a C++ program that inputs three integers in the range [1..13] that represent a hand...
Write a C++ program that inputs three integers in the range [1..13] that represent a hand of three cards. Your program should output an English evaluation of the hand. In the output, cards will be described as follows: - 2–10 are described by the words for their numeric values: two, three, etc. - 1 is called an ace, 11 is called a jack, 12 is called a queen, and 13 is called a king. The evaluation of a hand is...
Are used to represent the charge of an ion. Represent the number of element/units in a...
Are used to represent the charge of an ion. Represent the number of element/units in a molecule. Are use as symbols to identify elements. Are used to represent the ratios of reactants in a chemical equation. 1. Subscripts 2. Coefficients 3. Superscripts 4. Capital and lower case letters.
which of the following formats should be used when an SOP includes multiple decision-making steps?
which of the following formats should be used when an SOP includes multiple decision-making steps?
Program Name: Divisible. Write a program that calculates the number of integers in a range from...
Program Name: Divisible. Write a program that calculates the number of integers in a range from 1 to some user-specified upper bound that are divisible by 3, the sum of those integers, and the number and sum of those integers not divisible by 3. Your program must display meaningful output which includes: the selected upper bound number of integers divisible by 3 sum of integers divisible by 3 number of integers not divisible by 3 sum of integers not divisible...
Program Name: Divisible. Write a program that calculates the number of integers in a range from...
Program Name: Divisible. Write a program that calculates the number of integers in a range from 1 to some user-specified upper bound that are divisible by 3, the sum of those integers, and the number and sum of those integers not divisible by 3. Your program must display meaningful output which includes: the selected upper bound number of integers divisible by 3 sum of integers divisible by 3 number of integers not divisible by 3 sum of integers not divisible...
The range of integers that can be represented by this 12-bit construction is -255 to 255...
The range of integers that can be represented by this 12-bit construction is -255 to 255 (a 9-bit signed integer has a range of -256 to 255). What are the floating-point representations for the first eight, odd, positive, decimal integers (i.e., 1, 3, 5, 7, 9, 11, 13, 15) in this 12-bit notation?
Explain all the available types of diagrams that can be used to represent object interactions. Your...
Explain all the available types of diagrams that can be used to represent object interactions. Your explanation should include the characteristics of these diagrams and its main purpose Subject : Object Oriented Analaysis and Design
Given an array A[1..n] of integers - all of whose numbers are in the range [0,...
Given an array A[1..n] of integers - all of whose numbers are in the range [0, n^3 − 1] give an algorithm which sorts them in O(n) time.
Which number set can you find: a. the inverse of integers under multiplication? b. the inverse...
Which number set can you find: a. the inverse of integers under multiplication? b. the inverse of natural numbers under multiplication?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT