
Learn to set up Sky130 open source BDK, Energy Space simulator, Xschem schematic capture, and Magic layout tools for analog comparator design, and perform pre-layout and layout simulations.
discover how to install magic on linux, including using distro repositories or manual builds, manage dependencies for the BTK, and optionally run in a virtual box.
Finish installing magic and set up the sky130 pdk with the make command, then install energy spice via installers to handle dependencies, verify in a terminal, and complete spice installation.
Review the installed Xschem setup and Sky130 PDK, create a new library, and patch configurations to integrate Sky130 into the scheme for spice-based verification.
Patch the Sky130 PDK for ngspice and xschem by copying the folder, applying the patch, and pointing the schematic to the patched models and standards to enable accurate simulation.
Test xschem with sky130 pdks by configuring simulation parameters in an interactive terminal, updating the scheme, saving changes, closing the scheme, and running a test simulation.
Explore the components of a comparator circuit, including the front-end differential amplifier, amplifier stage, and output stage, and pre-layout simulations showing hysteresis via positive feedback stabilizing switching under noise.
Explore hysteresis behavior and simulation stimuli in a three-stage analog comparator design (front-end differential stage, amplifier, output), using piecewise-linear waveforms to sweep voltages and hysteresis currents.
Simulate and analyze EN, INP and IHyst inputs in the Sky130 analog comparator, examining a 3.3 V to 0 V input, a 0.8–1.8 V triangle waveform, and time-based hysteresis.
Review the differential stage outputs and the subsequent amplifier stages, noting how v diff varies over time with changes in input, forming a triangle-like amplified differential signal.
Review the amplifier output across multi-stage inverting buffers, observe hysteresis behavior and positive feedback shaping, and relate final 3.3 V high/low outputs to input thresholds.
Explore how changing differential and common mode voltages affect hysteresis and output in an analog comparator, highlighting rising versus falling edge behavior and design tradeoffs within spec.
Map the circuit to layout by inspecting deck five in magic, converting the differential amplifier and its output stages into a physical layout with transistors and the positive feedback network.
Explore transistor selection for three point three volt tolerant devices using MV and MBP diffusion in the magic deck, and study how tech file rules guide choices.
Post-layout simulation of the analog comparator shows sensitivity to W and L ratios, with hysteresis at plus/minus levels; plan future work on tapout signals and metric refinement.
A comparator is a device that compares two analog inputs and outputs a digital signal indicating which input is larger. So it has two analog input terminals and one binary digital output. When the difference between two analog input signals approach zero, noise on the inputs will cause spurious switching of digital output. This rapid change in output due to noise can be prevented by hysteresis. Hysteresis is switching the output high or low at different input signal levels. In place of one switching point, hysteresis introduces two: one for rising edge, and one for falling edge of voltage or current. The difference between the higher-level trip value (VH) and the lower-level trip value (VL) equals the hysteresis voltage (HYST).
A comparator can be divided into three distinctive pieces – a front-end differential amplifier, amplifier stage and output stage.
This comparator consists of
Front-end differential amplifier
Amplifier of the output from front-end differential sage
NAND gate to act as buffer as well as incorporate the enable pin
Inverter to act as final buffer before output. The NAND and Inverter improves the slew and provides a little gain.
Positive feedback differential set-up.
Various Comparator specifications are listed below:
Propagation Delay -The time difference between the input crossing the reference voltage and the output changing the logic state. Generally, comparators are fast
Input Offset -The difference between the input voltages at the instance where output voltage equals zero volts
Gain–Ideal Comparator has infinite gain and output jumps from low to high at a specific difference in input voltage. Ideal comparators will have a linear transfer curve.
There are multiple other parameters like output swing, Output type, input and output current and impedance but we will focus on above including hysteresis.
This webinar will discuss all design, layout and specification details using ngspice, Xschem and Magic