Solved: Two's complement representations of integers are

Problem 41E Chapter 4.2

Discrete Mathematics and Its Applications | 7th Edition

• 2901 Step-by-step solutions solved by professors and subject experts
• Get 24/7 help from StudySoup virtual teaching assistants

Discrete Mathematics and Its Applications | 7th Edition

4 5 0 404 Reviews
16
5
Problem 41E

Two's complement representations of integers are also used to simplify computer arithmetic and are used more commonly than one's complement representations. To represent an integer x with -2n-1 ≤ x ≤ 2 n-1 -1 for a specified positive integer n, a total of n bits is used. The leftmost bit is used to represent the sign. A 0 bit in this position is used for positive integers, and a I bit in this position is used for negative integers. just as in one's complement expansions. For a positive integer, the remaining bits are identical to the binary expansion of the integer. For a negative integer, the remaining bits are the bits of the binary expansion of 2 n-1 - |x|. Two's complement expansions of integers are often used by computers because addition and subtraction of integers can be performed easily using these expansions, where these integers can be either positive or negative.

Answer Exercise 35 if each expansion is a two's complement expansion of length five.

EXERCISE 35 One's complement representations of integers are used to simplify computer arithmetic. To represent positive and negative integers with absolute value less than 2n-1, a total of n bits is used. The leftmost bit is used to represent the sign. A 0 bit in this position is used for positive integers, and a 1 bit in this position is used for negative integers. For positive integers, the remaining bits are identical to the binary expansion of the integer. For negative 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 docs each of the following one's complement representations of length five represent?

a) 11001

b) 01101

c) 10001

d) 11111

Step-by-Step Solution:

Step 1</p>

We have to explain the following in two’s complement representation.

Step 2</p>

a)11001.

Here the first bit is 1 .Consider the remaining . That is 1001. Corresponding integer is

1001 =  .

Therefore the  string  represents  an integer

[since the first bit is 1, integer is negative].

Or

First find one’s complement of 11001, that is 00110

We get 00110 +1 =00111

Then find corresponding integer

00111=

Since the first bit is 1 the integer is negative .Hence we get -7.

Step 3</p>

b) 01101

Here the first bit is zero.Therefore the binary expansion is

01101 =

Step 4 of 5

Step 5 of 5

Related chapters

Unlock Textbook Solution

Solved: Two's complement representations of integers are

×
Get Full Access to Discrete Mathematics And Its Applications - 7th Edition - Chapter 4.2 - Problem 41e

Get Full Access to Discrete Mathematics And Its Applications - 7th Edition - Chapter 4.2 - Problem 41e

I don't want to reset my password

Need help? Contact support

Need an Account? Is not associated with an account
We're here to help