What the chip computes: the ASIC puzzle's Star Battle checker

The figures from the writeup, one per screen, in order.

8 visuals arrow keys or j and k move between them

1 2 3 4 5 6 7 8

1 / 8 in the writeup

Click or tap a cell to place a star. Check prints what the chip prints for the grid as drawn. The counts in the margins and the red cells are helpers; the chip itself only prints the message. Near miss loads a grid that breaks only the touching rule. Solution loads the key.

2 / 8 in the writeup: Counting the key

The 121-bit key as an 11 by 11 grid

3 / 8 in the writeup: Where the regions live

What comes in 121 cells, one bit each, one per clock What the chip can remember 9 position: row and column 22 column tallies, 11 × 2 bits 22 region tallies, 11 × 2 bits 13 last 12 input bits + touch flag 3 row tally + row-error latch 8 total star count 15 output generator 92 flip-flops. 121 does not fit.

The whole state of the chip is the 92 squares on the right. The grouping is what the rest of this section works out.

4 / 8 in the writeup: Watching it run

The key going in one bit per frame. Every number beside the grid is read from the flip-flops after that clock edge, nothing is computed by the animation.

5 / 8 in the writeup: The touch check in 12 bits

Reading the grid one cell per clock 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 the star arriving now its earlier neighbours: 1, 10, 11, 12 back still in the 12-bit window later neighbours: checked when their star arrives numbers: how many bits back each cell sits in the stream. shifting one row up is 11 back, so up-left, up, up-right are 12, 11, 10. What the chip keeps the last 12 bits, newest on the left, plus one flag 1 2 3 4 5 6 7 8 9 10 11 12 flag sets when a star arrives and any outlined bit holds one. never clears. a star in column 10 followed by one in column 0 is 1 bit back but not a neighbour; the column counter rules it out.

Where a star’s earlier neighbours sit in the stream. Moving up one row is eleven cells back, so the three cells above are 10, 11 and 12 back, and the cell to the left is 1 back.

6 / 8 in the writeup: Recovering the regions

One star per cell, 121 runs. After each run the tally that moved names the cell’s region.

7 / 8 in the writeup: Appendix: why the key does not fix the regions

Left, the real map. Right, one of the alternatives: cell (0, 4) moved from region A to region B. Both have the key as their only solution.

8 / 8 in the writeup: Appendix: the fifth message

The near miss with the fewest touching pairs, found with Z3 and run through the simulator. The pair is in red.