Introduction



While the Quad NAND Gate 4093 chip was designed to do boolean logic, it can also be misused to synthesize modulating square waves.

A single NAND gate has two inputs and one output. The 4093 chip has four NAND gates which is why it is referred to as Quad NAND gate. NAND stands for one of the common boolean logics (Not AND) where two input states, highs (1s) or lows(0s), define the state of the output.

Truth Table for NAND gate

input 1 input 2 output
0 0 1
0 1 1
1 0 1
1 1 0


The chip uses Schmitt Trigger comparators, which provides noiseless and direct swapping of the states.

When states change there is frequency. If the frequency oscillates through air and is in the range of hearing, there is sound. If you do the above mentioned state swapping you create an oscillation, a square wave signal of highs and lows, which can be amplified and heard.

A basic square wave can be made with just one NAND gate. The first input is connected high (+5 to 15V) the second is connected low (GND) by capacitor and the output is fed back to the second input through a resistor. The chain of events is in a fast loop:
  1. If input1 is high and input2 is low, the output will be high.
  2. The high output recharges the capacitor in time affected by the feedback resistor
  3. The charged capacitor pulls input2 high, then the output goes low and the capacitor discharges.
  4. The cycle repeats.


The frequency generated is based on the capacitance and resistance. If you increase the resistance, then less current will flow to capacitor, which in turn will slow the swapping and give you a lower pitch. Using a larger capacitor will make it take longer to recharge, which will also force the range of the pitch to be lower.

NAND gates can modulate each other. By connecting the output of gate 1 to the input 1 of gate 2, the swapping high-low cycle enables and disables the second gate very fast while the second gate produces its own frequencies. This can be fed further to the gate 3 and so on. This results in complex square wave modulations.