SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
Data Representation In Computer Systems
Exercise:
Exercises
Question:8 | ISBN:9780763704445 | Edition: 3

Question

8. From the results of the previous two questions, generalize the range of values (in decimal) that can be represented in any given x number of bits using:

a) Signed magnitude

b) One’s complement

c) Two’s complement

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

a)

Signed magnitude: For a given x number of bits, in signed magnitude representation, the range of values that can be represented is as follows:

  • Positive values: 0 to (2^^{x-1}) - 1
  • Negative values: -(2^^{^{x-1}}) to -1

 

b)

One's complement: For a given x number of bits, in one's complement representation, the range of values that can be represented is as follows:

  • Positive values: 0 to (2^{x-1}) - 1
  • Negative values: -1 to -(2^^{x-1})

c) Two's complement: For a given x number of bits, in two's complement representation, the range of values that can be represented is as follows:

  • Positive values: 0 to (2^{x-1}) - 1
  • Negative values: -2^^{x-1} to -1

In two's complement representation, one additional negative value can be represented compared to signed magnitude and one's complement. This is due to the elimination of redundancy where both positive and negative zero are represented separately in signed magnitude and one's complement representations.

It's important to note that the range of values assumes the use of all x bits in the representation. If the leftmost (most significant) bit is reserved for the sign, the range of positive values will be slightly reduced to accommodate the sign bit.

0 0

Discussions

Post the discussion to improve the above solution.