In: Computer Science
Represent -34 and +67 in the following way:
a) 8 bit 1's complement representation.
For the first question, -34 to find the 1'complement
We have to find the binary number of 34 (i.e) 100010 this is 6 bit. Inorder to represent it in 8 bit representation and while dealing with signed integers the left most bit in 8 bit representation represents the sign of the integer (i. e) 0 for positive integer and 1 for negative integer.
So for, 34 -> 00100010. The left most bit 0 represent it as positive number.
So -34 is represented as 10100010. The left most bit is 1 because it is negative number.
Now, take 1's complement of 34, convert 0 to 1 and 1 to 0.
11011101. Here the left most bit should be 1 since it is a negative number. This is the 8 bit representation of 1's complement of -34.