Skip to content
BetterDL

Most significant bit (MSB)

Also called: high-order bit, leftmost bit, top bit

The leftmost bit of a binary number, the one with the largest weight (2ⁿ⁻¹ in n bits). In two's complement it is also the sign bit.

The most significant bit (MSB) is the leftmost bit of a binary number. "Significant" means "how much it matters": flipping the MSB changes the value more than flipping any other bit.

In an n-bit number the MSB is bit n − 1, with weight 2ⁿ⁻¹. In 8 bits it's bit 7, worth 128. In 4 bits it's bit 3, worth 8.

The MSB has extra jobs in signed formats:

  • In twos complement, its weight is negative (−2ⁿ⁻¹), so MSB = 1 means the number is negative. It doubles as the sign bit.
  • In sign magnitude, it is only a sign flag and has no weight at all.
  • When widening a two's complement number, sign extension copies the MSB into every new bit.

It matters in arithmetic too. Signed overflow is detected by comparing the carry into the MSB column with the carry out of it.

Watch out: the MSB depends on the width. 0101 has MSB 0 in 4 bits, but written as 101 in 3 bits its MSB is 1. Always know how many bits you're working with.

1
128
0
64
0
32
1
16
0
8
1
4
1
2
0
1

Worked example

Example

Finding the MSB and its weight

Take the 8-bit pattern 10010110.

  1. 1.

    The MSB is the leftmost bit: 1.

  2. 2.

    It is bit 7, with weight 2⁷ = 128.

  3. 3.

    The pattern is worth 128 + 16 + 4 + 2 = 150. Flip the MSB and it becomes 22, a change of 128. Flipping the LSB would change it by only 1.

  4. 4.

    Read as 8-bit two's complement, MSB = 1 means negative: 150 − 256 = −106.

Common mistakes

  • Saying the MSB is always 1. Leading zeros count: 00010110 has MSB 0.

  • Treating MSB = 1 as negative for unsigned numbers. Only signed formats use it as a sign.

  • Forgetting that the MSB depends on the width you're using.

Practice Most significant bit (MSB)

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Most significant bit (MSB) is taught in Number Systems and Adders and ALUs.