Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 11

Combinational vs. Sequential Logic

Recommended resources

Hello! Welcome to the third module of our course. We're now moving from the 'what' of digital circuits to the 'how' and 'when'. In the last module, we built several circuits, including multiplexers, decoders, and a 4-bit adder. All of these have one thing in common: their output is determined only by their inputs at that exact moment. They have no memory. These are called combinational circuits.

Today, we're going to introduce the other fundamental category of digital circuits: sequential logic. These circuits can remember past events, which allows them to perform much more complex tasks like counting or executing a sequence of operations. Your goal for this lesson is to explain the difference between combinational and sequential logic. This distinction is one of the most important concepts in all of digital design.

1. The Fundamental Difference: Memory

The core concept that separates sequential from combinational logic is memory. A combinational circuit is stateless, while a sequential circuit has a state.

  • Combinational Logic: The output is a direct function of the present inputs only. Think of it like a simple calculator: 2 + 3 will always equal 5, regardless of what you calculated before.
  • Sequential Logic: The output depends on the present inputs AND the circuit's past history, which is stored as its current state. Think of the channel-up button on your TV remote. Pressing it (the input) changes the channel, but the next channel you get depends entirely on the current channel (the state).

The following video provides a clear explanation of this defining difference, using examples that should be familiar to you.

Comparison between Combinational and Sequential Circuits

Watch the first few minutes of "Comparison between Combinational and Sequential Circuits" from Neso Academy.

Start with the core definitions of combinational and sequential circuits. Next, watch the section that uses an adder and a counter as examples. This directly contrasts the adder circuit we just built with a counter, which we'll build later. Finally, pay close attention to the explanation of the structural difference. This introduces two critical new concepts: a memory element and a feedback path.


2. The Structure of Memory: Feedback Loops

As you saw in the video, to "remember" something, a circuit needs two things that combinational circuits lack:

  1. Memory Elements: Specialized components (like flip-flops, which we'll cover soon) that can store a value (a 0 or a 1).
  2. A Feedback Path: The output of the memory element is "fed back" as an input to the combinational part of the circuit. This allows the circuit's previous state to influence its next output.

The diagram below perfectly illustrates this structural difference.

Combinational vs. Sequential Logic Block Diagrams
On the left, a combinational circuit's output is purely a function of its current inputs. On the right, a sequential circuit's output is a function of its current inputs and its stored state, which is updated and fed back into the logic.

In the sequential circuit diagram, the "State" holds the memory of past inputs. The "Combinational Logic Circuit" block then computes the next output based on both the new external inputs and this stored state.


3. A Practical Comparison

Understanding this difference is crucial when you start writing Verilog, as the way you describe a circuit in code directly determines whether the synthesis tools create combinational or sequential logic.

The following article gives a concise, practical breakdown of the differences, including a preview of the Verilog coding styles associated with each.

What is the difference between combinational logic and sequential logic?

Read the indicated sections from the Ampheo blog.

Start with section 1. Combinational logic. This will review the key ideas and give concrete examples. Then, read section 2. Sequential logic. Notice how it highlights the role of the clock and memory elements (flip-flops). Finally, study the summary in section 4. Summary in one table. This table is an excellent reference that consolidates all the key differences. As you read, take special note of the "Code style" points. You'll see assign and always @(*) for combinational logic, and always @(posedge clk) for sequential logic. We will be using these exact constructs extensively in the upcoming Verilog modules.


Conclusion

In this lesson, we established the fundamental dividing line in digital logic design. You can now differentiate between the two main types of circuits.

Here are the key takeaways:

  • Combinational Logic is stateless. Its output depends only on its current inputs. Examples include adders, decoders, and multiplexers.
  • Sequential Logic has state. Its output depends on both its current inputs and its stored state (a memory of past inputs). Examples include counters and state machines.
  • The ability to store a state is physically achieved through memory elements (like flip-flops) and a feedback loop.
  • Sequential logic requires a clock signal to control when the state is updated, ensuring orderly, synchronized operation.

We've now answered what sequential logic is. The next logical step is to understand its most basic component. In our next lesson, we will explore the "heartbeat" of sequential systems: the clock signal, and see how it controls the fundamental building block of digital memory, the D-type flip-flop.