1.) Express each decimal number as an 8-bit binary number in the 2's complement form and then find the negative of the representation of that number in two’s compliment

a.) +18

b) -117

Thanks for any help!

Two's complement is a notation that represents both positive and negative numbers. The most significant (left-most) is the sign bit, which is turned on when the number is negative.

Unlike the one's complement, there is only one representation of zero.

For an eight-bit number, the range goes from -128 to 127.

A positive number is represented by a usual binary number format, using the 7 low-order (right-most) bits, and represent from 0 to 127.

A negative number is simply the reversal of the bits and then add 1.

Example:
10(decimal)=00001010(binary)
-10(decimal)=11110101 + 1
=11110110

18(decimal)=00010010(binary)
-18(decimal)=11101101 + 1
=11101110

and so on.

To negate a negative number, subtract one and reverse the bits.

For example,
-18(decimal)=11101110
subtract 1
11101101
Reverse bits
00010010 (binary -18)

a) Sure, let's convert +18 to an 8-bit binary number in the 2's complement form:

+18 in binary = 00010010

Now, let's find the negative of the 2's complement representation of +18:

Negative of 00010010 in two’s complement = 11101110

So, the negative representation of +18 in two’s complement is 11101110.

b) Alright, let's convert -117 to an 8-bit binary number in the 2's complement form:

-117 in binary = 10001011

Now, let's find the negative of the 2's complement representation of -117:

Negative of 10001011 in two’s complement = 01110101

So, the negative representation of -117 in two’s complement is 01110101.

Hope that helps! Let me know if you have any more questions or if you need a joke to lighten the mood.

a) +18:

To convert a positive number to 2's complement form:

Step 1: Convert the positive number to binary.
18 in binary = 00010010

Step 2: Pad the binary number with leading zeros to make it 8 bits.
00010010

Step 3: The binary number obtained from step 2 is the 2's complement representation of the positive number.

Now, to find the negative representation of the number in 2's complement form:

Step 4: Invert all the bits of the 2's complement representation obtained from step 3.
11101101

Step 5: Add 1 to the inverted bits.
11101110

Therefore, the 8-bit binary representation of +18 in 2's complement form is 00010010, and the negative of +18 in 2's complement form is 11101110.

b) -117:

To convert a negative number to 2's complement form:

Step 1: Convert the absolute value of the negative number to binary.
117 in binary = 01110101

Step 2: Invert all the bits of the binary number obtained from step 1.
10001010

Step 3: Add 1 to the inverted bits.
10001011

Therefore, the 8-bit binary representation of -117 in 2's complement form is 10001011.

To express decimal numbers as 8-bit binary numbers in two's complement form, follow these steps:

1. Convert the positive decimal number to binary using the usual binary conversion method.

2. If the number is positive, leave it as is and pad the binary representation with leading zeros to make it 8 bits long.

3. If the number is negative, find the two's complement representation by performing the following steps:
a) Convert the positive decimal number to binary.
b) Invert all the bits (change 1s to 0s and 0s to 1s).
c) Add 1 to the inverted number.

Once you have the binary representation, you can find the negative representation by negating all the bits (changing 1s to 0s and 0s to 1s) and then adding 1.

Let's solve the given examples step by step:

a) +18:

1. Convert 18 to binary: 18 = 00010010 (since 16 + 2 = 18).

2. Padding to make it 8 bits long: 00010010.

3. The positive representation is 00010010, and the negative representation is found by negating the bits and adding 1. So the negative representation is: -18 = 11101110 + 1 = 11101111.

Therefore, +18 in 8-bit two's complement form is 00010010 and its negative representation is 11101111.

b) -117:

1. Convert 117 to binary: 117 = 01110101 (since 64 + 32 + 16 + 4 + 1 = 117).

2. Padding to make it 8 bits long: 01110101.

3. The positive representation is 01110101, and the negative representation is found by negating the bits and adding 1. So the negative representation is: -117 = 10001011 + 1 = 10001100.

Therefore, -117 in 8-bit two's complement form is 10001011 and its negative representation is 10001100.