Number of bits it takes to represent a number

  • Thread starter Thread starter iScience
  • Start date Start date
  • Tags Tags
    Bits
Click For Summary
The discussion centers on the formula for determining the number of bits required to represent a number in binary. The original formula, $$bits(x)= \frac{log(x)}{log(2)}$$, is critiqued for not accurately reflecting the bits needed, particularly for positive integers like 4, which requires 3 bits for its binary representation. Participants argue that while the formula can be adjusted for different contexts, such as positive or negative integers, it generally fails to account for necessary leading bits and representation nuances. The conversation also touches on data compression techniques and the complexities involved in representing numbers efficiently, emphasizing that the number of bits needed can vary based on the representation scheme used. Ultimately, the thread highlights the importance of understanding both the mathematical and practical aspects of number representation in computing.
  • #31
There are two subjects being discussed, and confused.
1. How many bits to represent a quantity of symbols
2. How to code numbers in binary.

Maybe my wording is not precise, but how many symbols one might use, and what people decide the symbols represent are, for the most part, orthogonal concepts.

For example, let's design a 3 bit binary coding system using 8 symbols to represent 0,1,2,3,4,5,6,7.
Let's design a 3 bit binary coding system using 8 symbols to represent -4, -3, -2, -1 0, 1, 2, 3.

What people decide to have each symbol represent defines the coding system. (For example, unsigned, sign-mag, and 2's comp are commonly accepted methodologies, but one can define anything)
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
7
Views
4K