Digital Adders and Wider Muxes

Jan 14 2021, 2:55 PM PST · 0 comments »

Today we’re launching six new digital combinational gates, now available in your CircuitLab toolbox. These pair well with our recent Quick Toggle feature allowing you to rapidly do digital simulations.

Four new gates are binary adders: a full adder, half adder (no carry input), 4-bit adder, and 8-bit adder:

These can be used for making counters or even an Arithmetic Logic Unit (ALU) of a small CPU.

For example, check out this simulation where we use the 4-bit adder to create a counter which counts up from 0 to 15 before overflowing:

Click to open the circuit above and try the simulation. Can you modify the circuit to increment by 3 instead?

The other two new gates are wider muxes with 4 and 8 data inputs (and 2 and 3 control inputs, respectively):

This allows you to more compactly express higher-bit-width multiplexers without needing to wire up trees of CircuitLab’s old 2x1 muxes.

The new gates are available to all users immediately. This adds to CircuitLab’s existing digital simulation features, bringing us to 5 different types of flip-flops plus 21 different combinational logic gates.


New Feature! Quick Toggle

Jan 06 2021, 12:00 PM PST · 0 comments »

We're excited to announce the release of a new feature that makes exploring digital circuits much easier. Instead of swapping out the digital 1 and digital 0 element in your schematic, the new Quick Toggle feature allows you to switch between a 1 and a 0 digital input by simply highlighting the element and pressing spacebar.

Digital Quick Toggle

We will likely be bringing similar functionality to other elements to help you quickly explore how changing parts of your circuit affect the behavior.

Circuits with the old digital elements will be automatically updated to the new elements when loaded, so you can simply open up your digital circuits and start designing!


Extended Numerical Precision for Parameter Sweeps

Jan 04 2021, 1:00 PM PST · 0 comments »

CircuitLab has always made it easy to simulate the same circuit with variations of one or more parameters. For example, we can quickly compare the frequency response (Bode plot) of a RC low-pass filter with different capacitors by setting up the simulation with a Decade sweep over parameter C1.C from 1n to 1u:

Parameter sweep setup

With 1 point per decade, this instructs the circuit simulator to build the circuit with four values for capacitor $C_1$, specifically $1 \ \text{nF}, 10 \ \text{nF}, 100 \ \text{nF}, 1 \ \mu\text{F}$. The four responses are compared by plotting them in different colors on a single Bode plot. With old CircuitLab software prior to today, the result looked like this:

Old parameter sweep bode plot

While it works, you’ll notice in the plot legend that there are rounding errors in the values, such as when C1.C is 1.0000000000000042e-8, when it should be precisely 1e-8. That happens because the computer represents values as 64-bit floating point, leading to roughly 16 decimal digits of precision.

Instead of simply rounding or truncating the display, we’ve fixed this by applying our extended numerical precision to parameter sweeps as well. See our earlier article Double-Double, Please! When 64-Bit Floating Point Isn’t Enough for more details about extended precision numerical routines.

As of today, this issue has been fixed, and the capacitor values are calculated precisely:

New parameter sweep bode plot

We hope this makes CircuitLab a more pleasant tool to use for investigating circuit behavior.

Try the example simulation for yourself:


About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.