Counting the Number of MSB Zeros
The simplest approach is to produce a "one-hot" output for the least significant bit which is preceded by all "zeroes" [there will only be one such bit].  Each bit of the count will then be the "or" of half the one-hot outputs.  For example, in an 8-bit system one could get a three-bit count of leading bits by ORing together one-hot outputs 0, 2, 4, and 6 for the LSB of the count, one-hot outputs 0, 1, 4, and 5 for the middle bit of the count, and outputs 0, 1, 2, and 3 for the MSB of the count.

If the number of bits is large, it may make sense to cascade smaller OR gates rather than giant ones of size N/2.  If this is done, smaller gates may be shared over multiple terms.  For example, if N is 16, the OR gate which is used to combine one-hots 0, 1, 2, and 3 could be combined with the one for one-hots 8, 9, 10, and 11 to produce bit 2 of the count, and with one-hots 4, 5, 6, and 7 to produce bit 3 of the count.