B49QUANTIZER
The task
P0 reads a triangle wave. Round each reading down to a quarter of the supply,
0, 25, 50, 75, or 100 percent, and put it out on P1, so CH2 climbs and falls in steps.
The board
- Sources
- V1 2.5 V triangle at 25 Hz and V2 2.5 V
- Resistors
- R1 1 kΩ
- Capacitors
- C1 1 µF
- Probes
- CH1 and CH2
Key idea
DIV 25 throws away the remainder.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
MUL 25 turns the number of quarters back into a percent.
Hint 2Show
A reading of 60 becomes 2 quarters, and a duty of 50.
Solution
Reveal the Full SolutionThe complete program for QUANTIZER. 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.
Round each reading down to a quarter.
u1SC-2 standard
IN P0
DIV 25
MUL 25
OUT P1- CYCLES
- 800
- at par
- ENERGY
- 1600
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 4
- at par