On the Subject of the Logic CM

A machine that knows no bounds when it comes to ciphers.

First, figure out which logic gate the cipher is using. Turn the numbers on screen 4 into 6 digit binary numbers. Then using the left number as the left bits, the middle number as the right bits, and the third number as the resulting bits, find out which gate it is by using the following table:

INPUTANDORXORNANDNORXNOR-><-!-><-!
000001111100
010111001001
100111000110
111100011100

If the Boolean Expression on screen A is true, treat the encrypted word as the right letters and the key on screen 1 as the left letters.
Otherwise, treat the encrypted word as the left letters and the letters on screen 1 as the right letters.

For each letter of the left letters and right letters, do the following:

  • Convert the Nth left letter and Nth right letter into a 5 digit binary number (A = 00000, B = 00001...Z = 11001).
  • If the Nth bit of the binary on screen 2 is a 1, invert the left binary bits.
  • If the Nth bit of the binary on screen 3 is a 1, invert the right binary bits.
  • Take the left and right binary numbers and apply the logic gate to them.
  • Turn the resulting binary bits back into a letter (00000 = A, 00001 = B...11001 = Z)

The resulting letters should form a decrypted word

A00000N01101
B00001O01110
C00010P01111
D00011Q10000
E00100R10001
F00101S10010
G00110T10011
H00111U10100
I01000V10101
J01001W10110
K01010X10111
L01011Y11000
M01100Z11001
00000000160100003210000048110000
01000001170100013310000149110001
02000010180100103410001050110010
03000011190100113510001151110011
04000100200101003610010052110100
05000101210101013710010153110101
06000110220101103810011054110110
07000111230101113910011155110111
08001000240110004010100056111000
09001001250110014110100157111001
10001010260110104210101058111010
11001011270110114310101159111011
12001100280111004410110060111100
13001101290111014510110161111101
14001110300111104610111062111110
15001111310111114710111163111111

Example 1

Encrypted Word: JIVNNXEB
Logic Key: CDXJPYPF
Gate: AND
Screen 2: 11010000
Screen 3: 01000111
Boolean Expression: True

C, J → 00010 + 1, 01001 + 0 → 11101 AND 01001 → 01001 → J
D, I → 00011 + 1, 01000 + 1 → 11100 AND 10111 → 10100 → U
X, V → 10111 + 0, 10101 + 0 → 10111 AND 10101 → 10101 → V
J, N → 01001 + 1, 01101 + 0 → 10110 AND 01101 → 00100 → E
P, N → 01111 + 0, 01101 + 0 → 01111 AND 01101 → 01101 → N
Y, X → 11000 + 0, 10111 + 1 → 11000 AND 01000 → 01000 → I
P, E → 01111 + 0, 00100 + 1 → 01111 AND 11011 → 01011 → L
F, B → 00101 + 0, 00001 + 1 → 00101 AND 11110 → 00100 → E

Decrypted Word: JUVENILE

Example 2

Encrypted Word: HLIRN
Logic Key: HOOEJ
Gate: !->
Screen 2: 01001
Screen 3: 11000
Boolean Expression: False

H, H → 00111 + 0, 00111 + 1 → 00111 !-> 11000 → 00111 → H
L, O → 01011 + 1, 01110 + 1 → 10100 !-> 10001 → 00100 → E
I, O → 01000 + 0, 01110 + 0 → 01000 !-> 01110 → 00000 → A
R, E → 10001 + 0, 00100 + 0 → 10001 !-> 00100 → 10001 → R
N, J → 01101 + 1, 01001 + 0 → 10010 !-> 01001 → 10010 → S

Decrypted Word: HEARS