Problem

Two’s complement representations of integers also are used to simplify computer arithmetic...

Two’s complement representations of integers also are used to simplify computer arithmetic (infact, they are used much more commonly than one’s complement representations). To represent an integer x with −2n−1x ≤ 2n−1 − 1, n bits are used.

The leftmost bit represents the sign, with a 0 used for positive integers and a 1 for negetive integers.

For a positive integer, the remaining n − 1 bits are indentical to the binary expansion of the integer. For a negetive integer, the remaining bits are the bits of the binary expasions of 2n−1 − |x|.

What integers do the representations in Exercise represent if each is the two’s complement representation of an integer?

Exercise

One’s complement representations of integers are used to simplify computer arithmetic. To represent positive and negetive integers with absolute value less than 2n, a total of n + 1 bits is used.

The leftmost bit used to represent the sign. A 0 in this position is used for positive integers, and a 1 in this position is used for negetive integers.

For positive integers, the remaining bits are identical to the binary expansion of the integers. For negetive integers, the remaining bits are obtained by first finding the binary expansion of the absolute value of the integer, and then taking the complement of each of these bits, where the complement of a 1 is a 0 and the complement of a 0 is a 1.

What integer does each of the following one’s complement representations of length five represent?

a) 11001


b) 01101


c) 10001


d) 11111

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search