Lab 1

Route one of four two-bit words

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

Physical DE1-SoCCyclone V · 5CSEMA5F31C6 · camera, switches and buttons in the browser

  1. Get the starterDownload four_sources.v
  2. Open the LabsLand Online EditorOpen the lab LabsLand asks you to sign in. Use the access your course or institution provides.
  3. Follow the worksheetPredict first, then build, read the board and hand in. The build steps are below.

Starter files · Verilog · VHDL · SystemVerilog

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