Working with Boolean Algebra and Number Systems – 1

This lesson reviews mathematical concepts of Boolean algebra and numbering systems to help you understand key functions of electric vehicles. First, we will analyze simple Boolean operators to understand how transistor and gate-based switching occurs in vehicles. Next, we will examine the similarities between the on/off operation of switches to the on/off system of binary numbering. Last, we will practice working with the binary and hexadecimal number systems used by the electric communication system in vehicles, called controller area network (CAN).

  • The equations for two basic Boolean operators (AND and OR) can be thought of a single-pole switches in series or parallel.

Boolean Algebra and Switching Electrical Circuits

Many electronic systems are switched, not with mechanical switches, but with transistors arranged in series or parallel. A small voltage and current across two of the three leads control a large voltage or current across the output side of the transistor.

Schematic representation of an NPN transistor used as a switch. High current flows Emitter to Collector. Small current flows from Emitter to Base as the result of forward bias voltage.Figure 1. Schematic representation of a Negative-Positive-Negative (NPN) transistor used as a switch. CC BY 4.0 by National STEM Consortium.For the NPN transistor shown in Figure 1, a small forward bias voltage of about 0.7 volts, with the base (B) at a higher voltage than the emitter (E), controls a larger current from the emitter to the collector (C). If the emitter-base junction is not forward-biased, the emitter-collector circuit will not conduct electricity and is switched off. A transistor thus is used as an electronic switch or relay to avoid the arcing of DC current in a mechanical switch supplying current from a battery to a load. Such arcing could occur if a mechanical switch were used to control directly the current in the collector-emitter circuit.

Another useful solid-state device is a gate, in which two outputs are compared using Boolean algebra. As you know, algebra works with variables. In elementary algebra, the values of variables are numbers; in Boolean algebra, the values of the variables are the truth values: TRUE and FALSE. TRUE is denoted as 1, and FALSE is denoted as 0. In elementary algebra, the operations we perform are addition, subtraction, multiplication, division, and so on. In Boolean algebra, the operations are AND, OR, and NOT.

In a gate, the state of two variables, A and B, is compared depending on the Boolean operator.

Let’s look at the first Boolean operator, AND. A AND B is denoted as AB. AB can be TRUE only if both A andB are true. Remember that TRUE is denoted as 1. Look at Table 1. Only the last row returns an AB value of TRUE or 1, because only the last row has TRUE (1) for A and TRUE (1) for B.

Table 1. Truth table for AND operator for two variables
0 0 0
0 1 0
1 0 0
1 1 1

Now let’s look at the second Boolean operator, OR. A OR B is denoted as A+B. A+B can be TRUE if either A or B are true. Remember that TRUE is denoted as 1, and look at Table 2. The last three rows return of value of TRUE or 1, because in each case, A or B has a value of TRUE (1).

Table 2. Truth Table for OR Operator for Two Variables
A B A OR B (A+B)
0 0 0
0 1 1
1 0 1
1 1 1

Last, let’s look at the third Boolean operator, NOT. Here we are concerned with NOT A. NOT A can be true only if A does not have a value of TRUE or 1. Look at Table 3. The first row returns of value of TRUE or 1 because A itself does not have a value of TRUE or 1.

Table 3. Complement or Inverse Operator for One Variable
0 1
1 0

We can apply the rules of Boolean operators from Tables 1 through 3 to logic gates.

Figure 2. The analogy between Boolean logic gates and electrical switches. CC BY 4.0 by National STEM Consortium.Look at the top circuit in Figure 2. If either switch is open, the circuit is broken. In other words, the circuit requires that both switch A and switch B are closed, which is the same as the Boolean operator A AND B or AB.

Now look at the bottom circuit in Figure 2, which is configured differently. This circuit requires only that either switch A or switch B are closed, which is the same as the Boolean operator A OR B or A+B.

The usefulness of this concept is shown in the following example. Consider a circuit that warns a driver if the headlights are on and the driver’s door is opened. This circuit could use two inputs to an AND gate:

  • Input A – Lights Are On: Returns a value of 0 (FALSE) if the lights are off or a value of 1 (TRUE) if the lights are on.
  • Input B – Driver’s Door Is Open: Returns a value of 0 (FALSE) if the driver’s door is closed or a value of 1 (TRUE) if the door is open.

To output a 1 from an AND gate, both systems must output a 1. Let’s visualize this in a truth table:

Table 4. Truth Table for Example Vehicle AND Gate
Input A: Lights Are On Input B: Driver’s Door Is Open A AND B (AB)
0 0 0
0 1 0
1 0 0
1 1 1

If either input is 0, a 0 will be output. The output of the AND gate can control the on/off state of a transistor with a light or alarm on the output side of the transistor. Thus, if the driver exits the vehicle with the lights on, he or she would be warned that a dead battery could result if the lights are not turned off. Figure 3 depicts the same AND gate as a logic diagram.

Figure 3. AND gate with two inputs. CC BY 4.0 by National STEM Consortium.Read this webpage to learn more about logic diagrams, Boolean algebra, and truth tables:

Combining Gates with More than Two Inputs

It is easy to combine gates with more that two inputs by doing a bit-by-bit comparison. In each of the examples below, 0 denotes FALSE or OFF while 1 denotes TRUE or ON.

Example 1

010101010101 AND




Why? Because none of the comparisons (of the top and bottom numbers) contains 1 AND 1. Therefore, every value is 0.

Example 2

010101010101 OR




Why? Because every comparison of the top and bottom numbers contains a 0 OR a 1. Therefore, every value is a 1.

Example 3

NOT 000000000000



Why? Because every value must be NOT 0. Therefore, every value is a 1.

Read the following webpage to learn more about Boolean algebra:

SEE ALL Add a note
Add your Comment

Course Enquiry Form

Sign Up

Course Reviews

Why Choose DIY Course?

   Course work & interactions are 100% online.

   Study at the time and place that suits you.

   24/7 access to course material.

   Learn from world-class experts in their field.

Guidebook-for-Mechanical Engineers | DIYguru

Check your Certificate Code

Copyright © DIYguru Education & Research Pvt. Ltd.