B86VCO
The task
P0 reads a knob on CH1. On each tick of P2, add the reading DIV 10 to a phase kept in B.
The phase wraps at 100. Light the LED on P1 while the phase is 50 or more.
A higher knob adds more each tick, so the LED blinks faster.
The board
- Sources
- V1 3.5 V, V2 2 V square at 8.333 Hz, and V3 1 V square at 4.167 Hz
- Resistors
- R1 330 Ω
- LEDs
- D1 green
- Probes
- CH1 and CH2
Key idea
MOD 100 keeps the phase between 0 and 99.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
The phase DIV 50 is 1 in the top half and 0 in the bottom half.
Hint 2Show
IN P2, IN P0, DIV 10, ADD B, MOD 100, MOV B, A, DIV 50, OUT P1.
Solution
Reveal the Full SolutionThe complete program for VCO. 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 phase accumulator.
u1SC-2 standard
IN P2
IN P0
DIV 10
ADD B
MOD 100
MOV B, A
DIV 50
OUT P1- CYCLES
- 953
- at par
- ENERGY
- 1906
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 8
- at par