Syscall 2: Firmware, home

SignalChapter 12: Shared buses

98ROUTE NUMBER

The task

a reads X and Y and shares a bus with b and c. Y is 0 or 1 and says where its X goes.

P, on b, must receive each X whose Y is 0, and Q, on c, each X whose Y is 1.

The board

The board of ROUTE NUMBER3 cores: a, b, and c. Inputs X and Y; outputs P and Q. 1 shared bus.aSC-2 15 LINESbSC-2 15 LINEScSC-2 4 LINESP0P1P2P0P1P0P1XYPQ
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

Y names the reader for each X: b steps off the bus so c can take an X meant for it.

Hints

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

Hint 1Show

b is farther left, so b takes every value it reads before c can.

Hint 2Show

a can send Y first, so b knows whether the X after it is for b or for c.

Hint 3Show

When the X is for c, b must stay off the bus until c has it.

Solution

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

aSC-2 standard

IN P1
OUT P2
IN P0
OUT P2

bSC-2 standard

S: IN P0
JZ K
NOP
JMP S
K: IN P0
OUT P1

cSC-2 standard

IN P0
OUT P1
CYCLES
237
at par
ENERGY
2088
at par
NODES
3
at par
INSTRUCTIONS
12
at par