Skip to content

Instantly share code, notes, and snippets.

@sakshi-git08
Created January 17, 2021 18:07
Show Gist options
  • Save sakshi-git08/ce096c11ecb261783041b730fb3c81f5 to your computer and use it in GitHub Desktop.
Save sakshi-git08/ce096c11ecb261783041b730fb3c81f5 to your computer and use it in GitHub Desktop.
Knowledge
1 bit can take 0 or 1
1 Byte = 8 Bits
The first bit is used as a sign ( - or + )
then remaining bits are 7
so we can write 2^7 = 128 different numbers for one sign
we get 0 as a positive sign. then we have 128 numbers for the negative side,127 numbers for the positive side and 0 (zero)
so the range is -128 to 127 including 0
-2(bits-1) and for the maximum range, it is 2(bits-1)-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment