Career upgrade: Learn practical AI skills for better jobs and higher pay.
Level up

5.1 Number Systems & Boolean Algebra

Key Takeaways

  • Convert hex to binary by expanding each digit into 4 bits; convert binary to hex by grouping bits in fours from the right.
  • In an n-bit two's complement system the range is -2^(n-1) to +2^(n-1)-1, so 8 bits cover -128 to +127.
  • Negate a two's complement number by inverting every bit and adding 1; the same hardware then handles subtraction as addition.
  • De Morgan's theorems state NOT(A AND B) = NOT A OR NOT B, and NOT(A OR B) = NOT A AND NOT B.
  • Karnaugh maps minimize logic by grouping adjacent 1-cells in powers of two using Gray-code ordering so only one variable changes per step.
Last updated: May 2026

Why number systems come first

The FE Electrical and Computer exam draws roughly 7 to 11 questions from Digital Systems, and most of them assume fluent base conversion. Computers store everything in binary (base 2), engineers read addresses in hexadecimal (base 16, digits 0-9 then A-F), and people think in decimal (base 10). You must move between all three quickly because the NCEES FE Reference Handbook gives the rules but not the practice.

The fast bridge is that one hex digit equals exactly four binary bits, because 2^4 = 16. To convert hex to binary, expand each hex digit into its 4-bit pattern. To convert binary to hex, group the bits in fours starting from the right and read each group as a single hex digit. Decimal conversion uses positional weights: each binary position is worth a power of two, so 1011 binary equals 8 + 0 + 2 + 1 = 11 decimal.

Hex / binary / decimal reference

Memorize the first sixteen values so conversions become reflexive on exam day.

DecimalBinary (4-bit)Hex
000000
501015
910019
101010A
121100C
151111F

Example: the byte 1100 1010 splits into 1100 (C) and 1010 (A), so it is 0xCA, which is 202 in decimal. Reverse the process by expanding each hex digit back into four bits.

Two's complement and signed arithmetic

Two's complement is the standard way computers store signed integers because it lets one adder handle both addition and subtraction and gives a single representation of zero. In an n-bit system the value range is -2^(n-1) to +2^(n-1)-1. For 8 bits that is -128 to +127.

The most significant bit is the sign bit: 0 means non-negative, 1 means negative. To negate a number, invert every bit and add 1. For example, +5 in 8 bits is 0000 0101; inverting gives 1111 1010, and adding 1 gives 1111 1011, which is -5.

Watch for overflow: when two numbers with the same sign add to a result with the opposite sign, the answer wrapped around and is invalid. Adding two positives that yield a negative bit pattern is the classic exam trap.

Test Your Knowledge

What is the 8-bit two's complement representation of -6?

A
B
C
D

Boolean algebra and De Morgan's theorems

Digital logic rests on Boolean algebra, where variables take only 0 or 1. The key identities the FE expects you to apply directly are:

  • Identity: A + 0 = A, and A AND 1 = A
  • Null: A + 1 = 1, and A AND 0 = 0
  • Idempotent: A + A = A, and A AND A = A
  • Complement: A + NOT A = 1, and A AND NOT A = 0
  • Distributive: A AND (B + C) = (A AND B) + (A AND C)

The most heavily tested rules are De Morgan's theorems: NOT(A AND B) = (NOT A) OR (NOT B), and NOT(A OR B) = (NOT A) AND (NOT B). In words, a complemented group flips the operation and complements each term. These let you convert NAND-only or NOR-only circuits into AND/OR form and back, which is why NAND and NOR are called universal gates.

Karnaugh maps for minimization

A Karnaugh map (K-map) is a grid that minimizes a Boolean expression by visual grouping instead of algebra. Rows and columns are labeled in Gray code, where adjacent cells differ in exactly one bit, so physically adjacent 1-cells can combine.

Rules for a correct minimization:

  1. Plot a 1 in every cell where the function is true.
  2. Circle the largest possible groups of 1s, where each group size is a power of two (1, 2, 4, 8).
  3. Groups may wrap around edges and may overlap, but each must be rectangular.
  4. A variable that changes within a group drops out of that group's product term.
  5. Cover every 1 with the fewest, largest groups; mark don't-care cells as 1 only when they enlarge a group.

A group of two cells eliminates one variable, a group of four eliminates two, and a group of eight eliminates three. The final expression is the OR of the surviving product terms.

Test Your Knowledge

Using De Morgan's theorem, the expression NOT(A OR B) is equivalent to which of the following?

A
B
C
D