• 1 Post
  • 6 Comments
Joined 2 months ago
cake
Cake day: August 18th, 2026

help-circle



  • For each operation my CPU’s ALU can do, I need to find a bit mask that turns it on only for the desired set of 8 bit opcodes. The bit mask is of the form [01_].[01_][01_][01_][01_][01_][01_][01_][01_] where 0 and 1 mean the bit has to match and _ means it doesn’t matter. The bit before the . is the xor of all the other bits in the opcode.

    The solver has to figure out both which opcodes represent each instruction and what bit masks are needed to give them the desired operations.

    EDIT

    I ultimately switched to a slightly different approach. It turns out the xor part of the mask isn’t very useful since the combinations I need aren’t super complicated. The trouble was that an operation could only trigger for a power of 2 of opcodes, so I added a secondary mask to each operation:

    Base mask: still [01_] x8\ Secondary mask: [01_x] x8 (x means both 0 and 1)

    For the secondary mask, 1 matches only if the current bit or the one to the left is true (left of the leftmost is the rightmost). 0 is the same but with nand in stead of or. x, requiring both, only matches if exactly one matches.

    Using 1 or 0 multiplies the number of matching opcodes by 3/4 (or a more complicated fraction if their areas of influence overlap), which allows much more freedom.

    Due to restrictions in the game and my "hard"ware, I’m only able to use [1_x] for the secondary mask, since a nand gate doesn’t respond right to being hooked up to a bunch of toggleable and inputs but xor/or gates do (xor is just as fast in game).



  • It’s not about voting for the lesser evil, but against the worse one. The way the United States is structured, which influences the way its people think about voting and vice versa, you are given only two options when voting for president:

    • Vote for the Democrat one
    • Vote for the Republican one

    But… you might think you’re clever and say “I should just vote for neither of them, nobody will stop me”. If your state has RCV then put your preferred candidate as a first pick and just place Democrat before Republican. Problem solved, no more strategic voting. Unfortunately, precious few states have adopted this for any elections, let alone the presidency.

    In states without RCV, there are 3 equivalent cases from your perspective:

    • Vote Republican: Increment their number by 1
      • Overall effect +1 for Republicans
    • Vote Democrat: Increment a threatening score by 1, thereby requiring Republicans to gain 1 more vote to win
      • Overall effect -1 for Republicans
    • Don’t vote or vote for a non threatening party/candidate
      • Overall effect 0 for Republicans

    Forgive me for assuming the reader wants to get Republicans (and Republican aligned Democrats) out of office. In this case, it is your responsibility to vote for the most threatening candidate. It’s a sick trick of game theory, which is why RCV is so important.