Syscall 2: Firmware, home

BenchChapter 4: Stars and hubs

B19CHOKE

The task

L1 is an inductor. The current through it cannot jump: it grows and dies away slowly.

CH1 reads that current as a voltage across R1. P1 ticks every 20 cycles.

Blink P0: high for one tick, low for the next.

The board

The chip of CHOKEChip u1 with 2 ports: P0 digital out, reaching L1, R1, CH1; P1 timer 20 cycles.u1CHIP SC-2P0DIGITAL OUTL1, R1, CH1P1TIMER 20 CYCLES
The chip's ports, each with its kind and the parts its signal reaches. Cyan reads, lemon writes.
Resistors
R1 220 Ω
Inductors
L1 1 H
Probes
CH1

Key idea

An inductor smooths current the way a capacitor smooths voltage.

Hints

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

Hint 1Show

CH1 starts low and creeps up over the first ticks before it settles into a zigzag.

Hint 2Show

Sleep, write 1, sleep, write 0.

Solution

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

Blink through an inductor.

u1SC-2 standard

IN P1
MOV A, 1
OUT P0
IN P1
MOV A, 0
OUT P0
CYCLES
46
at par
ENERGY
92
at par
NODES
1
at par
INSTRUCTIONS
6
at par