Skip to main content
Logo image

Section 7.3 Simulating with EDA Playground

Once you have a VHDL model and a testbench, you need a simulator to execute them and to display the results. One simple simulator that we have used in this course is EDA Playground [5], a free online tool by Doulos, Inc. In the lab we use the Vivado simulator, supplied by Xilinx. Vivado integrates design capture and simulation with tools for synthesis and implementation. At this time, EDA Playground is fine to use with these readings and for in class exercises, but for all lab and project work you will use the Xilinx tools.
Watch this video to learn how to get started with EDA Playground.

Checkpoint 7.3.1. Simulation: Two-input multiplexer.

Checkpoint 7.3.2. Simulation: Two-input decoder.

Exercises Exercises

1. Simulation: Four-input multiplexer.

Write a testbench for, and simulate, the four-input multiplexer
 3 
www.edaplayground.com/x/2GeL
Answer.
Here is just the stimulus process. The four inputs d, c, b, a are packed into a vector x(3 downto 0). Single input ports are extracted from the vector. The testbench sets the select bits and asserts the data bit of interest. Then it toggles the inputs, to demonstrate that the unselected inputs do not pass.
a <= x(0);
b <= x(1);
c <= x(2);
d <= x(3);

stim_proc: process
begin
    s <= "00";
    x <= "0001";  wait for T;
    x <= not(x);  wait for T;

    s <= "01";
    x <= "0010";  wait for T;
    x <= not(x);  wait for T;

    s <= "10";
    x <= "0100";  wait for T;
    x <= not(x);  wait for T;

    s <= "11";
    x <= "1000";  wait for T;
    x <= not(x);  wait for T;

    wait;
end process stim_proc;