Rotate a word across four displays
Online version: https://fpga.labsland.com/altera/digital-logic/lab-01/part-05/
Digital Logic · Lab 1, Part V · DE1-SoC
Make a four-character message move one place to the left when the selection increases. A character leaving HEX3 must reappear on HEX0. Each display needs a selector for its character and a decoder for its seven segments.
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 word_rotator.qpf in Quartus Prime Lite with the Cyclone V device package. Edit the word_rotator design. Complete the character selection in each of the four lanes. At one left rotation HEX0 must receive the initial HEX3 character. Keep the red LEDs mirroring all ten switches.
Choose Processing → Start Compilation. Verify that the fitter completed for 5CSEMA5F31C6. In the DE1-SoC binary upload lab, choose Standard, upload output_files/word_rotator.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
word_rotator.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 Arrange the message in the worksheet below, then complete the design as its build steps describe. Open
word_rotator.qpfand choose Processing → Start Compilation. Quartus writesoutput_files/word_rotator.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
Arrange the message
Read the displays from HEX3 to HEX0. At rotation zero they receive SW7…6, SW5…4, SW3…2 and SW1…0 respectively. Use 00 for d, 01 for E, 10 for 1 and 11 for blank. Set SW7…0 to 00011011. Draw a box for every display, including the blank, and predict what you will see for each setting of SW9…8.
Build
Create word_rotator in the Online Editor for your HDL, choose it as the top-level file and paste the starter. Its four lanes decode the initial message. Complete the selection in each lane. At one left rotation HEX0 must receive the old HEX3 character. Keep the LEDR outputs mirroring all ten switches. Select Standard, synthesize and upload to the FPGA.
Read the board
| SW9…8 | Prediction, HEX3 to HEX0 | Camera reading, HEX3 to HEX0 |
|---|---|---|
| 00 | ||
| 01 | ||
| 10 | ||
| 11 |
Read the four rightmost displays. Write a dash for a blank. Return to rotation zero and change the message switches to 01101100. Confirm that the displayed word changes. This test distinguishes a selector that reads your switches from a circuit that rotates a fixed word.
Hand in
Submit your HDL, the four readings and the result with the second message. Explain which source pair HEX1 receives when SW9…8 is 10.
Adapted from FPGAcademy Digital Logic 21.1, Lab 1, Part V. LabsLand wrote the programs and remote procedure. Verilog handout · VHDL handout · MIT notice
