Back to the 2017 paper

Module 1: Functional Block of computer and Data representaion

20172m

Write the range of decimal integer that can be represented by n-bit 2’s complement representation.

Worked SolutionAI Assisted

Answer: Range −2n−1-2^{n-1} to 2n−1−12^{n-1}-1

Explanation (n-bit 2's complement):

  • Most negative number: 100...0100...0 = −2n−1-2^{n-1}
  • Most positive number: 011...1011...1 = 2n−1−12^{n-1}-1
  • Total distinct values: 2n2^n
  • Single representation of zero (unlike 1's complement / sign-magnitude).
  • e.g., for n=8: −128-128 to +127+127; for n=4: −8-8 to +7+7.

This is the range used in ALU and modern processors for signed integers.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.