# 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. https://goo.gl/yVH6el

## 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. 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
A B A AND B (AB)
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
A NOT A
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:https://drstienecker.com/tech-332/3-logic-circuits-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
##### Example 1

010101010101 AND

101010101010

equals

000000000000

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

EXAMPLE
##### Example 2

010101010101 OR

101010101010

equals

111111111111

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

EXAMPLE
##### Example 3

NOT 000000000000

equals

111111111111

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

SEE ALL
•  YOU

#### Course Reviews

• BAJA / ATV Virtuals Preparation

#### Outstanding! 5

I spent at least 2 hours daily working on the course and this course week took me a month to complete. The problem sets are designed in such a way that one is forced to read and do further research to accomplish them.
##### Prateek Jain
• BAJA / ATV Virtuals Preparation

#### Well Arranged Course 5

Helped a lot :-) • Fundamentals of Automobile Engineering

#### Enlightening 5

It was a very interesting and enlightening course. The instructor was excellent.
##### Arvind Devaraj
• Fundamentals of Automobile Engineering

#### Great Learning 4

This course will make you learn everything you need to know about automobile, nothing more and nothing less. Highly recommended.
##### UDAY KANTH
• Electric Vehicle Certification Course (Fundamental) + Project-based 1-month Internship

#### Great Learning 5

This course will make you learn everything you need to know about Electric mobility, nothing more and nothing less. Highly recommended.

#### 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.