B78SEQUENCER
The task
P0 reads an enable switch on CH1. P1 powers the core rail on CH2, P2 the IO rail on CH3.
When enable rises, power the core, then the IO rail two ticks of P3 later.
When it falls, drop the IO rail first and the core one tick later.
The board
- Sources
- V1 5 V and V2 5 V square at 12.5 Hz
- Resistors
- R1 2.2 kΩ and R2 2.2 kΩ
- Capacitors
- C1 1 µF and C2 1 µF
- Probes
- CH1, CH2, and CH3
Key idea
Sample the switch on each tick, so every wait is a whole number of ticks.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A digital read of 1 can go straight out to switch a rail on, and a read of 0 to switch it off.
Hint 2Show
Up: core, sleep twice, IO. Down: IO, sleep once, core.
Solution
Reveal the Full SolutionThe complete program for SEQUENCER. 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.
Core before IO going up, IO before core going down.
u1SC-2 standard
W: IN P3
IN P0
JZ W
OUT P1
IN P3
IN P3
MOV A, 1
OUT P2
H: IN P3
IN P0
JNZ H
OUT P2
IN P3
MOV A, 0
OUT P1- CYCLES
- 253
- at par
- ENERGY
- 506
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 15
- at par