Teach lesson
Select which decision reaches the LED · VHDL
One status lamp has to serve two tests. Give the operator a switch to choose between the permission and warning circuits.
Sign in with an educator account to prepare a class session. Students join with a class code.
New to LabsLand? Create your teacher account
Learning Outcomes
Build a multiplexer and distinguish a reversed selector from a stuck one.
Student activity preview
Activity Content
Preview only. In a class session, students can fill in responses and submit their work to the teacher.
Predict
8 min
One status lamp has to serve two tests. Give the operator a switch to choose between the permission and warning circuits.
Both circuits compute all the time. A two-input multiplexer routes one result to LED0. SW1 and SW0 feed both gates. SW2 selects a result: 0 selects AND, 1 selects XOR. Holding the data steady isolates the effect of selection.
Hold SW1 SW0 at 11. What will LED0 do as SW2 goes from 0 to 1? Would data 00 reveal a reversed selector? Explain.
Build and test
25 min
Starting circuit
The starter wires the lamp permanently to AND. Connect a multiplexer so a single selector can choose either result.
A concurrent conditional assignment uses value_when_true when condition else other_value.
Start with this complete file. The marked line is the part to change.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity blink is
port (
sw : in std_logic_vector(15 downto 0);
led : out std_logic_vector(15 downto 0)
);
end entity;
architecture rtl of blink is
signal both_high, different : std_logic;
begin
both_high <= sw(1) and sw(0);
different <= sw(1) xor sw(0);
led(0) <= both_high; -- *
led(15 downto 1) <= (others => '0');
end architecture;Open the editable Boolean Board lab. Paste the starting circuit into the main file (blink.vhd) and keep blink as the top-level design.
Replace the fixed connection with your conditional selection. Preserve the two gate signals.
Check that the interface is Standard. Wait for the edit to save, choose Synthesize, wait for success, then choose Upload to FPGA. The board can open directly. If the board picker stays open, choose Upload now under Boolean Board. If it reports temporary unavailability, wait briefly and retry there. Your saved HDL stays in the editor. Find the numbered switches and the board camera.
Wait for the switch icon and camera to catch up after each change. Set the data first. For each data pair in the table, toggle only SW2 and read LED0 once in each position.
After your last reading, leave the board and return to this activity. Choose Attach saved code and check that a file appears. Select Mark practice as done and confirm. After filling in your bench notes and explanation, choose Submit work and confirm your submission.
Available in a class session
Follow the signal
Follow the selected wire twice with the same data, once for each value of SW2.
Bench notes
For each fixed pair SW1 SW0, write the two LED0 readings in selector order 0 then 1.
| Test | Observed output |
|---|---|
Tested source
Capture the project you synthesized using the activity's code snapshot control.
Defend your result
7 min
Describe how your 11 row would look with reversed selection and with the starter wiring. Which pattern did you actually observe?
Turn this preview into a live class session
Continue to LabsLand Teach to use this lesson with your students and review the access available to your account.
New to LabsLand? Create your teacher account