Route one of four two-bit words
Online version: https://fpga.labsland.com/altera/digital-logic/lab-01/part-03/
Digital Logic · Lab 1, Part III · DE1-SoC
Build a four-input selector from three two-input selectors. The lower select bit chooses a word within each pair. The upper select bit chooses which pair supplies the output. You can distinguish all four inputs with just two red LEDs.
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 and extract the Quartus project for your HDL. Open four_sources.qpf in Quartus Prime Lite with the Cyclone V device package. Edit the four_sources design. Complete the second stage of the selector. The first stage already chooses within the two source pairs. Only LEDR1 and LEDR0 may light.
Choose Processing → Start Compilation. Verify that the fitter completed for 5CSEMA5F31C6. In the DE1-SoC binary upload lab, choose Standard, upload output_files/four_sources.sof and wait for the programming confirmation. Locate the LED or HEX labels on the board camera before taking your readings.
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
four_sources.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 the route in the worksheet below, then complete the design as its build steps describe. Open
four_sources.qpfand choose Processing → Start Compilation. Quartus writesoutput_files/four_sources.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 the route
Set SW7…6 to 00, SW5…4 to 01, SW3…2 to 10 and SW1…0 to 11. Call the four words U, V, W and X in that order. Write down which pair and which word should reach LEDR1…0 for each of the four possible values of SW9…8.
Build
Create four_sources in the editor for your HDL, choose it as the top-level file and paste the starter. Its first stage already chooses within both pairs. Complete the second stage. Keep the eight unused LEDs off. Choose Standard, synthesize and upload to the DE1-SoC.
Read the board
| SW9…8 | Word predicted | Predicted LEDR1…0 | Camera reading |
|---|---|---|---|
| 00 | |||
| 01 | |||
| 10 | |||
| 11 |
Keep the select bits at 10 and change W from 10 to 01. Then change U. Which change reaches the LEDs? A circuit that merely displays the binary select value can pass all four rows above. Use this last observation to rule it out.
Hand in
Submit a sketch of the three selectors with their control bits labeled, your four readings and the extra test with W changed. Explain which stage is responsible if U and V work but W and X never appear.
Adapted from FPGAcademy Digital Logic 21.1, Lab 1, Part III. LabsLand wrote the remote exercise and HDL. Original Verilog handout · Original VHDL handout · MIT notice
