Turn a two-transistor pass XOR into one whose output reaches both rails, in a small gate area.
Circuit context: The XOR gates of a parity tree with both polarities of every input already routed. Build a small XOR or mux from transmission gates.
A parity tree uses many XOR gates, and both polarities of every input are already routed. A colleague built each XOR from two NMOS pass transistors. The parity is right, but the block draws current at rest.
This is an Implement problem. Change the block xor so that y reaches 0 V and 1.8 V in every input row. The next gate must then draw only leakage. Keep it fast and small.
The check sets each of the four rows at rest and reads y and the supply current. It also switches b with a = 0 and measures both delays.
What the Grader Measures
Your subcircuit xor (ports a, an, b, bn, y, vdd) under the grader's own bench, one run per corner (tt):
| Check | Corner | Rule |
|---|---|---|
| y for a = 0, b = 0 | tt | ≤ 50 mV |
| y for a = 0, b = 1 | tt | ≥ 1.75 V |
| y for a = 1, b = 0 | tt | ≥ 1.75 V |
| y for a = 1, b = 1 | tt | ≤ 50 mV |
| Largest current at rest (xor and the next inverter) | tt | ≤ 10 nA |
| Slower of the two delays, b to y | tt | ≤ 60 ps |
| Budget: Gate area | tt | ≤ 400 mµm², the lower the better |
Full specification
.subckt xor a an b bn y vdd
* sky130_fd_pr__nfet_01v8 and sky130_fd_pr__pfet_01v8
.ends
| Check | Rule | How it is measured |
|---|---|---|
| y for rows 00 and 11 | ≤ 0.05 V | at rest, 1 ns after the start |
| y for rows 01 and 10 | ≥ 1.75 V | at rest, 1 ns after the start |
| Current at rest | ≤ 10 nA | the largest, over the four rows, of the current that xor and the next inverter draw together |
| Delay | ≤ 60 ps | b to y at 0.9 V, the slower of rising and falling, with a = 0 |
| Gate area (budget) | ≤ 0.4 µm² | the sum of W · L over the transistors of xor |
y drives one inverter of NMOS 1 µm and PMOS 2 µm. The check runs once at tt, 27 °C and 1.8 V.
Examples
Example 1
The Starter: Two NMOS- Design
.subckt xor a an b bn y vdd XN1 b an y 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15 XN2 bn a y 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15 .ends
- Measured by the grader
y for a = 0, b = 0: 192.3 pV (needs ≤ 50 mV) y for a = 0, b = 1: 1.427 V (needs ≥ 1.75 V) y for a = 1, b = 0: 1.427 V (needs ≥ 1.75 V) y for a = 1, b = 1: 192.3 pV (needs ≤ 50 mV) Largest current at rest (xor and the next inverter): 116.2 nA (needs ≤ 10 nA) Slower of the two delays, b to y: 66.45 ps (needs ≤ 60 ps) Gate area: 300 mµm² (budget ≤ 400 mµm²)
y only reaches 1.427 V in row 01, and the next inverter draws 116.2 nA at rest. The rise takes 66.4 ps.
Example 2
Two NMOS of 0.5 µm- Design
.subckt xor a an b bn y vdd XN1 b an y 0 sky130_fd_pr__nfet_01v8 W=0.5 L=0.15 XN2 bn a y 0 sky130_fd_pr__nfet_01v8 W=0.5 L=0.15 .ends
- Measured by the grader
y for a = 0, b = 0: 132.3 pV (needs ≤ 50 mV) y for a = 0, b = 1: 1.393 V (needs ≥ 1.75 V) y for a = 1, b = 0: 1.393 V (needs ≥ 1.75 V) y for a = 1, b = 1: 132.3 pV (needs ≤ 50 mV) Largest current at rest (xor and the next inverter): 189.8 nA (needs ≤ 10 nA) Slower of the two delays, b to y: 146.4 ps (needs ≤ 60 ps) Gate area: 150 mµm² (budget ≤ 400 mµm²)
Narrower NMOS do not help: y01 is 1.393 V, a little lower still. The threshold drop stays.
Example 3
A Static CMOS XOR of Eight Small Transistors- Design
.subckt xor a an b bn y vdd XN1 y a m1 0 sky130_fd_pr__nfet_01v8 W=0.42 L=0.15 XN2 m1 b 0 0 sky130_fd_pr__nfet_01v8 W=0.42 L=0.15 XN3 y an m2 0 sky130_fd_pr__nfet_01v8 W=0.42 L=0.15 XN4 m2 bn 0 0 sky130_fd_pr__nfet_01v8 W=0.42 L=0.15 XP1 q a vdd vdd sky130_fd_pr__pfet_01v8 W=0.42 L=0.15 XP2 q b vdd vdd sky130_fd_pr__pfet_01v8 W=0.42 L=0.15 XP3 y an q vdd sky130_fd_pr__pfet_01v8 W=0.42 L=0.15 XP4 y bn q vdd sky130_fd_pr__pfet_01v8 W=0.42 L=0.15 .ends
- Measured by the grader
y for a = 0, b = 0: 150.8 nV (needs ≤ 50 mV) y for a = 0, b = 1: 1.8 V (needs ≥ 1.75 V) y for a = 1, b = 0: 1.8 V (needs ≥ 1.75 V) y for a = 1, b = 1: 139 nV (needs ≤ 50 mV) Largest current at rest (xor and the next inverter): 431.1 pA (needs ≤ 10 nA) Slower of the two delays, b to y: 162.1 ps (needs ≤ 60 ps) Gate area: 504 mµm² (budget ≤ 400 mµm²)
Full rails and no static current, but 0.504 µm² of gate area even at minimum widths. Its series stacks also take 162.1 ps.
Constraints and Contract
- The netlist defines .subckt xor a an b bn y vdd ... .ends exactly once, with these ports in this order.
- Inside xor: X instances of sky130_fd_pr__nfet_01v8 or sky130_fd_pr__pfet_01v8, with comments and .param lines. No sources, resistors or capacitors. Use m= for parallel copies; mult= is refused.
- The check writes the .lib line itself. Everything outside xor is replaced by its own bench.
Hints
Hint 1
Run the starter and read y01 and the current at rest. Which device cannot pass a full 1?
Hint 2
A PMOS passes a strong 1. Put one beside each NMOS, with the opposite polarity of a on its gate.
Hint 3
Four transistors at W = 1 µm are over the area budget. A pass device here only drives one small inverter.
What the grader checks: The check places five copies of xor under its own bench: one per input row at rest, and one with b switching. Each row copy shares a supply with its receiving inverter, so the current includes both. The tool is ngspice 42 (libngspice0 42+ds-3build1) with the pinned SKY130 models, through tools/spice-judge.mjs. Other corners and loads are outside this problem.
Run simulates your netlist as written, with your own analyses and measurements. Submit sends it to the grader, which keeps only the subcircuit xor and makes 1 ngspice run. The numbers come from ngspice and the SKY130 models the site pins; they prove the measured cases, not every condition a chip meets.
See all 1 steps and the final capstone