The maximum number of host bits that can be borrowed from a class A address is 22 (technically you could borrow 23 but the resulting network would be useless).
A class A address uses 8 bits for its network address and 24 bits for its host addresses. Class A uses a subnet mask of 255.0.0.0
You can only borrow 22 bits (instead of 24) because a valid network requires 4 addresses: A network address, two host addresses and a broadcast address. These networks would result in 30 bits used for the network address and 2 bits used for the host addresses. These networks use a subnet mask of 255.255.255.252
14
Since this is a class B network you have borrowed 8 bits for subnets. This leaves 8 bits left (1 octet) for clients/workstations. That gives you a maximum of 254 clients per subnet.
You can borrow 6 bits. Which would create a 255.255.255.252 subnet mask, but this subnet only contains 2 usable IP addresses. 7 bits would be 255.255.255.254, but that subnet is too small to have any use in the real world.
Thirty bits make up the network portion of a class C address. Three bits are borrowed for the subnet mask. There is also a class A and a class B that are comprised of bits.
192 is equal to 2 bits borrowed 2^2 = 4 the number of subnets and host are 64 because 2 bits borrowed from the 8 bits of a class C network is 6, therfore 2^6 = 64.
5 bits are necessary to create up to 30 subnets.
20
65536
When you borrow bits for a subnet you are intruding into the client portion of an IP address. As a result, you will lose clients in your network because the "borrowed" portion becomes the extended network prefix. This allows you to separate your bigger network into smaller, logical networks (subnets). The number of bits borrowed will indicate the total number of smaller subnets that you can support in your network. In each case, regardless of class of address, borrowing 4 bits gives a total of 14 subnets (in the classical sense) and 16 subnets (in Cisco).
255
4294967295
To calculate a subnet mask, first determine the number of subnets or the number of hosts required, which will dictate how many bits you need to borrow from the host portion of the IP address. Convert the required number of bits into binary, then combine this with the default subnet mask for the IP class (Class A, B, or C). Finally, count the total number of bits used for the network (original bits plus borrowed bits) and convert this into the subnet mask format, typically expressed in CIDR notation (e.g., /24). Validate your calculation by ensuring the number of available subnets or hosts meets your requirements.