diff --git a/.README.md.swp b/.README.md.swp
index 03c157e..7f9535f 100644
Binary files a/.README.md.swp and b/.README.md.swp differ
diff --git a/README.md b/README.md
index 9f76543..245b5d1 100644
--- a/README.md
+++ b/README.md
@@ -3,19 +3,6 @@
This is my personal collection of modules for [VCV Rack](https://vcvrack.com/): feel free to use them and modify them as you wish. If you find them useful, feel free to get me a beer.
-### Tension
-**Tension** is a fixed voltage generator: you turn the knob, you change the voltage. Useful when playing with logic chains or if you need to power up a virtual lamp ;) .
-
-![tension](https://raw.githubusercontent.com/naus3a/NauModular/master/tension.png "tension")
-
----
-
-### Function
-**Function** is a function generator; it outputs the 3 conic section functions you learned in high school: ellipse, parabola and hyperbola. Input voltage acts as the x variable, while the knob is a constant parameter.
-
-![function](https://raw.githubusercontent.com/naus3a/NauModular/master/function.png "function")
-
----
### Perlin
**Perlin** is a [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) generator.
@@ -37,12 +24,32 @@ The lowest, central output is the *mix output*, giving you a mix of the noise oc
---
### S&H(it)
-**S&H(it)** is a sampler and hold module. The *time knob* controls how often it samples the input signal; the *divider knob* scales the other knob's value, so yu can range from very quick lo-fi sampling to >1s periods;
+**S&H(it)** is a sample and hold module. The *time knob* controls how often it samples the input signal; the *divider knob* scales the other knob's value, so yu can range from very quick lo-fi sampling to >1s periods.
![S&Hit](https://raw.githubusercontent.com/naus3a/NauModular/master/shit.png "S&Hit")
---
+### BitHammer
+**BitHammer** is a logic module performing bitwise operations on 2 inputs. The incoming values are rendered as bits, hammered, reassembled as virtual voltages and finally sent out to the 6 outputs.
+
+![BitHammer](https//raw.githubusercontent.com/naus3a/NauModular/master/bithammer.png "BitHammer")
+
+---
+
+### Tension
+**Tension** is a fixed voltage generator: you turn the knob, you change the voltage. Useful when playing with logic chains or if you need to power up a virtual lamp ;) .
+
+![tension](https://raw.githubusercontent.com/naus3a/NauModular/master/tension.png "tension")
+
+---
+
+### Function
+**Function** is a function generator; it outputs the 3 conic section functions you learned in high school: ellipse, parabola and hyperbola. Input voltage acts as the x variable, while the knob is a constant parameter.
+
+![function](https://raw.githubusercontent.com/naus3a/NauModular/master/function.png "function")
+
+---
diff --git a/bithammer.png b/bithammer.png
new file mode 100644
index 0000000..657591a
Binary files /dev/null and b/bithammer.png differ
diff --git a/res/BitHammer.svg b/res/BitHammer.svg
new file mode 100644
index 0000000..8e98a93
--- /dev/null
+++ b/res/BitHammer.svg
@@ -0,0 +1,380 @@
+
+
+
+
diff --git a/src/.BitHammer.cpp.swp b/src/.BitHammer.cpp.swp
new file mode 100644
index 0000000..909149d
Binary files /dev/null and b/src/.BitHammer.cpp.swp differ
diff --git a/src/BitHammer.cpp b/src/BitHammer.cpp
new file mode 100644
index 0000000..71b95fd
--- /dev/null
+++ b/src/BitHammer.cpp
@@ -0,0 +1,96 @@
+#include "NauModular.hpp"
+
+struct BitHammer : Module{
+ enum ParamIds{
+ NUM_PARAMS
+ };
+ enum InputIds{
+ A_INPUT,
+ B_INPUT,
+ NUM_INPUTS
+ };
+ enum OutputIds{
+ AND_OUTPUT,
+ OR_OUTPUT,
+ XOR_OUTPUT,
+ LEFT_OUTPUT,
+ RIGHT_OUTPUT,
+ NOT_OUTPUT,
+ NUM_OUTPUTS
+ };
+ enum LightIds{
+ NUM_LIGHTS
+ };
+
+ union Volts2Bits{
+ float volts;
+ int bits;
+ };
+
+ BitHammer();
+ void step() override;
+
+ Volts2Bits inA;
+ Volts2Bits inB;
+
+ Volts2Bits outAnd;
+ Volts2Bits outOr;
+ Volts2Bits outXor;
+ Volts2Bits outLeft;
+ Volts2Bits outRight;
+ Volts2Bits outNot;
+};
+
+BitHammer::BitHammer() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS){
+}
+
+
+void BitHammer::step(){
+ inA.volts = inputs[A_INPUT].value;
+ inB.volts = inputs[B_INPUT].value;
+
+ outAnd.bits = inA.bits & inB.bits;
+ outOr.bits = inA.bits | inB.bits;
+ outXor.bits = inA.bits ^ inB.bits;
+
+ outNot.bits = ~inA.bits;
+ outNot.bits &= ~inB.bits;
+
+ outLeft.bits = inA.bits &(1<< inB.bits);
+ outRight.bits = inA.bits >> inB.bits;
+
+ outputs[AND_OUTPUT].value = outAnd.volts;
+ outputs[OR_OUTPUT].value = outOr.volts;
+ outputs[XOR_OUTPUT].value = outXor.volts;
+ outputs[NOT_OUTPUT].value = outNot.volts;
+ outputs[LEFT_OUTPUT].value = outLeft.volts;
+ outputs[RIGHT_OUTPUT].value = outRight.volts;
+}
+
+BitHammerWidget::BitHammerWidget(){
+ BitHammer * module = new BitHammer();
+ setModule(module);
+ box.size = Vec(6*RACK_GRID_WIDTH, RACK_GRID_HEIGHT);
+ {
+ SVGPanel * panel = new SVGPanel();
+ panel->box.size = box.size;
+ panel->setBackground(SVG::load(assetPlugin(plugin, "res/BitHammer.svg")));
+ addChild(panel);
+ }
+
+ addChild(createScrew(Vec(15,0)));
+ addChild(createScrew(Vec(box.size.x-30,0)));
+ addChild(createScrew(Vec(15,365)));
+ addChild(createScrew(Vec(box.size.x-30,365)));
+
+ addInput(createInput(Vec(15, 85), module, BitHammer::A_INPUT));
+ addInput(createInput(Vec(50, 85), module, BitHammer::B_INPUT));
+
+ addOutput(createOutput(Vec(20, 140), module, BitHammer::AND_OUTPUT));
+ addOutput(createOutput(Vec(20, 175), module, BitHammer::OR_OUTPUT));
+ addOutput(createOutput(Vec(20, 210), module, BitHammer::XOR_OUTPUT));
+ addOutput(createOutput(Vec(20, 245), module, BitHammer::LEFT_OUTPUT));
+ addOutput(createOutput(Vec(20, 280), module, BitHammer::RIGHT_OUTPUT));
+ addOutput(createOutput(Vec(20, 315), module, BitHammer::NOT_OUTPUT));
+}
+
diff --git a/src/NauModular.cpp b/src/NauModular.cpp
index 4b93cc7..8f907ea 100644
--- a/src/NauModular.cpp
+++ b/src/NauModular.cpp
@@ -33,6 +33,11 @@ void init(rack::Plugin * p){
"S&h(it)",
"S&h(it)",
SAMPLE_AND_HOLD_TAG));
+
+ p->addModel(createModel("NauModular",
+ "BitHammer",
+ "BitHammer",
+ LOGIC_TAG));
}
/*
void NauModular::init(){
diff --git a/src/NauModular.hpp b/src/NauModular.hpp
index c8c6e0c..3c121bd 100644
--- a/src/NauModular.hpp
+++ b/src/NauModular.hpp
@@ -49,3 +49,7 @@ struct PerlinWidget : ModuleWidget{
struct S_h_itWidget : ModuleWidget{
S_h_itWidget();
};
+
+struct BitHammerWidget : ModuleWidget{
+ BitHammerWidget();
+};