Connect ten switches to ten lights
Online version: https://fpga.labsland.com/altera/digital-logic/lab-01/part-01/
Digital Logic · Lab 1, Part I · DE1-SoC
This is your first circuit. Each slide switch supplies one input bit. When you change it in the browser, you should be able to identify exactly one red LED that changes on the board camera.
Lab setup
LabsLand Online Editor · DE1-SoC
Physical DE1-SoCCyclone V · 5CSEMA5F31C6 · camera, switches and buttons in the browser
Build in Quartus and upload the bitstream
Download the Quartus project for your HDL and extract the ZIP. Open the .qpf file in Quartus Prime Lite with Cyclone V device support installed. In the starter, only SW0 is connected. Complete the assignment so LEDR[i] follows SW[i] for all ten bits. The supplied .qsf connects the browser switches to the correct GPIO pins on the remote DE1-SoC.
Choose Processing → Start Compilation. Check the compilation report for a successful fit on device 5CSEMA5F31C6. Open the DE1-SoC binary upload lab, choose the standard interface, select output_files/switch_bank.sof and upload it. Wait for the board to confirm programming, then use the switches and camera for the readings below.
If your course uses a LabsLand classroom, the upload opens a firmware library instead. Choose Browse files, wait until the SOF is selected, then choose Enter board with selected firmware.
- Get the starterDownload
switch_bank.v - Open the LabsLand Online EditorOpen the lab Choose DE1-SoC · Verilog when you open the lab. LabsLand asks you to sign in. Use the access your course or institution provides.
- Follow the worksheetPredict first, then build, read the board and hand in. The build steps are below.
- Install Quartus Prime Lite with Cyclone V supportSkip this if it is already installed.
- Download the activityDownload worksheet and Quartus project Includes the worksheet and the Quartus project.
- Complete the design and compileStart with Predict in the worksheet below, then complete the design as its build steps describe. Open
switch_bank.qpfand choose Processing → Start Compilation. Quartus writesoutput_files/switch_bank.sof. - Upload the bitstream to LabsLandUpload bitstream LabsLand asks you to sign in. Use the access your course or institution provides.
Already compiled? Upload your .sof directly
Starter files · Verilog · VHDL · SystemVerilog
Worksheet and starter (.zip) for offline work or printing
Predict
Sketch ten LED positions numbered 9 through 0. Predict the pattern for SW0 alone and for SW9 alone. What would change if the two ends of the bus were accidentally reversed?
Build
The screenshots show the Verilog editor. VHDL and SystemVerilog look the same apart from the file extension.
- If the editor tour is open, finish it or select Skip. If User interface shows a simulation, choose Change → Basic → Standard.
-
Select New. Name the file
switch_bank, choose the extension for your HDL (.v,.svor.vhd) and select Create.
-
Copy the starter into the file and choose
switch_bankunder Top level entity. Only SW0 is connected so far. - Complete the assignment so that LEDR[i] follows SW[i] for all ten bits.
-
Choose Synthesize. When a green message reports that the program was verified and compiled, choose Upload to FPGA.

-
Wait until the board page has finished programming the design. Select a switch to flip it and watch the red LEDs on the camera.

Read the board
Start with all switches off. Turn on just SW0 and identify LEDR0 on the camera. Turn it off and repeat with SW9. Now set the alternating patterns below. Record the ten LEDs from LEDR9 to LEDR0 before you move another switch.
| Switches 9…0 | Prediction | Camera reading |
|---|---|---|
| 0000000001 | ||
| 1000000000 | ||
| 0101010101 | ||
| 1010101010 |
When every switch is on, count the lit LEDs. Return the switches to zero before leaving the board.
Hand in
Submit the assignment statement, the four readings and one sentence describing how you established the order of the LEDs. Which test would still pass if two neighboring wires were swapped?
Adapted from FPGAcademy Digital Logic 21.1, Lab 1, Part I. LabsLand wrote the remote procedure, programs and tests. Original Verilog handout · Original VHDL handout · MIT notice
