Sign bit

In computer science, the sign bit is a bit in a signed number representation that indicates the sign of a number. Although only signed numeric data types have a sign bit, it is invariably located in the most significant bit position,[1] so the term may be used interchangeably with "most significant bit" in some contexts.

Almost always, if the sign bit is 0, the number is non-negative (positive or zero).[1] If the sign bit is 1 then the number is negative. Formats other than two's complement integers allow a signed zero: distinct "positive zero" and "negative zero" representations, the latter of which does not correspond to the mathematical concept of a negative number.

When using a complement representation, to convert a signed number to a wider format the additional bits must be filled with copies of the sign bit in order to preserve its numerical value,[2]: 61–62  a process called sign extension or sign propagation.[3]

  1. ^ a b "Intel® 64 and IA-32 Architectures Software Developer's Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4". Intel. Retrieved 2024-03-13.
  2. ^ Cite error: The named reference Bryant was invoked but never defined (see the help page).
  3. ^ "Data Dictionary (Glossary and Algorithms)". Adroit Data Recovery Centre Pte Ltd. Archived from the original on 2017-04-19. Retrieved 2014-12-15.

Developed by StudentB