-1

I have this example:

If we take the binary representation of the decimal value 220 (1101 1100) and we wanted to extract the higher 4 bits, we could use a bitmask with the boolean AND operation:

      1101 1100 (220)
 AND  1111 0000 (240)
      _________
      1101 0000 (208)

I need to know how to get 240.

logi-kal
  • 7,107
  • 6
  • 31
  • 43

1 Answers1

0
2**7 + 2**6 + 2**5 + 2**4 = 240

Where ** is exponentiation.

Ludwig Schulze
  • 2,155
  • 1
  • 17
  • 36