Find minimum two’s-complement value with three ones
BitkernelSoftware Engineer · Online AssessmentLast updated
This question evaluates understanding of two's-complement representation and bit-level reasoning, specifically how constrained bit counts affect signed 8-bit integer values.
An 8-bit signed integer uses two's complement representation and has exactly three 1 bits and five 0 bits.
What is the smallest (most negative) value that can be represented under these constraints?
Options:
- A.
-127 - B.
-32 - C.
-125 - D.
-3
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.