191k views
2 votes
One's complement representations of integers are used to simplify computer arithmetic. To represent positive and negative integers with absolute value less than 2"-1, a total of n bits is used. The leftmost bit is used to represent the sign: this bit is for positive integers and 1 for negative integers. For positive integers, the remaining bits are identical to the binary representation of the integer. Thus using 4 bits, the One's complement representation of 5 is 0101. For negative integers, the remaining bits are found by first finding the binary representation of the absolute value of the integer and then taking the complement of each of these bits in the binary representation. (Thus 1's and O's get switched) Thus for example using 4 bits, the One's complement representation of -5 is 1010, where the initial 1 is to indicate the sign, and the subsequent 010 is the complement of 101 the binary representation of 5. Find the One's Complement representations, using bit strings of length six, of the following integers. (Your answers must be bit strings of length 6):

(a) 28
(b) 26
(C) –16
(d) –25

1 Answer

5 votes

Final answer:

In One's complement representation using six bits, the number 28 is 011100, the number 26 is 011010, the number -16 is 101111, and the number -25 is 101110. The leftmost bit represents the sign, with 0 for positive and 1 for negative values.

Step-by-step explanation:

One's complement representation is a method used in computer science to represent signed integers. To determine the representation of positive and negative numbers using a one's complement system with six bits, follow these steps:

  • For a positive number, use the first bit as 0, followed by the binary representation of the number.
  • For positive 28, in binary it is 11100, hence its one's complement representation is 011100.
  • For positive 26, in binary it is 11010, hence its one's complement representation is 011010.
  • For negative numbers, use the first bit as 1, find the binary representation of its absolute value, and flip the bits.
  • For negative -16, in binary it is 10000, its complement is 01111, hence its one's complement representation is 101111.
  • For negative -25, in binary it is 11001, its complement is 00110, hence its one's complement representation is 101110.

To summarize, these representations are valid in systems that use six bits to encode signed integers via the one's complement method. The sign of the number is indicated by the leftmost bit, with 0 for positive and 1 for negative values.

User Mohan Ramanathan
by
8.5k points