24 bits means that there are 24 bits (zeros or ones) that together create a binary number.
If you need all combinations or all numbers that can be expressed with 24 bits, this is just a range from 0 to 16777215. Why? here is a table in the format (binary = decimal):
000000000000000000000000 = 0 000000000000000000000001 = 1 000000000000000000000010 = 2 000000000000000000000011 = 3 .... .... 111111111111111111111110 = 16777214 111111111111111111111111 = 16777215
you really don't need to generate anything. You can check the binary for decimal: http://www.binaryhexconverter.com/binary-to-decimal-converter
Another thing: sometimes leading zeros are omitted in binary format. Thus, the decimal digit is not 000000000000000000000011, but rather equal to 11. If the length is 24 and the first digit is 1, its only range is 8388608 - 16777215
source share