Syscall 2: Firmware, home

BenchChapter 9: Special nodes

B70BURST

The task

P0 reads a trigger on CH1. On each rising edge, send four pulses on P1.

Each pulse is one tick of P2 high, then one tick low. P2 ticks every 20 cycles.

After the fourth pulse, wait for the next rising edge.

The board

The chip of BURSTChip u1 with 3 ports: P0 digital in, reaching V1, CH1; P1 digital out, reaching R1, D1, CH2; P2 timer 20 cycles.u1CHIP SC-2P0DIGITAL INV1, CH1P1DIGITAL OUTR1, D1, CH2P2TIMER 20 CYCLES
The chip's ports, each with its kind and the parts its signal reaches. Cyan reads, lemon writes. On a narrow screen, scroll the board sideways to see all of it.
Sources
V1 5 V and V2 5 V square at 25 Hz
Resistors
R1 330 Ω
LEDs
D1 red
Probes
CH1 and CH2

Key idea

After a burst the trigger is still high: wait for it to fall before you look for a rise.

Hints

Each hint goes a step further than the one before. Open them one at a time.

Hint 1Show

Four pulses take eight ticks: high, low, high, low, and so on. Sample P0 on ticks too.

Hint 2Show

Count down from 8 in B and write the count MOD 2 on each tick.

Solution

Reveal the Full SolutionThe complete program for BURST. 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.

Four pulses per rising edge.

u1SC-2 standard

W: IN P2
IN P0
JNZ W
H: IN P2
IN P0
JZ H
MOV A, 8
L: SUB 1
MOV B, A
MOD 2
OUT P1
IN P2
MOV A, B
JNZ L
CYCLES
292
at par
ENERGY
584
at par
NODES
1
at par
INSTRUCTIONS
14
at par