B95LONG DELAY
The task
P0 reads a digital signal on CH1. Sample it on each tick of P2.
Copy it to the LED on P1 exactly 6 ticks late.
For the first 6 ticks the LED stays dark.
The board
- Sources
- V1 2 V square at 25 Hz and V2 1.2 V square at 62.5 Hz
- Resistors
- R1 330 Ω
- LEDs
- D1 blue
- Probes
- CH1 and CH2
Key idea
Two registers cannot hold six samples, unless each sample is one bit of a number.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Double B and add the new sample: older samples move up one bit, and 6 bits stay under 64.
Hint 2Show
Before MOD 64 trims B, the bit pushed out, the value DIV 64, is the sample from 6 ticks ago.
Solution
Reveal the Full SolutionThe complete program for LONG DELAY. 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 six bit shift register in B.
u1SC-2 standard
IN P2
IN P0
ADD B
ADD B
MOV B, A
DIV 64
OUT P1
MOV A, B
MOD 64
MOV B, A- CYCLES
- 791
- at par
- ENERGY
- 1582
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 10
- at par