Overview: Mastering IPv4 Address Conversion
This session focuses on the essential skill of converting IPv4 addresses between dotted decimal (e.g., 192.168.1.1) and binary (e.g., 11000000.10101000.00000001.00000001) notation. The instructor emphasizes a simple, memorable technique using an 8-digit power-of-two sequence. Understanding the Structure of IPv4 Addresses provides the necessary foundation for this conversion work.
The Foundation: The 8-Bit Conversion Table
An IPv4 address is 32 bits long, organized into four octets of 8 bits each. The core of the conversion method is the sequence of 8 decimal values: 128, 64, 32, 16, 8, 4, 2, 1.
- Easy to remember: Start with 1, then multiply by 2 until you reach 128.
- Mathematical basis: This is 2 to the 7th power down to 2 to the 0th power (2^7, 2^6, 2^5... 2^0).
Method 1: Converting from Binary to Dotted Decimal
Goal: Take a 32-bit binary string and translate it into a human-readable dotted decimal format.
Steps:
- Break it down: Separate the 32-bit string into four 8-bit groups (octets).
- Place it in the table: For each octet, align the 8 bits (1s and 0s) under the 128, 64, 32, 16, 8, 4, 2, 1 table.
- Sum the values: Add up only the numbers where there is a binary 1.
- Repeat: Do this for all four octets to get four decimal numbers.
Example 1: Binary to Dotted Decimal
Input Binary: 10000001.00001011.01001011.11101111
- Octet 1 (10000001): 128 + 1 = 129
- Octet 2 (00001011): 8 + 2 + 1 = 11
- Octet 3 (01001011): 64 + 8 + 2 + 1 = 75
- Octet 4 (11101111): 128 + 64 + 32 + 8 + 4 + 2 + 1 = 239
Dotted Decimal Result: 129.11.75.239
Quick Trick for 239: All 8 bits set to 1 equals 255. 255 - 16 (the missing value) = 239.
Method 2: Converting from Dotted Decimal to Binary
Goal: Convert a dotted decimal IP address back into its binary form.
Steps:
- Start with the decimal number.
- Work left to right across the 128, 64, 32, 16, 8, 4, 2, 1 table.
- Check if the number is >= the table value.
- If yes, mark a 1 for that position, subtract the table value from your number, and move to the next position.
- If no, mark a 0 and move to the next position.
- Complete the 8 bits and repeat for the next octet.
Example 2: Dotted Decimal to Binary
Input Dotted Decimal: 145.14.6.8
- Octet 1 (145): 145 >= 128 -> 1 (145-128=17). 17 >= 16 -> 1 (17-16=1). 1 >= 1 -> 1 (1-1=0). Remaining: 32, 8, 4, 2 are 0. Result: 10010001
- Octet 2 (14): 14 >= 8 -> 1 (14-8=6). 6 >= 4 -> 1 (6-4=2). 2 >= 2 -> 1 (2-2=0). Remaining: 128, 64, 32, 16, 1 are 0. Result: 00001110
- Octet 3 (6): 6 >= 4 -> 1 (6-4=2). 2 >= 2 -> 1 (2-2=0). Remaining: 128, 64, 32, 16, 8, 1 are 0. Result: 00000110
- Octet 4 (8): 8 >= 8 -> 1 (8-8=0). Remaining: 128, 64, 32, 16, 4, 2, 1 are 0. Result: 00001000
Binary Result: 10010001.00001110.00000110.00001000
Key Takeaway & Homework
This systematic method ensures a unique, correct conversion for every possible IPv4 address. Practice is key to mastery. To deepen your understanding of how these addresses are organized, explore Classful Addressing Explained. For those preparing for certifications, Mastering CIDR and Subnetting is a logical next step.
Homework Problems:
- Convert
208.34.54.1from dotted decimal to binary. - Convert the binary address shown in the video to dotted decimal.
we are now in part two of ipv4 addresses we will start the session with outcomes upon the completion of the session the
learner will be able to understand the conversion of ip address from dot decimal to binary and vice versa so we
are going to ultimately focus on the conversion of ipv4 address from dota decimal to binary and from binary to dot
decimal let's start with the conversion process in order to convert the decimal to binary or from binary to decimal of
the ipv4 address we are going to follow this scheme we need to remember these 8 digits why ipv4 addresses are 32 bits
long how these 32 bits are organized these 32 bits are organized in four octets so every octet is going to be
with 8 bits these are the 8 digits which are going to be used for both the conversion
i will give you an easy way to remember these eight digits just start with one just multiply one
with two we will get the next digit that is 2 just multiply this with 2 we will get the next digit which is 4. just
multiply 4 with 2 we will get 8 8 into 2 is 16 16 into 2 is 32 32 into 2 it is 64 and 64 into 2 is 128 we need to stop the
sequence up to this why because we got 8 digits with the help of these 8 digits we can get 8 bits easily in other words
it is simply 2 power 0 that is this is 2 power 0 this is 2 power 1 this is 2 part 2 and up to 2 part 7 since it is
starting with 2 part 0 we need to end with 2 part 7 so that we will be getting the 8 bits
using this technique we can convert the dotted decimal to binary and the binary to dot a decimal let's start with the
first example example number one convert the ipv4 address from binary to dotted decimal notation
and we are given with the binary notation so we are required to convert this into dot a decimal so the solution
involves the methodology which i had projected so i have brought in that table now how to convert the given
binary into dotted decibel we know ipv4 addresses are of four octets that is 32 bits so let's start with the first octet
that is this software that is one six zeros one eight bits we have just we are going to take this enter 8 bits and just
like that we are going to place in this place so just observe i am going to place this one six zeroes and one just
like this one six zeros and one and that's it we are at the verge of the conversion of the binary to dot a
decimal of the first octet it is very simple you know then what is the decimal value the decimal value is the summation
of the places where we have one so where we have one we have one against 128 and we have one against one so we are going
to take only these two places because in these two places only we have the binary ones can you notice the binary ones so
the answer is 128 plus 1 128 plus 1 is 129 the first octet is 129. let's move on to the next octet so
what we are going to do we are going to take this and just like that we are going to place it and where on all we
have one we have one against eight two and one so the decimal notation is eight plus two plus one which is this eight
plus two plus one so eight plus two plus one is eleven so the second octet is eleven already we know this is one
twenty nine now this is eleven let's move on to the third octet the third octet just place this here and where all
we have one we have one again 64 8
2 and 1 so 64 plus 8 plus 2 plus 1 is 75 let's now move on to the last octet which is triple 1 0 double 1 double one
so i'm gonna place triple one zero double one double one where don't all we have one we have one in seven places so
we are going to take the seven places that is 128 plus 64 plus 32 plus eight plus 4 plus 2 plus 1 which is 239
and the last octet is 239 we can also solve this in other way when all bits are 1 what is the maximum
number we will get we know when all 8 bits are 1 in an ip address will be getting
255 so 255 we will consider this all bits to be 1 which is 255 let's subtract only 16 so 255 minus 16
we will be getting 239 so we can take any approach in order to solve this and that's it we saw the conversion of the
binary to dot a decimal notation so the answer for example one is 129.11.75.239 let's solve example number two in
example number two we are given with the dotted decimal notation and we are required to convert it into binary
notation so the question is convert the ipv4 address from daughter decimal to binary notation and the ip address is
given so for solving this also we are going to use the same methodology so let's focus on the first octet which is
145 how did i get this binary value it's very simple in order to get 145 what are the numbers we need from these set of
numbers from these eight numbers what are the numbers we need in order to get 145 so definitely we need 128 right 128
so i am putting a 1 against 128 so how many it is shortage 145 minus 128 we are shortage of 17 right one seven so how to
get 17 so 17 can be obtained using 16 and one so i am putting a 1 against 16 and 1 so we got 128 plus 16 plus 1 which
is 145 just fill 0s in the remaining places so we will be getting 1 0 0 1 0 0 0 1 which is this so the binary
equivalent for 145 is 1 0 one triple zero one let's move on to the second octet which is fourteen how can we get
fourteen with the help of these eight numbers so fourteen can be obtained with the help of eight so we need eight
definitely and how many shortage fourteen minus eight is six so we are six shortage we are putting one against
four and two because four plus two is six so eight plus four plus two is fourteen so we are putting one against
eight four and two so the binary equivalent for fourteen is double zero double zero triple one zero that is this
double zero double zero triple one zero and let's move on to the third octet which is six how can we get six it's
simply four plus two right so just use four plus two and fill zeros in the remaining places so we will be getting
this as the binary equivalent for the decimal six let's move on to the last octet which is eight so we can get eight
with the help of this place only so we are putting one against eight and we don't want other positions so just fill
zeros in other position so we'll be getting zero zero zero zero one triple zero so we are adopting this strategy
and converting the dotted decimal to binary and binary to dot a decimal some may have a question in their mind for
example let's take this number 14. for 14 can we get another possibility no there can be only one possibility when
we go with this approach because we can't put a 1 against 16 we need only 14 right so we can't use 16 we need only 14
so 14 can be obtained with only one possibility using this approach and what's the final answer
the final answer for this question is this before we conclude let's see the
homework question we have two questions question number one change the following ip address from
dotted decimal notation to binary notation and we are given with the ipv4 address 208.34.54.1
and question number two change the following ip address from binary notation to dotted decimal notation and
we are given with a binary notation pause this video for a while and solve this homework problem and post your
answers in the comment section i hope now you know the conversion of ipv4 address from daughter decimal to
binary and vice versa i hope you guys enjoyed the lecture and thank you for watching
[Music] [Applause] [Music]
you
This sequence represents the decimal values of each bit position in an 8-bit octet, calculated as powers of 2 from 2^7 (128) down to 2^0 (1). It provides a straightforward, systematic method to convert between binary and dotted decimal by simply summing values where bits are 1 or subtracting values when converting to binary.
Separate the 32-bit string into four 8-bit octets. For each octet, align the binary digits under the sequence 128, 64, 32, 16, 8, 4, 2, 1 and sum only the values where a 1 appears. For example, 10000001 yields 128 + 1 = 129, and 11101111 yields 255 minus the missing 16 (128+64+32+8+4+2+1 = 239). The result is 129.11.75.239.
For each decimal octet, work left to right across the sequence 128, 64, 32, 16, 8, 4, 2, 1. If the number is greater than or equal to the current value, write a 1, subtract that value, and continue with the remainder; otherwise, write a 0. For 145, you mark 1 at 128 (remainder 17), 0 at 64 and 32, then 1 at 16 (remainder 1), and 1 at 1, yielding 10010001. Repeat for all four octets to get 10010001.00001110.00000110.00001000.
Since 239 is close to 255 (the maximum value for an octet where all bits are 1), you can use the shortcut: 255 minus the missing value. For 239, the missing bit from 255 is 16 (since 255 - 239 = 16), so the binary representation is all ones except the bit representing 16. Thus, 11101111 (bits for 128, 64, 32, 8, 4, 2, 1 set to 1, and bit for 16 set to 0).
Start with 1, then repeatedly multiply by 2 until you reach 128. This yields 1, 2, 4, 8, 16, 32, 64, 128—then reverse it to get 128, 64, 32, 16, 8, 4, 2, 1 for standard conversion use. This sequence is the foundation for all binary-to-decimal and decimal-to-binary conversions in IPv4 addressing.
Yes, each possible 32-bit binary combination has exactly one unique dotted decimal equivalent, and vice versa. The systematic subtraction method ensures no ambiguity, as it always selects the largest possible power of two first. This guarantees a one-to-one mapping for the entire IPv4 address space (0.0.0.0 to 255.255.255.255).
Mastering conversion is critical for understanding subnetting, CIDR, and IP address planning, which are core topics in CCNA and other networking certifications. It allows you to compute network masks, identify host addresses, and verify route summarization efficiently, forming the basis for more advanced skills discussed in related sessions like 'Mastering CIDR and Subnetting'.
Keep this summary
Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.
Save to LunaNotesOr summarise for another video.
This summary and transcript were automatically generated using AI with the Free YouTube Transcript Summary Tool by LunaNotes.
Related summaries
Understanding IPv4 Addresses: Structure, Notations, and Validity
This lecture provides a comprehensive introduction to IPv4 addresses, covering their 32-bit structure, binary and dotted decimal notations, and how to identify valid versus invalid IP addresses. Learn about address space, uniqueness, and the role of NAT technology in managing billions of devices.
IPv4 Address Classes Explained: Class A, B, C, D, E Identification Guide
This tutorial provides a comprehensive breakdown of the five classes of IPv4 addresses (A, B, C, D, and E). Learn how to identify each class using binary notation and dotted decimal format, with clear examples and a practical activity to test your understanding.
Mastering CCNA Subnetting: CIDR and Efficient IP Addressing
This video provides a clear, step-by-step introduction to subnetting for the CCNA, focusing on CIDR (Classless Inter-Domain Routing) and the efficient allocation of IPv4 addresses. Learn the fundamentals of IPv4 classes, how subnetting solves IP address waste, and practice calculating subnet sizes to optimize network design.
Understanding Number Systems and Binary Conversion in Python
This video tutorial explains the fundamentals of various number systems including binary, octal, decimal, and hexadecimal, focusing on their significance in programming. Learn how to convert decimal numbers to binary using Python's built-in functions and understand manual conversion techniques for accuracy and better comprehension. Practical examples and homework exercises enhance your grasp on number system conversions essential for programming tasks such as working with IP addresses and bitwise operations.
IP Address Classes and Subnet Mask: Network vs Host Portions Explained
This video explains IPv4 address classes (A, B, C, D, E) and introduces the critical concept of the subnet mask. Learn how subnet masks differentiate the network and host portions of an IP address to determine whether devices are on the same or different networks.
Most viewed summaries
A Comprehensive Guide to Using Stable Diffusion Forge UI
Explore the Stable Diffusion Forge UI, customizable settings, models, and more to enhance your image generation experience.
Kolonyalismo at Imperyalismo: Ang Kasaysayan ng Pagsakop sa Pilipinas
Tuklasin ang kasaysayan ng kolonyalismo at imperyalismo sa Pilipinas sa pamamagitan ni Ferdinand Magellan.
Mastering Inpainting with Stable Diffusion: Fix Mistakes and Enhance Your Images
Learn to fix mistakes and enhance images with Stable Diffusion's inpainting features effectively.
Pamamaraan at Patakarang Kolonyal ng mga Espanyol sa Pilipinas
Tuklasin ang mga pamamaraan at patakaran ng mga Espanyol sa Pilipinas, at ang epekto nito sa mga Pilipino.
How to Install and Configure Forge: A New Stable Diffusion Web UI
Learn to install and configure the new Forge web UI for Stable Diffusion, with tips on models and settings.
Found this summary useful?
Take it with you. One click puts it in your own LunaNotes library.
Save to LunaNotes