I am a little rusty on subnetting, but I will give it a shot.
10.0.0.0 is a class A network, in order to subnet from a /8 to a /20 (255.255.240.0) we must borrow 12 bits.
255.0.0.0 = 11111111.00000000.00000000.00000000
255.255.240.0 = 11111111.11111111.11110000.00000000
so based on the following formula, the number of subnets = 2^n where n is number of bits being borrowed. so 2^12 = 4096 subnets
to find number of host per subnet we can use this formula (2^n)-2 so 4096-2 = 4094 host per subnet.
10.0.0.0 is a class A network and default mask is 255.0.0.0.
Step 1 - How 255.0.0.0 become 255.255.240.0?
From: 1111 1111. 0000 0000. 0000 0000. 0000 0000
To: 1111 1111. 1111 1111. 1111 0000. 0000 0000
By looking at the binary, you can tell that you have borrowed 12 bits of '1s' for subnetting.
After you determine the number of bits you have borrowed for subnetting, you the following formulas to find out the number of subnets and number of hosts per subnet
No. of subnet = 2^x = 2^12 = 4096 subnets
*** x refers to number of borrowed bits or the ones
No. of hosts per subnet = 2^y - 2 = 4096 - 2 = 4094 hosts per subnet
*** y refers to number of unborrowed bits or the zeros
Why minus 2? This is because in a subnet, there are two reserved addresses: the subnet address and the broadcast address.
Hope it helps.
I think its worth pointing out that when counting the hosts you count up the Zeros in the subnet mask not the borrowed bits. This example kind of masks that because you are borrowing 12 bits from the host and you are left with 12 host bits as well.
however in a different example
the regular mask for a class C network in binary is:
the new one is
we borrowed one bit so 2^n = 2^1 = 2 subnets
for the hosts we count the number of host bits left over (the zeros) so:
(2^n) - 2 = (2^7) -2 = 128 - 2 = 126 hosts.