Back to the 2016 paper

Module 1: Functional Block of computer and Data representaion

20162m

(a) Write the range of decimal integer that can be represented by n-bit 1’s complement representation.

Worked SolutionAI Assisted

Answer: Range −(2n−1−1)-(2^{n-1}-1) to +(2n−1−1)+(2^{n-1}-1)

Explanation (n-bit 1's complement):

  • Positive numbers: 00 to 2n−1−12^{n-1}-1 (leading bit 0)
  • Negative numbers obtained by complementing bits: −(2n−1−1)-(2^{n-1}-1) to −0-0
  • Two zeros: +0=00...0+0 = 00...0 and −0=11...1-0 = 11...1 - wasted code, hence 2n−12^n-1 effective values but 2n2^n encodings.
  • e.g., n=8: −127-127 to +127+127; n=4: −7-7 to +7+7.
  • Contrast with 2's complement: −2n−1-2^{n-1} to 2n−1−12^{n-1}-1 (single zero, one extra negative value).

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.