I'm trying to identify the classes of IPV4 IP's. I convert the first octet or block into binary and then i follow the algorithm here in the photo. My problem is when the IP starts with 7 for example then its binary is 111 and it doesn't match any of classes and another thing when i turn 47 for instance to binary (101111) then it should belong to class B but instead its class is A and i don't know why?
The binary number you have separated on each net doesn't mean the class definition, a class is defined by the network portion, for example the ip you mention that starts with 7 belongs to the A class:
7 = 00000111
The A class defines the first 8 bits as the network portion The B class defines the fisrt 16 bits as the network portion The C class defines the first 24 bits as the network portion
Check the following tables and let me know if you have more questions.