Points: 150
Sherlock Holmes and the Broken Cipher Engine
London, 1895.
A secret transmission intended for the British government was intercepted by Professor Moriarty. Before he could fully decode the message, officers from Scotland Yard raided his hideout.
Moriarty escaped.
In his haste, he destroyed part of a mysterious machine called the Sequential Reconstruction Apparatus (SRA)-a device believed to generate the pulse sequences required to decode encrypted messages.
The machine was recovered, but a critical section of its control logic is missing.
Holmes believes that if the missing logic can be reconstructed, the machine will resume generating the correct pulse sequence, revealing:
- What message Moriarty was attempting to decode.
- Whether accomplices were involved.
- The location of Moriarty’s next operation.
Only fragments remain:
- A simulation testbench recovered from the workshop.
- An incomplete Verilog design.
- A reference waveform found in Moriarty’s notebook.
Holmes has asked you to complete the missing logic and restore the machine.
Objective
Complete the missing portion of the Verilog code so that the generated waveform matches the expected output exactly.
You are provided:
- The testbench
- The incomplete Verilog module
- The expected waveform image
Run the design on EDA Playground and enable EPWave to inspect the generated waveform.
The goal is to make the waveform produced by your design match the reference waveform.
Instructions
Step 1 - Open the provided code on EDA Playground.
Step 2 - Paste the testbench and the incomplete module.
Step 3 - Enable: Open EPWave after run
Step 4 - Run the simulation.
Step 5 - Analyze the waveform and determine the missing logic responsible for generating the pulse sequence.
Step 6 - Modify only the missing logic section until the waveform matches the expected output.
Files Provided
| File | Link |
|---|---|
| Testbench.v | Download |
| SRA.v | Download |
| Expected Waveform Image | View |
Sherlock’s Notes
Holmes recovered the following observations from Moriarty’s laboratory:
- The internal counter advances from 0 to 22.
- Different counter values generate different pulse patterns.
- The pulse sequence appears to form symbols used by the decryption engine.
- After counter value 22, the sequence repeats.
- The expected waveform contains all the clues needed to reconstruct the missing logic.
Resources for Holmes’ Apprentices
- Verilog Tutorial Playlist - Learn the fundamentals of Verilog
- HDLBits - Step One - Practice interactive Verilog problems
- ChipVerify Verilog Tutorials - Detailed Verilog explanations and examples
Final Message from Sherlock Holmes
“Restore the machine so that the simulation waveform matches the reference waveform.”