Syscall 2: Firmware, home

SignalChapter 2: Workshop

5MIXER

The task

Add each value from X to the matching value from Y and send the sum to P.

Both streams meet at the core on the right.

The board

The board of MIXER3 cores: c0, c1, and c2. Inputs X and Y; outputs P.c0SC-2 15 LINESc1SC-2 15 LINESc2SC-2 15 LINESP0P1P0P1P0P1P2XYP
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

Merging two streams: MOV B, A one, IN the other, ADD B.

Hints

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

Hint 1Show

Every core also has a register B. MOV B, A copies A into B, and XCH swaps A and B.

Hint 2Show

IN always reads into A, so move the first value out of the way before the second read.

Hint 3Show

ADD B adds B to A. The two left cores only pass values along.

Solution

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

C2 keeps X in B, reads Y, and adds.

c0SC-2 standard

IN P0
OUT P1

c1SC-2 standard

IN P0
OUT P1

c2SC-2 standard

IN P0
MOV B, A
IN P1
ADD B
OUT P2
CYCLES
237
at par
ENERGY
2106
at par
NODES
3
at par
INSTRUCTIONS
9
at par