From 91c870c00cd33c8ac7e8b77caedba2674a6175c9 Mon Sep 17 00:00:00 2001 From: hemmer <915048+hemmer@users.noreply.github.com> Date: Sat, 13 Jul 2024 06:15:38 +0100 Subject: [PATCH] Fix xnor gate out --- src/Cosmos.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cosmos.cpp b/src/Cosmos.cpp index edcd126..b43159a 100644 --- a/src/Cosmos.cpp +++ b/src/Cosmos.cpp @@ -213,7 +213,7 @@ struct Cosmos : Module { outputs[NAND_GATE_OUTPUT].setVoltageSimd(nandGateOut, c); outputs[NAND_TRIG_OUTPUT].setVoltageSimd(nandTriggerOut, c); - const float_4 xnorGateOut = ifelse((x < 0) ^ (y < 0), 10.f, 0.f); + const float_4 xnorGateOut = ifelse((x > 0) ^ (y > 0), 0.f, 10.f); const float_4 xnorTriggerHigh = logicalXnorGate[c].process(xnorGateOut); logicalXnorPulseGenerator[c].trigger(xnorTriggerHigh, 1e-3); const float_4 xnorTriggerOut = ifelse(logicalXnorPulseGenerator[c].process(args.sampleTime), 10.f, 0.f);