Syscall 2: Firmware, home

SignalChapter 10: Meshes

75CROSSING

The task

P must receive X times Y, and Q must receive X minus Y.

m and d are SC-2L, low power cores: 2 cycles an instruction, at half the energy.

The board

The board of CROSSING4 cores: ex, ey, m, and d. Inputs X and Y; outputs P and Q.exSC-2 15 LINESeySC-2 15 LINESmSC-2L 15 LINESdSC-2L 6 LINESP0P1P2P0P1P2P0P1P2P0P1P2XYPQ
The board as the puzzle screen lays it out. Cyan pins read, lemon pins write, violet pins go both ways. On a narrow screen, scroll the board sideways to see all of it.

Key idea

Both outputs need both values, so the wires cross, and the order of the sends decides between a stall and a deadlock.

Hints

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

Hint 1Show

Both outputs need both values, so the wires cross and each value is sent twice.

Hint 2Show

Each reader takes its values in order. If m waits on Y while ey waits on d, nothing moves.

Hint 3Show

d can read Y first: then SUB B leaves X minus Y in A.

Solution

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

exSC-2 standard

IN P0
OUT P1
OUT P2

eySC-2 standard

IN P0
OUT P2
OUT P1

mSC-2L low power

IN P0
MOV B, A
IN P1
MUL B
OUT P2

dSC-2L low power

IN P1
MOV B, A
IN P0
SUB B
OUT P2
CYCLES
431
at par
ENERGY
2574
at par
NODES
4
at par
INSTRUCTIONS
16
at par