If number of addreses required in a subnet is "N" , then you need 2 more (network and bcst addreses) in addition to "N". So "N+2" is rounded of to Next 2 to the power . For e.g if we need 64 addresses in a subnet then , 66 rounded to next 2 to the power is is 2**7 ie 128. so number of bits required is 7.