B41DELAY LINE
The task
On each tick of P2, sample P0, and light the LED on P1 the way P0 read on the tick before.
The LED repeats the input one tick late.
The board
- Sources
- V1 5 V square at 40 Hz
- Resistors
- R1 330 Ω
- LEDs
- D1 yellow
- Probes
- CH1 and CH2
Key idea
XCH swaps A and B.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Keep the newest sample in B, and write out the one it replaces.
Hint 2Show
Sleep, read P0, swap, and write.
Solution
Reveal the Full SolutionThe complete program for DELAY LINE. Open it only when you want the answer.
The reference program
The game's own solution. It passes every test and scores exactly par on every benchmark.
The LED shows the input one tick late.
u1SC-2 standard
IN P2
IN P0
XCH
OUT P1- CYCLES
- 157
- at par
- ENERGY
- 314
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 4
- at par