Hello everyone. We’ve got another Boolean math session lined up for you today. This time we’re going to take a quick look at the NOT logic and examine how this one differs from the other operations.
To review, Boolean math is based on a binary system where only two values exist. We can either have a 1, or a 0. Everyone is already familiar with similar concepts where there are only two values. We see this in examples where something is either On or Off, Heads or Tails, True or False. For the purposes of Boolean math, 1 is typically equal to a True condition, whereas 0 is equal to a False condition.
Today’s focus will be on the NOT logic, which is symbolized by either a tilde ( ~ ) or an exclamation ( ! ). Either symbol can be used, so you’ll want to keep both of them in mind if they happen to show up on an exam question.
The NOT logic isn’t difficult in itself, but if you are new Boolean logic, then it can sometimes be a bit confusing. The simplest way to define the NOT logic is that it reverses the input of the value provided. Since there are only two values (think binary here), if it’s not one value, then it has to be the other. For example, if the value provided is a 1, then applying the NOT logic will change it to the opposite, which is a 0.
All of the other truth tables we’ve worked with (AND, OR, XOR), have a logic table that basically states, “under these X/Y combinations, make the result True (1) or False (0). Below are two truth tables representing the NOT logic for both X and Y. These are really just put here so that you can see them separately as X and Y. Note that these tables don’t compare two values, they simply reverse the one value that you’re given for either X or Y.
Similar to the other Boolean articles we’ve done, we are going to use the NOT operational logic to solve the following problem.
Example Boolean Problem ( X ):
X: 0 1 1 0 0 1 0 1
As we’ve said before, whenever you see a Boolean math problem, the first thing you always want to do is to verify what type of logic needs to be applied. In this example, we see that the tilde ( ~ ) is used, so we know to use the NOT logic. Also, it’s worth noting that since we’re only given one set of digits to work with, that could be another indicator that the NOT logic should be used in this situation.
Next, we’re going to look at each digit and apply the NOT logic. So, starting with our first column, we’ll see which value is present and ask the question, “what is the reverse, or opposite of the value they give us?”.
If you work through each value for X, applying the NOT logic, then the solution to the problem will look like this:
Example Boolean Problem ( Y ):
Y: 1 0 1 0 0 1 1 0
When looking at this next example, notice that instead of the tilde ( ~ ), we have an exclamation symbol ( ! ). Therefore, anytime we see either of those symbols in a Boolean math problem, then we know to use the NOT logic when solving for the X or Y variables.
So, we will work through this one the same as last time. Start with the first column and ask the question, “what is the reverse, or opposite of the value they give us?”. If it is a 1, then we invert it to be a 0. If they give us a 0, then we reverse it, and the result is 1.
Continue to work down each column in the problem and apply the NOT logic. When you’re done, you should end up with a solution that looks like this:
The key things to keep in mind when dealing with NOT logic are, either symbol can be used ( ~ or ! ), and remember to reverse the values provided to find the correct result.
This has been a quick look at the NOT operational logic. There is an audio/video version of this material here, for anyone who prefers that format. If you’re interested in security fundamentals, we have a Professionally Evil Fundamentals (PEF) channel that covers a variety of technology topics. We also answer general basic questions in our Knowledge Center. Finally, if you’re looking for a penetration test, training for your organization, or just have general security questions please Contact Us.