0

Given the following signed integer values, write their corresponding 16-bit 2's complement representations and decimal/hexadecimal values.

So I'm given the hexadecimal number E0B7, converting that to binary gives me 1110 0000 1011 0111. Not sure if this question wants me to find the 2's complement of this number (I know that I have to invert digits and add 1 to get that) or just give this binary number. It's mostly "signed integer values" and "2's complement representations" throwing me off. Converting E0B7 to decimal is just gives me 57527 so that's easy.

Question 2 gives me the decimal number 146, which converts to 92 in hexadecimal. Same deal though, not sure how to convert to 2's complement.

Then there's also the same question but 32-bit. The numbers for that question are F0D1 and -2450.

Edit: I think my main confusion is this. When I'm given a signed integer value in hex/dec, and I convert to binary, do I interpret this in 2's complement or not? So for my example, E0B7 to 1110 0000 1011 0111, is this a negative number or am I supposed to find the 2's complement, which then starts with 0, so it's a positive number?

  • 1
    I cannot understand what you are asking. You seem to have answered your own question. "Signed integer values" allows for positive and negative numbers, such as the F0D1 and -2450 that you provided. You told us (correctly) how to make a 2-complement number. What's left that you don't understand? – Brick Oct 01 '18 at 12:29
  • I just wasn't sure if I give the binary conversion or convert the number to 2's complement. It's mainly the phrasing of the question. So E0B7 is a signed integer value, when converting to binary it starts with a 1 which means it's a negative number? In that case, is the decimal conversion -8009? – Karan Bijani Oct 01 '18 at 12:37

0 Answers0