Skip to content

D. Notation and conventions

Textbooks disagree about notation, and a reader who moves between sources meets the same idea written four ways. This page lists every convention the book uses, shows it with the same figure component the chapters use, and says in the last column what you may also see elsewhere. The book's notation follows the lectures it accompanies, with a few choices of its own where the lectures vary or say nothing, each marked below as the book's choice. Where a lecture handout is inconsistent with itself, the book uses the form the lectures use.

The last column, You may also see, is background for reading other sources. Nothing on the site checks it, so treat it as a list of common alternatives and not as a survey. The figures in the other columns are drawn by the same components as the chapters' figures. The code forms are typed, and no program checks them against the figures.

Each entry gives the book's form, the form in SystemVerilog code, and what you may also see.

  • NOT. Book: A‾\overline{A}, a bar over the signal. Code: ~A. You may also see a prime (apostrophe) after the letter, a negation sign in front of it, or !A in programming-language style.
  • AND. Book: ABAB, letters side by side. Code: A & B. Letters side by side is the book's choice for single letters; the lectures also write a dot between single letters. You may also see the symbol ∧.
  • OR. Book: A+BA + B, a plus sign. Code: A | B. You may also see the symbol ∨.
  • XOR. Book: A⊕BA \oplus B, a circled plus. Code: A ^ B. You may also see the symbol ⊻ in logic texts.
  • XNOR. Book: A⊕B‾\overline{A \oplus B}, a bar over an XOR. Code: ~(A ^ B). A bar over an XOR is the book's choice; the lectures name XNOR in words and in code, ~(a ^ b), but give it no symbol of their own. You may also see a dot inside a circle, or the symbol for equivalence.
  • NAND and NOR. Book: AB‾\overline{AB} and A+B‾\overline{A + B}, a bar over the whole product or sum. Code: ~(A & B) and ~(A | B). You may also see, in logic texts, an up arrow between the letters for NAND (the Sheffer stroke) and a down arrow for NOR (the Peirce arrow).

Four details of the book's style matter when you compare pages.

A bar covers exactly what is under it. AB‾\overline{AB} has one bar over the whole product, and A‾ B‾\overline{A}\,\overline{B} has a bar over each letter. They are different functions, and Example 1.2.1 shows both tables. The bars on this site are drawn from the parsed expression, so a bar always reaches as far as the parentheses in the source say.

AND is a dot when the names are longer than one letter. Letters written side by side would read as one name, so names such as the state bit and the input of a machine are separated by a dot: PS0⋅In\mathrm{PS}_{0} \cdot \mathrm{In}. For single letters the book writes ABAB.

Multi-letter names stay whole. A signal called DBI or PBI is one signal, not a product of three. State bits are written PS1\mathrm{PS}_{1} and PS0\mathrm{PS}_{0} in math and ps[1] and ps[0] in code.

NOT never appears as a prime or as ~ in math. In code the operator is ~, and the book switches to the bar whenever it writes an expression as math. The expression language that the figures read is the code form, with the precedence given in Figure C.1, so what a figure shows is what the same text means in a testbench.

Vocabulary used throughout: CL is combinational logic and SL is sequential logic. A sum of products (SoP) is an OR of AND terms, and a product of sums (PoS) is an AND of OR terms. Lecture 2 points out that a sum of products is the disjunctive normal form (DNF) and a product of sums is the conjunctive normal form (CNF) of CSE 311. (fact ch02/cse311-forms) The on set of a function is the set of inputs where it is 1 and the off set is where it is 0. PS and NS are the present and next state of a machine, and DUT is the device under test, the module a testbench exercises (Section 3.1).

Inputs go on the left of a vertical rule and outputs on the right. Rows are in ascending binary order, with the first-listed input as the most significant bit, so for inputs A, B and C the rows run 000, 001, 010 and so on up to 111. A table with nn inputs has 2n2^n rows.

Truth table with 2 inputs (A, B) and outputs Carry, Sum; 4 rows in ascending binary order, A most significant
ABCarry\mathrm{Carry}Sum\mathrm{Sum}
0000
0101
1001
1110

Description: A truth table with inputs A and B on the left and the adder outputs on the right, four rows from 00 to 11.

Figure D.1. The one-bit adder table. Rows are in ascending binary order with A as the most significant bit.

A don't care output is written X, in the output columns only. A table with don't cares looks like this one.

Truth table with 3 inputs (A, B, C) and output F; 8 rows in ascending binary order, A most significant; X means don't care
ABCF
000X
0010
010X
0111
1000
1010
1101
111X

Description: A truth table with inputs A, B and C and output F, eight rows, with some outputs marked X.

Figure D.2. A table with don't cares. An X marks an output the design may set either way.
This book You may also see
Rows in ascending binary order, first input on the left is the most significant bit the same order; some books also number the rows with minterm indices beside the inputs
Don't care written X a dash, or the letter d
Inputs left of the rule, outputs right the same, sometimes without a drawn rule

The layouts below are the book's. Every map on the site is generated from a function, so the cells and the labels cannot disagree.

Four variables use columns for A and B and rows for C and D, with both axes in Gray order 00, 01, 11, 10, so that neighboring cells differ in one variable, including across the edges of the map.

Karnaugh map of F: columns AB, rows CD1001011001111001ABCD0001111000011110ABCD
Karnaugh map of F: columns AB, rows CD; cell values are 0, 1 or X for don't care
AB=00AB=01AB=11AB=10
CD=001001
CD=010110
CD=110111
CD=101001

Description: A four by four K-map with columns labeled 00, 01, 11, 10 for A and B, and rows labeled 00, 01, 11, 10 for C and D.

Figure D.3. The four-variable layout: columns AB, rows CD, both in Gray order.

Three variables have a default layout, columns AB and row C, and an alternate layout, columns BC and row A. The book uses the default unless a page says otherwise.

Karnaugh map of F: columns AB, rows C00100111ABC0001111001ABC
Karnaugh map of F: columns AB, rows C; cell values are 0, 1 or X for don't care
AB=00AB=01AB=11AB=10
C=00010
C=10111
Karnaugh map of F: columns BC, rows A00100111BCA0001111001BCA
Karnaugh map of F: columns BC, rows A; cell values are 0, 1 or X for don't care
BC=00BC=01BC=11BC=10
A=00010
A=10111

Description: Two K-maps of the same three-variable function. The first has two rows and four columns, with columns for A and B. The second has two rows and four columns, with columns for B and C and rows for A.

Figure D.4. The same function in the default layout (columns AB, row C) and the alternate layout (columns BC, row A).

Two variables have columns for B and rows for A.

Karnaugh map of F: columns B, rows A1101BA0101
Karnaugh map of F: columns B, rows A; cell values are 0, 1 or X for don't care
B=0B=1
A=011
A=101

Description: A two by two K-map with columns for B and rows for A.

Figure D.5. The two-variable layout: columns B, rows A.

Labels. A map can carry bit labels, brackets, or both. A bracket marks where a variable is 1. With bit labels only, the value is read from the label; with brackets only, it is read from which side of the bracket a row or column lies on.

Karnaugh map of F: columns AB, rows CD1001011001111001ABCDABCD
Karnaugh map of F: columns AB, rows CD; cell values are 0, 1 or X for don't care
AB=00AB=01AB=11AB=10
CD=001001
CD=010110
CD=110111
CD=101001

Description: A four by four K-map with brackets along the sides marking where each of A, B, C and D is 1, and no numeric labels on the rows and columns.

Figure D.6. The four-variable map with brackets only, no bit labels.

Groups. A group is a rounded outline around a rectangle of 1s, possibly including don't cares, whose width and height are powers of two. Groups may wrap around an edge, the four corners can form one group, groups may overlap, and each group is as large as it can be. The map is read group by group: each outline gives one product term, made of the variables that stay the same inside it. The description under every map on the site is generated from the groups, and a sentence in a chapter that says where a group is uses the same generator. For example, the cells of the four-variable map above where B and D are both 1 form a 2-by-2 square in rows CD=01 and 11, columns AB=01 and 11. Chapter 3 teaches grouping.

When a machine's next-state logic is mapped, the state bits go on the columns and an input on the rows, for example columns PS1 and PS0 and the row In.

This book You may also see
Four variables: columns AB, rows CD rows AB and columns CD, which is the same map turned on its side
Three variables: columns AB, row C (default) columns BC, row A, which is the alternate layout above and the default of some books
Bit labels, brackets marking where a variable is 1, or both bit labels only, or the cell's minterm number written in a corner

The gate symbols are the distinctive-shape ones: a curved back and a pointed front for OR, a flat back for AND, a triangle for NOT. A small circle, a bubble, means NOT and sits on an output or on an input. The seven gates are NOT, AND, OR, NAND, NOR, XOR and XNOR.

Schematic ch01/gate-nandABOut

A logic schematic with inputs A and B and output Out.

NAND gate g1: inputs A and B; output Out.

It agrees with the function logic:ch01/gate-nand#Out.

Schematic ch01/gate-xnorABOut

A logic schematic with inputs A and B and output Out.

XNOR gate g1: inputs A and B; output Out.

It agrees with the function logic:ch01/gate-xnor#Out.

Description: A NAND gate and an XNOR gate, each with two inputs A and B and one output.

Figure D.7. NAND and XNOR: AND and XOR with a bubble on the output.

A bubble on an input inverts the signal as it enters the gate.

Schematic ch02/xor-sop-circuitABC

A logic schematic with inputs A and B and output C.

AND gate g1: inputs inverted A and B; output n1.

AND gate g2: inputs A and inverted B; output n2.

OR gate g3: inputs n1 and n2; output C.

It computes C = not A and B or A and not B.

Description: A circuit of two AND gates feeding an OR gate, with a bubble on one input of each AND gate.

Figure D.8. Exclusive-or as a sum of products, drawn with bubbles on gate inputs.

Other symbols in the book's drawings: a multiplexer is a trapezoid with the data-input numbers written inside and the select on the slanted side, a bus is a line with a slash and its width, and no slash means one bit. A flip-flop or register is a box with d and q and a small triangle at the clock input. A box with a label inside, such as a comparator or an adder or a block named for what it does, is an operator or a part drawn without its inside.

Illustration a block diagram that explains an idea; its behavior is not checked

Schematic ch02/variable-majority-blockmajABCMmajABCM0000011011ABCcountM2

A block diagram with inputs A, B, C and count (2 bits) and output M.

Constant 0 drives n1.

Block "maj" maj2: A is A, B is B, C is n1, M is n2.

Block "maj" maj3: A is A, B is B, C is C, M is n3.

Constant 0 drives n4.

4-to-1 multiplexer sel: selects among n4 as input 0, A as input 1, n2 as input 2 and n3 as input 3 using count; output M.

This diagram is illustrative: its behavior is not checked.

Description: A block diagram with inputs A, B, C and a two-bit input count. Two boxes labeled maj feed data inputs 10 and 11 of a trapezoid multiplexer; input 00 is 0 and input 01 is A; the select is the two-bit count.

Figure D.9. A block diagram with a four-input multiplexer, a two-bit bus and two boxes drawn without their insides.

Illustration a block diagram that explains an idea; its behavior is not checked

Schematic ch01/sl-sketchdqlogic networkabcdxclkzregister

A block diagram with inputs x and clk and output z.

Block "logic network" net: a is x, b is n2, c is z, d is n1.

Flip-flop state: d is n1, q is n2, clocked by clk.

This diagram is illustrative: its behavior is not checked.

Description: A block diagram with a box labeled logic network and a register whose output feeds back into the box, with a clock input.

Figure D.10. A register in a feedback path, drawn as a box with a clock triangle.

A drawing with a box in it is marked as an illustration on the site, because the inside of a box is not checked.

This book You may also see
Distinctive-shape symbols with bubbles rectangular symbols from the IEEE and IEC standard, with & and ≥1 written in the box
A bubble on an input or an output means NOT an inverter drawn as a separate triangle gate on the wire
A bus is a slashed line with its width a thick line, with the width written beside it
A multiplexer is a trapezoid with the data numbers inside a rectangle labeled MUX

The book teaches Mealy machines first. A state is a circle with its name inside, an arrow is a transition, and the label on an arrow is the input over the output written with a slash: 1/0 means the input is 1 and the output is 0 while that arrow is taken. The start is marked by a thick arrow that comes from no state.

State diagram of long-pressState diagram of long-press: a Mealy machine with 3 states (S0, S1, S2). The initial state is S0, marked by an arrow that comes from no state. From S0 when In=0, output 0, go to S0. From S0 when In=1, output 0, go to S1. From S1 when In=0, output 0, go to S0. From S1 when In=1, output 0, go to S2. From S2 when In=0, output 0, go to S0. From S2 when In=1, output 1, go to S0. Inputs, in label order: In. Outputs: Out.0/01/00/01/00/01/1S0S1S2start

Description: A state diagram with three circles S0, S1 and S2, a thick arrow into S0 from the left, and arrows labeled with an input, a slash and an output.

Figure D.11. A Mealy machine. Each label is input over output, and the thick arrow at the left marks the initial state.

With several inputs, the label is either a bit string in a declared input order or a product of literals, and the book says which order it uses. A Moore machine, whose output depends on the state only, writes the output inside the state circle instead. It appears in the book as a variation on the Mealy form.

This book You may also see
Mealy first; arrow labels written input/output Moore first, with outputs written inside the circles; the other order is also common
State names in the circles (S0, S1) binary codes in the circles instead of names
Present state PS and next state NS current state and next state, or Q and Q-plus

A waveform lists the clock first, then the inputs, then internal signals, then the outputs. A bus is drawn as a box with its value written inside, in a radix the figure states. Fully unknown values are hatched and partly unknown buses are written bit by bit. A rising clock edge is marked when a figure is about sequential behavior. A state signal that is an enumeration shows the state names.

Waveform ch05/long-press-trace: clk, reset, In, dut.ps, OutclkresetIndut.psS0S1S2S0S1S2S0Out050100150200250300350400450500550600650time (ps)Waveform ch05/long-press-trace: clk, reset, In, dut.ps, OutclkresetIndut.psS0S1S2S0S1S2S0Out050100150200250300350400450500550600650time (ps)Waveform ch05/long-press-trace: clk, reset, In, dut.ps, OutclkresetIndut.psS0S1S2S0S1S2S0Out0100200300400500600time (ps)Waveform ch05/long-press-trace: clk, reset, In, dut.ps, OutclkresetIndut.psS0S1S2S0S1S2S0Out0100200300400500600time (ps)Waveform ch05/long-press-trace: clk, reset, In, dut.ps, OutclkresetIndut.psS0S1S2S0S1S2S0Out0100200300400500600time (ps)

Time in ps; one column is 50 ps.

Timing diagram from simulation, ch05/long-press-trace: time in ps from 0 to 700, 14 columns of 50 ps.

clk: clock, period 100 ps, starts 0, 7 rising edges in the window (50, 150, 250, ...).

reset: 1 at 0, then 0 at 50.

In: 0 at 0, then 1 at 50, 0 at 650.

dut.ps (state names: S0, S1, S2): unknown at 0, then S0 at 50, S1 at 150, S2 at 250, S0 at 350, S1 at 450, S2 at 550, S0 at 650.

Out: 0 at 0, then 1 at 250, 0 at 350, 1 at 550, 0 at 650.

Dashed vertical guides mark the rising clock edges.

Description: A timing diagram of clk, reset, In, the state dut.ps and Out over several clock cycles.

Figure D.12. The clock first, then the inputs reset and In, then the state, then the output.

How CSE 369 writes this

The time axis of a simulated waveform counts the simulator's time units, and the book's figures label it ps. Those numbers are arbitrary: they say nothing about how fast a real circuit is. The book says this once per chapter and does not repeat it, and this is that statement for this appendix.

Chapter 3 shows gate delay in waveforms. Section 4.7 writes the clock-to-Q delay of a flip-flop as tC2Qt_\text{C2Q} (the slides also write tclk-to-qt_\text{clk-to-q}) and names tsetupt_\text{setup} and tholdt_\text{hold}, which Chapter 6 is meant to put numbers on. That chapter is not written yet, so for the numbers use the course's own slides. In other books you may also see tpcqt_{pcq}, tsut_{su} and tht_h; the course does not use them.

Item Convention
Modules lowercase words joined by underscores, and the file has the module's name
Testbench the module's name followed by _tb, with no ports
Instance of the module under test dut
Clock clk
Reset reset, synchronous and active high
Present and next state ps and ns, both declared as the same enumeration
Enumeration constants the state names of the diagram, such as S0
Declaration initializers none in design files

The book's tools check several of these rules, among them the module and file name, the testbench name and its dut instance, one clock per design, and no initializers in design files. The remaining rows are habits of the book's own code.

The seven-segment decoder of Section 3.9 has an output bus leds in which bit ii drives segment Lii: L0 is the top segment, L1 the upper right, L2 the lower right, L3 the bottom, L4 the lower left, L5 the upper left and L6 the middle (see Figure 3.9.5). The decoder in that section is active high.

This book You may also see
Segments named L0 to L6 starting at the top letters a to g, with a at the top and the rest going clockwise, and g in the middle
snake_case module names camel case or capitals, as in the lectures' own code (DashboardController, MUX2); equally legal
Synchronous reset in book code an asynchronous reset named rst_n or rstn, active low

A table of every precedence rule the book uses for code is in Appendix C, which also lists the four standard patterns for modules and testbenches.