RTL Studio Open IDE

3.1 · VERILOG CLASS

if-else and case

Implement a 4-to-1 multiplexer using case statements and verify all select branches.

Watch on YouTube

What you practice

if-else and case (3.1). Implement a 4-to-1 multiplexer using case statements and verify all select branches. It is in Sequential Logic — Part 1 · Verilog Core Syntax of the Verilog Masterclass. Language mechanics first — confirm behavior on waveforms, not big designs yet.

RTL Studio is a browser Verilog IDE and simulator. This free lesson runs there: the editor, Slang lint, Verilator, a VCD waveform viewer, and Yosys, with nothing to install.

Run it in the Verilog IDE

  1. Open this lesson in the IDE. The workspace is the Verilog module and its testbench.
  2. Edit the RTL so it matches the lesson goal, then lint it with Slang.
  3. Run the in-browser Verilator simulation. Read the log, then open the VCD in the waveform viewer.
  4. When the block is structural RTL, run Yosys in the same tab and compare the mapped cells with the behavior you just simulated.

The lesson is done when the simulation matches if-else and case. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.