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
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 P2eySC-2 standard
IN P0
OUT P2
OUT P1mSC-2L low power
IN P0
MOV B, A
IN P1
MUL B
OUT P2dSC-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