15.4 Digital Logic, Numbering Systems, and Controller Programming

Key Takeaways

  • Relay logic, ladder logic, truth tables, Boolean algebra, and logic gates are five notations for the same information, and the task list requires converting between them.
  • A series contact pair is a logical AND; a parallel contact pair is a logical OR; a normally-closed contact used as an input is a NOT.
  • Binary, octal, decimal, and hexadecimal are the four numbering systems named on the Competency and Task List; one hexadecimal digit represents exactly four binary bits.
  • BAS data points are numeric (analog), Boolean (binary), enumerated (multi-state), or string, and choosing the wrong type makes a value unusable in logic.
  • Analog communication transmits a continuously variable signal such as 0-10 VDC or 4-20 mA, while digital communication transmits discrete encoded values and is immune to signal-level drift.
Last updated: August 2026

15.4 Digital Logic, Numbering Systems, and Controller Programming

The Building Automation sheet contains a competency block titled Digital Logic and Programming. It requires:

  • Comparing the following expressions of logic — relay logic, truth tables, ladder logic, Boolean algebra, logic gates
  • Defining decimal, binary, octal, and hexadecimal numbering systems
  • Contrasting analog and digital communications
  • Defining microprocessor control systems
  • Identifying data point types: numeric, Boolean, enumerated, string
  • Converting between the different expressions of logic (e.g., relay logic to truth tables)
  • Developing flow charts for simple programs
  • Connecting a laptop/workstation to a field controller and using it to configure the controller
  • Programming controllers using line programming, icon-based programming, or block programming

This is the block that connects the ladder diagrams of Chapter 3 to the DDC controller of Chapter 15. The relay logic a technician already reads on a furnace schematic and the Boolean expression inside a controller are the same statement written two ways.


1. Five Notations, One Statement

Consider a supply fan that must run when the schedule is occupied AND the smoke detector is normal. Here is that single requirement in all five notations the task list names.

Relay logic (physical contacts in series):

L1 ---[ Schedule Relay ]---[ Smoke Det. NC ]---( Fan Starter )--- L2

Ladder logic (the same, drawn as a controller rung):

     Occupied      Smoke_Normal            Fan_Cmd
  ----] [------------] [--------------------(  )----

Logic gate:

   Occupied     -----|\
                     | )AND >---- Fan_Cmd
   Smoke_Normal -----|/

Boolean algebra: Fan_Cmd=OccupiedSmoke_Normal\text{Fan\_Cmd} = \text{Occupied} \cdot \text{Smoke\_Normal}

Truth table:

OccupiedSmoke_NormalFan_Cmd
000
010
100
111

All five say the same thing. The exam asks you to move between them, so learn the three translation rules:

Circuit arrangementLogic functionBoolean operator
Contacts in seriesAND$A \cdot B$
Contacts in parallelOR$A + B$
A normally-closed contact used as an inputNOT (inversion)$\overline{A}$

2. The Gates and Their Truth Tables

GateSymbol notationOutput is 1 when…Boolean
AND$\cdot$all inputs are 1$A \cdot B$
OR$+$any input is 1$A + B$
NOT (inverter)overbarthe input is 0$\overline{A}$
NANDnot all inputs are 1$\overline{A \cdot B}$
NORno input is 1$\overline{A + B}$
XOR (exclusive OR)$\oplus$inputs differ$A \oplus B$

Two-input truth table for the common gates:

ABANDORNANDNORXOR
0000110
0101101
1001101
1111000

Where XOR shows up in HVAC: an XOR of "heating valve open" and "cooling valve open" is a simultaneous heating and cooling alarm — the output is 1 whenever exactly one is open, so a 0 with both open flags the fault. It is also the core of a changeover-mode check.

A Boolean identity worth memorizing (De Morgan's theorem): AB=A+BandA+B=AB\overline{A \cdot B} = \overline{A} + \overline{B} \qquad\text{and}\qquad \overline{A + B} = \overline{A} \cdot \overline{B}

In plain language: "not (both)" is the same as "either one is not." This is why a safety chain can be drawn either as a series string of normally-closed safeties feeding an enable, or as a parallel string of alarm flags feeding a shutdown — and why the two drawings are equivalent.


3. Numbering Systems

The task list names four: decimal, binary, octal, hexadecimal. Each is defined by its base — the number of distinct digits it uses.

SystemBaseDigitsWhere it appears in BAS
Decimal100–9Setpoints, engineering units, device instance numbers
Binary20, 1The controller's native form; binary points; DIP-switch addressing
Octal80–7Legacy addressing and some file permissions; rare in modern BAS
Hexadecimal160–9, A–FMAC addresses, IP notation in some tools, memory addresses, protocol frames

Place values. Each column is the base raised to its position, counting from zero on the right.

Binary $1011_2$: 1(23)+0(22)+1(21)+1(20)=8+0+2+1=11101(2^3) + 0(2^2) + 1(2^1) + 1(2^0) = 8 + 0 + 2 + 1 = 11_{10}

Hexadecimal $2F_{16}$: 2(161)+15(160)=32+15=47102(16^1) + 15(16^0) = 32 + 15 = 47_{10}

The conversion shortcut that matters most. One hexadecimal digit represents exactly four binary bits, because $16 = 2^4$. So converting between binary and hex requires no arithmetic — just group the bits in fours from the right:

101111102    1011B  1110E    BE161011\,1110_2 \;\rightarrow\; \underbrace{1011}_{B} \; \underbrace{1110}_{E} \;\rightarrow\; BE_{16}

The same trick works for octal in groups of three bits, because $8 = 2^3$.

DecimalBinaryOctalHex
0000000
5010155
81000108
10101012A
15111117F
16100002010
25511111111377FF

Why a service technician cares: an 8-bit value tops out at $2^8 - 1 = 255$, which is why so many limits in networking are 255 and why a DIP-switch address block of eight switches addresses 0 through 255. When a tool reports a device address as 1A and the drawing says 26, they are the same device — $1A_{16} = 26_{10}$.


4. Analog Versus Digital Communication

AnalogDigital
SignalContinuously variableDiscrete encoded states
HVAC examples0–10 VDC, 4–20 mA, 0–135 Ω, 3–15 psi pneumaticBACnet MS/TP, Modbus RTU, Ethernet
Conductors per valueOne pair per pointOne pair carries hundreds of points
Effect of noise / voltage dropDirectly corrupts the valueRejected until the error is large enough to break the frame
Diagnostics availableThe value onlyValue plus status, reliability flag, units, alarm state
Failure modeSilent drift — a wrong number that looks rightLoud — the point goes offline or unreliable

The 4–20 mA advantage is worth understanding: because it is a current loop, series resistance in the wire does not change the current, so long runs do not shift the reading the way a 0–10 VDC signal does. And because the live zero is 4 mA, a broken wire reads 0 mA — a value outside the valid range, which the controller can flag as a fault. A 0–10 VDC signal with a broken wire reads 0 V, which is indistinguishable from a legitimate 0% command. This is the classic exam contrast.

A microprocessor control system is any system in which a programmed processor reads inputs, executes stored logic on a repeating scan cycle, and writes outputs. The distinction from electromechanical control is that the behavior lives in software, so changing the sequence changes no wiring — and equally, a logic error changes nothing visible in the panel.


5. Data Point Types

The task list requires identifying numeric, Boolean, enumerated, and string data points. Choosing the wrong type is a common commissioning error because the point will display correctly and still be unusable in logic.

TypeHoldsBACnet objectExample
Numeric (analog)A continuous value with engineering unitsAnalog Input / Output / Value72.4 °F; 1.25 in. w.c.; 43%
Boolean (binary/digital)Exactly two statesBinary Input / Output / ValueFan status On/Off; alarm True/False
Enumerated (multi-state)One of a defined list of named statesMulti-state Input / Output / ValueMode = {Off, Heat, Cool, Auto}; Occupancy = {Occupied, Unoccupied, Standby}
StringTextCharacter String ValueEquipment tag; alarm message; a technician's note

Why the distinction bites. An operating mode with four states written as a numeric point stores 0, 1, 2, 3 with no labels — the graphic shows "2" and nobody remembers what 2 means. Written as an enumerated point it shows "Cool," and logic can test for the named state. Conversely, a value stored as a string cannot be compared numerically or trended: "72.4" as text will not drive a control loop, even though it looks identical on screen.


6. Flow Charts and Programming Methods

Flow charts are a named competency, used to document a sequence before writing it. The standard shapes: an oval terminator for start/stop, a rectangle for a process or action, a diamond for a decision with labeled Yes/No branches, and a parallelogram for input/output.

Loading diagram...
Flow Chart: Supply Fan Start Sequence

Drawing this before programming exposes the questions that matter — what happens if status never proves, what the dampers do in unoccupied mode — while they are still cheap to answer.

Three programming methods, all named on the task list:

MethodWhat it looks likeStrengths
Line programmingText statements, one per line, in a manufacturer's control languageCompact, powerful, easy to diff and archive; steepest learning curve
Block (function block) programmingGraphical blocks — PID, AND, timer, comparator — wired togetherData flow is visible; the standard for Niagara-style tools
Icon-based programmingPre-built application icons dragged onto a canvas and parameterizedFastest; least flexible; closest to a configurable controller

Connecting to the controller. Field controllers expose a service port — USB, a serial jack, or an IP connection. The workflow does not change with the programming method: connect, upload and archive the running program, edit offline, download, then verify with live point values and a functional test. Never edit live on a running controller in an occupied building unless the change is trivial and reversible.

Documentation is part of programming. Comment the logic, keep the archived program with the address schema and the points list (Section 15.7), and label the controller with the file name of its program. A brilliant sequence nobody can find the source for is a controller that gets replaced instead of repaired.

Test Your Knowledge

A safety string consists of a high-limit switch and a low-limit switch, both normally closed, wired in series ahead of a burner relay. Which single statement expresses this arrangement?

A
B
C
D
Test Your Knowledge

A commissioning tool reports a field device's address as hexadecimal 2C, while the submittal drawing lists that device at address 44. What is the situation?

A
B
C
D
Test Your Knowledge

A rooftop unit's operating mode is stored as a numeric analog point holding 0, 1, 2, or 3. The graphic shows '2' and no one can tell what mode that is. What point type should have been used?

A
B
C
D