In an integer encoding of 8 bits 10101010 you have 0-255 possibilities.
In total 256 different possibilities as there are 8 1s and 0s. How many different possibilities would I get if I had 10 bits instead of 8?
How would I calculate that in PHP?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you are thinking of binary rather than hexadecimal? Binary is base 2 (hence either 0 or 1s) where as Hexadecimal is base 16.
Assuming you are talking about binary:
Etc…
You can therefore use the PHP pow function: