Here is the wikipedia entry
If you look at a simple iterative approach. You simply eliminate half of the items to search until you find the item you want.
Here is an explanation of how we come up with the formula.
Say first that you have N number of elements, and then you do ⌊N / 2⌋ as your first attempt. Where N is the sum of the lower bound and the upper bound. The first value of N will be (L + H), where L is the first index (0) and H is the last index of the list you are looking for. If you're lucky, the item you are trying to find will be in the middle [for example. You search 18 in the list {16, 17, 18, 19, 20}, then you calculate (0 + 4) / 2⌋ = 2, where 0 is the lower bound (L is the index of the first element of the array) and 4 is the upper bound (H is the index of the last element of the array). In the above case, L = 0 and H = 4. Now 2 is the index of the element you found 18. Bingo! You have found it.
If the case were a different array {15,16,17,18,19}, but you were still looking for 18, then you would be out of luck and you would do N / 2 first (this is ⌊ (0+ 4) / 2⌋ = 2, and then implementing element 17 in index 2 is not the number you are looking for. Now you know that you do not need to search at least half the array the next time you try to search in an iterative manner. Basically you are not looking at half the list of elements that you searched earlier, every time you try to find an item that you could not find in your previous attempt.
In the worst case, it will be
[N] / 2 + [(N / 2)] / 2 + [((N / 2) / 2)] / 2 .....
ie:
N / 2 1 + N / 2 2 + N / 2 3 + ..... + N / 2 x .....
until ... you have finished searching where in the element you are trying to find is at the end of the list.
This shows the worst case when you reach N / 2 x where x is such that 2 x = N
In other cases, N / 2 x where x is such that 2 x N The minimum value of x may be 1, which is the best case.
Now, since the mathematically worst case is when the value is 2 x = N
=> log 2 (2 x ) = log 2 (N)
=> x * log 2 (2) = log 2 (N)
=> x * 1 = log 2 (N)
=> More formally ⌊log 2 (N) + 1⌋