B56ENVELOPE
The task
P0 is a gate, a slow square wave from V1. P2 ticks every 10 cycles.
While the gate is high, raise the duty on P1 by 25 percent a tick until it reaches 100.
While the gate is low, lower it by 10 percent a tick until it reaches 0.
The board
- Sources
- V1 5 V square at 25 Hz
- Resistors
- R1 1 kΩ
- Capacitors
- C1 1 µF
- Probes
- CH1 and CH2
Key idea
B holds the duty between ticks.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Check the gate first, then whether the duty is already at its end.
Hint 2Show
At 100 or at 0 there is nothing to change, so go back and wait for the next tick.
Solution
Reveal the Full SolutionThe complete program for ENVELOPE. 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.
A fast attack while the gate is high, a slow release after.
u1SC-2 standard
L: IN P2
IN P0
JZ DN
MOV A, B
SUB 100
JZ L
ADD 125
JMP S
DN: MOV A, B
JZ L
SUB 10
S: MOV B, A
OUT P1- CYCLES
- 793
- at par
- ENERGY
- 1586
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 13
- at par