Kat Rollo 23 Report post Posted September 23, 2013 Instructions: Convert these decimal numbers to 5-bit 2's-complement form, if possible. If not possible, explain why this is so.(16) base 10According to the online converter: I am only using the converter to check my answers. Our professor will not credit work without solution.From what I understand,If decimal is positive:STEP 1: Convert magnitude to binary.STEP 2: Pad 0's to desired bitsize.If decimal is negative:STEP 1: Convert magnitude to binary.STEP 2: Pad 0's to desired bitsize.STEP 3: Invert bits to achieve 1's-complement.STEP 4: Add 1 to achieve 2's-complement.Since 16 is positive, I simply converted it to binary by repeated division yielding (10000) base 2.I no longer padded 0's since it is already 5-bits (containing 5 digits).Can somebody explain to me why the online converter is returning an error (which also I strongly believe is the correct answer)?I would love to understand this concept. Thank you. Share this post Link to post Share on other sites
daytrader 203 Report post Posted September 25, 2013 home work, I see..... Share this post Link to post Share on other sites
Kat Rollo 23 Report post Posted September 29, 2013 Yes it is, but I understand now. 2^5 = 32 The signed decimal range is -16 to +15, which is 32 integers (including 0). Therefore, +16 is out of range. Also, positive values must always be represented with a leading 0. Negative values must be represented with a leading 1. However, the 5-bit limit prevents the addition of another bit. The (10000) base 2 is the two's-complement of -16 in decimal. 1 Share this post Link to post Share on other sites
Saran999 288 Report post Posted September 29, 2013 Thanks for the explanation kathy025. I've tried to find out a solution, but without success. I was still thinking about it but then I've found your same answer, that is far better than what I was thinking. So, mystery solved and thank you again for curing my headache. Cheers 1 Share this post Link to post Share on other sites