2026-09-20 15:32 UTC
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.
Replies (1)
-
@MadhuGururajan@programming.dev 2026-09-22 08:15
I think you’re trying to solve a NP Complete problem (Boolean Satisfiability) via brute force. It’s expected you will hit this wall. Try to use heuristics/guess work.