Skip to content

Verilog · Chapter 13 · Data-Flow Modeling

Data-Flow Modeling in Verilog — Chapter 13 Overview

Verilog operators give you the full vocabulary of combinational computation, but an expression on its own builds nothing; it has to be placed into a design to become hardware. Dataflow modeling is the first and simplest way to do that: describe a circuit by the flow of data through expressions, using the continuous assignment. A continuous assignment wires an expression to a net so the net continuously reflects whatever the expression evaluates to, a piece of combinational hardware that is always on and computes in parallel with every other assignment. This is the natural home for operators, where muxes, adders, comparators, masks, and bit-manipulation all become one-line assignments. This chapter overview frames what dataflow modeling is, how it sits among the three Verilog modeling styles, and the concurrent, combinational nature of continuous assignments, then sets up the sub-pages that drill it.

Foundation16 min readVerilogDataflowContinuous AssignmentassignCombinational LogicRTL Design

Chapter 13 · Data-Flow Modeling (Overview)

1. The Engineering Problem

You finished Chapter 10 able to write any combinational expression — a + b, sel ? x : y, (addr >= BASE) && (addr < LIMIT), {cout, sum}. But an expression by itself is inert: it is a description of a computation, not yet a circuit in your design. The question that opens the RTL core's second chapter is:

How does an operator expression become actual, always-on hardware inside a module — a circuit that continuously computes, in parallel with everything else?

The answer is the continuous assignment, assign. Writing `assign y = a + b;` does not "run" the addition once — it wires an adder permanently between a, b, and y, so that y always equals a + b: change a or b, and y updates immediately. This is dataflow modeling — describing hardware by how data flows through expressions — and it is where every operator from Chapter 10 finally becomes a circuit.

Dataflow is the simplest of the three ways to describe hardware, and the right one for all combinational logic: muxes, decoders, adders, encoders, masks, and the glue that connects a design together. This chapter is its introduction; the overview here frames the model, and the sub-pages drill the mechanics.

2. What Is Dataflow Modeling?

Dataflow modeling describes a circuit by the movement and transformation of data — what each output is, as an expression of the inputs — rather than by listing gates (gate-level) or by writing procedural steps (behavioural). The vehicle is the continuous assignment:

dataflow-glance.v
Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
   assign sum     = a + b;                  // an adder
   assign y       = sel ? in1 : in0;        // a multiplexer
   assign in_range = (v >= LO) && (v <= HI); // a range comparator
   assign masked  = data & MASK;            // a mask

Each assign states what a net equals as an expression of other signals. The synthesizer reads that expression and builds the combinational hardware that computes it — an adder, a mux, a comparator. You describe the function; the tool builds the gates. This is a higher level of abstraction than drawing gates, and exactly the level at which combinational logic is naturally expressed.

3. Mental Model — A Continuous Assignment Is Always-On Combinational Hardware

Visual A — operators become dataflow hardware

From expression to always-on hardware

data flow
From expression to always-on hardwareoperator expression (Ch 10)operatorexpression (Ch…a + b, sel ? x : y, …continuousassignmentassign net = expressiondriven netcontinuously equals the expressioncombinationalhardwarealways-on, concurrent
A continuous assignment takes an operator expression and wires it to a net, which then continuously reflects the expression's value. The result is always-on combinational hardware. Dataflow modeling is the step that turns the operators of Chapter 10 into a circuit.

4. The Three Modeling Styles

Verilog offers three abstraction levels for describing hardware. Dataflow is the middle one, and the right one for combinational logic:

StyleHow you describe the circuitChapterBest for
Gate-level (structural)Instantiate and wire individual gates / primitivesCh 11Low-level / library cells (reference)
DataflowContinuous assignments of expressions (assign)Ch 13Combinational logic — muxes, adders, decoders
BehaviouralProcedural blocks (always, if, case)Ch 14Sequential logic + complex combinational
  • Gate-level is the lowest level — you name each gate and connect them, as in a netlist. It is verbose and rarely written by hand for new RTL (covered as reference in Chapter 11).
  • Dataflow raises the abstraction to expressions: you write `assign y = a + b;` and the tool builds the adder. This is the sweet spot for combinational logic — concise, readable, and exactly matched to the operators of Chapter 10.
  • Behavioural (Chapter 14) raises it further to procedural descriptions in always blocks, which can express clocked, sequential logic (state, registers, FSMs) that dataflow cannot.

A real design mixes styles, but dataflow is where combinational logic lives, and it is the natural next step after learning the operators.

Visual B — the three modeling styles

Verilog modeling styles, low to high abstraction

data flow
Verilog modeling styles, low to high abstractionGate-level (Ch11)wire individual gatesDataflow (Ch 13)assign expressionsBehavioural (Ch14)procedural always blocks
Three abstraction levels. Gate-level wires individual primitives (low, verbose); dataflow assigns expressions (the combinational sweet spot); behavioural uses procedural blocks (highest, and the only one that models sequential logic). Dataflow modeling — this chapter — is where the Chapter 10 operators become combinational circuits.

5. The Hardware View — Concurrent, Always-On Logic

A dataflow design is a collection of continuous assignments running in parallel, each a small combinational circuit. This concurrency is the defining hardware fact and the biggest shift from software thinking:

concurrency.v
Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
   assign p = a & b;        // these three assignments are ALL active
   assign q = p | c;        // simultaneously — p, q, r are all live at once
   assign r = q ^ d;        // reordering them changes NOTHING

These three look like sequential steps, but they are three pieces of hardware running at the same time. p continuously equals a & b; q continuously equals p | c (tracking p's changes); r continuously equals q ^ d. Writing them in any order builds the identical circuit, because they are concurrent connections, not ordered statements. When an input changes, the change ripples through the connected assignments combinationally — exactly as signals propagate through a real gate network. Understanding that assign statements are concurrent hardware, not sequential code, is the core mental shift of dataflow modeling.

6. Continuous Assignment Basics — A Preview

The mechanics — drilled in 13.1 — in brief:

assign-basics.v
Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
   wire y;
   assign y = a & b;                 // explicit continuous assignment
 
   wire z = c | d;                   // implicit form: assign at declaration
 
   // the LHS is a NET (wire); the RHS is any expression of signals/constants

Three points the sub-page expands:

  • The LHS must be a net (wire), driven continuously by the assignment — not a reg (those are procedural, Chapter 14).
  • The RHS is any expression — the full operator vocabulary of Chapter 10.
  • One driver per net, normally — a net continuously driven by two assignments has two drivers and resolves by contention (the net-resolution rules of Chapter 5); normal combinational logic uses one assign per net.

7. Dataflow vs Procedural — A Preview of Chapter 14

The contrast that orients the rest of the RTL core:

  • Dataflow (assign, this chapter)continuous and concurrent; describes combinational logic by expression; the LHS is a net that always reflects the RHS.
  • Procedural (always, Chapter 14)executed (in simulation) when triggered; describes combinational or sequential logic with statements (if, case); the LHS is typically a reg.

They are complementary: dataflow for the combinational glue and datapath expressions, procedural for clocked state and complex control. The conditional operator ?: you learned in 10.11 is the dataflow mux; its procedural twin is the if/case of an always block. This chapter does combinational dataflow; the next adds procedural and sequential logic.

8. What This Chapter Covers

Chapter 13 drills dataflow modeling across three sub-pages:

§Sub-pageCovers
13.1Continuous Assignmentsthe assign mechanics — net-driving, implicit/explicit forms, delays, concurrency, one-driver discipline
13.2Practical Examplesreal combinational circuits in dataflow — muxes, decoders, adders, encoders, comparators
13.3Advanced Techniqueslarger dataflow patterns — parameterized expressions, complex selection, and the limits of dataflow

Visual C — the Chapter 13 roadmap

Chapter 13 sub-pages

data flow
Chapter 13 sub-pages13.1 ContinuousAssignmentsthe assign mechanics13.2 PracticalExamplesmuxes, decoders, adders13.3 AdvancedTechniquesparameterized, complex selection
Learn the continuous-assignment mechanics (13.1), apply them to real combinational circuits (13.2), then scale to larger dataflow patterns (13.3). Throughout, the operators of Chapter 10 are the expressions on the right of every assign.

9. Industry Perspective

  • Dataflow is the default for combinational logic. Muxes, decoders, encoders, adders, comparators, bit-field manipulation, and the glue logic that wires a design together are written as continuous assignments — concise and directly readable as the function they compute.
  • assign expresses intent cleanly. A one-line `assign out = sel ? a : b;` says "this is a mux" far more clearly than gate instantiations, which is why dataflow dominates hand-written combinational RTL.
  • Concurrency matches hardware. Because continuous assignments are inherently parallel, dataflow models the true concurrency of a circuit naturally — there is no artificial ordering to reason about, just connected expressions.
  • Dataflow + procedural is the standard mix. Real modules combine dataflow (combinational glue, datapath expressions) with procedural always blocks (clocked state) — the two styles cover the whole of RTL.

10. Common Misconceptions

"An assign runs once, like a program statement." False. A continuous assignment is a permanent connection — the net continuously reflects the expression, updating whenever any operand changes. It is always active, not executed once.

"The order of assign statements matters." False. Continuous assignments are concurrent — all active simultaneously, independent of textual order. Reordering them builds the identical circuit. (This is the opposite of procedural statements in an always block.)

"Dataflow can model sequential logic." Misleading. Dataflow naturally models combinational logic — output as a function of current inputs, no clock, no memory. Clocked, stateful (sequential) logic needs procedural always blocks (Chapter 14). Forcing state into dataflow (with feedback) produces fragile, hard-to-synthesize logic and is not how sequential design is done.

"assign can drive a reg." False. A continuous assignment drives a net (wire). reg variables are driven by procedural assignments inside always/initial blocks. Mixing them up is a common beginner error (and a compile error).

11. Summary

Dataflow modeling describes combinational hardware by the flow of data through expressions, using the continuous assignment (assign). It is where the operators of Chapter 10 become always-on circuits.

The core ideas:

  • A continuous assignment wires an expression to a net that continuously reflects it — `assign y = a + b;` makes y always equal a + b. It is a permanent connection, not a one-time statement.
  • Continuous assignments are concurrent — all active in parallel, order-independent; they model the true concurrency of hardware.
  • Dataflow models combinational logic — output as a function of current inputs, no clock or memory; sequential logic needs procedural always (Chapter 14).
  • The LHS is a net (wire), not a reg — nets are driven continuously; regs are driven procedurally.
  • Dataflow is the middle modeling style — above gate-level (Ch 11), below behavioural (Ch 14), and the natural fit for the operators of Chapter 10.

The mindset this chapter instils: an assign is a piece of combinational hardware that is always computing, in parallel with every other one — read a dataflow module as a network of connected, always-on expressions.

The first sub-page drills the mechanics: Chapter 13.1 Continuous Assignments covers the assign statement in detail — net-driving, explicit and implicit forms, the one-driver discipline, and the concurrency that makes dataflow hardware. From there the chapter builds real combinational circuits, and then the RTL core advances to Chapter 14 Behavioural Modeling — procedural always blocks, blocking versus non-blocking assignment, and the sequential, clocked logic that turns combinational expressions into stateful RTL.