B40STEPPER
The task
V1 sends a clock to P0. On each rising edge, raise the duty on P1 by 25 percent.
After 100 percent, the next edge brings it back to 0.
The board
- Sources
- V1 5 V square at 125 Hz
- Resistors
- R1 1 kΩ
- Capacitors
- C1 1 µF
- Probes
- CH1 and CH2
Key idea
Wait for P0 to fall, then for it to rise. That is one edge.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
B keeps the duty from edge to edge.
Hint 2Show
ADD 25 and MOD 125 count 0, 25, 50, 75, 100, and around again.
Solution
Reveal the Full SolutionThe complete program for STEPPER. 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.
Each rising edge of the clock climbs a quarter.
u1SC-2 standard
L: IN P0
JNZ L
H: IN P0
JZ H
MOV A, B
ADD 25
MOD 125
MOV B, A
OUT P1- CYCLES
- 800
- at par
- ENERGY
- 1600
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 9
- at par