Binary numbers can seem intimidating at first since they look so different from decimal numbers. But as far as the basics go, the math behind counting, adding or subtracting binary numbers is exactly the same as with decimal numbers. It's important to call out that there aren't different kinds of numbers. Numbers are universal. There are only different notations for how to reference them. Humans, most likely because most of us have 10 fingers and 10 toes decided on using a system with 10 individual numerals used to represent all numbers. The numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 can be combined in ways to represent any whole number in existence. Because there are 10 total numerals in use in a decimal system, another way of referring to this is as base 10. Because of the constraints of how logic gates work inside of a processor, it's way easier for computers to think of things only in terms of 0 and 1. This is also known as binary or base 2. You can represent all whole numbers in binary in the same way you can in decimal, it just looks a little different. When you count in decimal, you move through all the numerals upward until you run out, then you add a second column with a higher significance. Let's start counting at zero until we get to nine. Once we get to nine, we basically just start over. We add a one to a new column, then start over at zero in the original column. We repeat this process over and over in order to count all whole numbers. Counting in binary is exactly the same. It's just that you only have two numerals available. You start with zero, which is the same as zero in decimal, then you increment once. Now you have one, which is the same as one in decimal. Since we've already run out of numerals to use, it's time to add a new column. So now we have the number 1, 0, which is the same as two in decimal, 1, 1 is three, 1, 0, 0, is four, 1 0, 1 is five, 1, 1, 0 is six, 1, 1, 1 is seven, etc. It's the exact same thing we do with decimal, just with fewer numerals at our disposal. When working with various computing technologies, you'll often run into the concept of bits or 1s and 0s. There's a pretty simple trick to figure out how many decimal numbers can be represented by a certain number of bits. If you have an eight bit number, you can just perform the math, 2^8. This gives you 256, which lets you know that an eight bit number can represent 256 decimal numbers, or put another way, the numbers 0-255. A four bit number would be 2^4, or 16 total numbers. A 16-bit number would be 2^16 or 65,536 numbers. In order to tie this back to what you might already know, this trick doesn't only work for binary, it works for any number system, it's just the base changes. You might remember that we can also refer to binary as base 2 and decimal as base 10. All you need to do is swap out the base for what's being raised to the number of columns. For example let's take a base 10 number with two columns of digits. This would translate to 10^2. 10^2=100, which is exactly how many numbers you can represent with two columns of decimal digits, or the numbers 0-99. Similarly, 10^3 is 1,000, which is exactly how many numbers you can represent with three columns of decimal digits or the numbers 0-999. Not only is counting in different bases the same, so it's simple arithmetic like addition. In fact, binary addition is even simpler than any other base, since you only have four possible scenarios. 0+0=0, just like in decimal, 0+1=1 and 1+0=1, should also look familiar. 1+1= 10, looks a little different, but should still make sense. You carry a digit to the next column once you reach 10 in doing decimal addition, you carry a digit to the next column once you reach two when doing binary addition. Addition is what's known as an operator, and there are many operators that computers use to make calculations. Two of the most important operators are or and and. In computer logic, a 1 represents true and a 0 represents false. The way the or operator works is you look at each digit and if either of them is true, the result is true. The basic equation is X or Y equals Z, which can be read as if either X or Y is true, then Z is true, otherwise it's false. Therefore, 1 or 0=1, but 0 or 0=0. The operator and does what it sounds like it does, it returns true if both values are true. Therefore, 1 and 1=1, but 1 and 0=0 and 0 and 0=0, and so on. Now, you might be wondering why we've covered all of this. I know it's not to confuse you. It's all really to help explain subnet masks a bit more. A subnet mask is a way for a computer to use and operators to determine if an IP address exists on the same network. This means that the host ID portion is also known since it'll be anything left out. Let's use the binary representation of our favorite IP address, 9.100.100.100, and our favorite subnet mask 255.255.255.0. Once you put one on top of the other and perform a binary and operator on each column you'll notice that the result is the network ID and subnet ID portion of our IP address, or 9.100.100. The computer that just perform this operation can now compare the results with its own network ID to determine if the address is on the same network or a different one. I bet you never thought you'd have a favorite IP address or subnet, but that's what happens in the wonderful world of basic binary math.