# q27 Physical Ternary Silicon Specification (SKY130 Multi-Vt CMOS) # Single Source of Truth for: # - Behavioral reference & conformance packs (JSON + SHA-256) # - SPICE transistor-level subcircuits & testbenches (ngspice / SKY130) # - Verilog 2-bit-encoded behavioral mirror & self-checking testbench (iverilog) [meta] schema = "q27.silicon.v1" pdk = "sky130A" logic_family = "multi_vt_cmos_voltage" vdd_v = 1.80 vss_v = 0.00 vmid_v = 0.90 # Balanced ternary symbols: # T = -1 (0.0V) # 0 = 0 (0.9V) # 1 = +1 (1.8V) [levels] T_nom_v = 0.00 T_max_v = 0.35 Z_min_v = 0.65 Z_nom_v = 0.90 Z_max_v = 1.15 P_min_v = 1.45 P_nom_v = 1.80 min_noise_margin_v = 0.25 max_static_current_uA = 50.0 [encoding_2bit] T = "2'b10" 0 = "2'b00" 1 = "2'b01" X = "2'b11" [devices] n_lvt = "sky130_fd_pr__nfet_01v8_lvt" n_svt = "sky130_fd_pr__nfet_01v8" p_svt = "sky130_fd_pr__pfet_01v8" p_hvt = "sky130_fd_pr__pfet_01v8_hvt" # --------------------------------------------------------------------------- # Standard Ternary Cell Library (Minimal Set for Balanced Ternary Arithmetic) # --------------------------------------------------------------------------- [cell.STI] description = "Standard Ternary Inverter: -x" inputs = ["a"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" truth = """ T -> 1 0 -> 0 1 -> T """ [cell.PTI] description = "Positive Ternary Inverter: maps 0 to +1" inputs = ["a"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" truth = """ T -> 1 0 -> 1 1 -> T """ [cell.NTI] description = "Negative Ternary Inverter: maps 0 to -1" inputs = ["a"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" truth = """ T -> 1 0 -> T 1 -> T """ [cell.TMIN] description = "Ternary MIN (balanced AND): min(a, b)" inputs = ["a", "b"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" truth = """ T T -> T T 0 -> T T 1 -> T 0 T -> T 0 0 -> 0 0 1 -> 0 1 T -> T 1 0 -> 0 1 1 -> 1 """ [cell.TMAX] description = "Ternary MAX (balanced OR): max(a, b)" inputs = ["a", "b"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" truth = """ T T -> T T 0 -> 0 T 1 -> 1 0 T -> 0 0 0 -> 0 0 1 -> 1 1 T -> 1 1 0 -> 1 1 1 -> 1 """ [cell.TMUX] description = "3:1 Ternary Multiplexer: sel=-1->dT, sel=0->d0, sel=+1->d1" inputs = ["sel", "dT", "d0", "d1"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" formula = "mux3(sel, dT, d0, d1)" [cell.T_HA] description = "Balanced Ternary Half Adder: a + b = 3*carry + sum" inputs = ["a", "b"] outputs = ["sum", "carry"] status = "SPICE-Generated / RTL-Verified" truth = """ T T -> 1 T T 0 -> T 0 T 1 -> 0 0 0 T -> T 0 0 0 -> 0 0 0 1 -> 1 0 1 T -> 0 0 1 0 -> 1 0 1 1 -> T 1 """ [cell.T_MUL] description = "Balanced Ternary 1-Trit Multiplier (BitNet sign-select): a * b" inputs = ["a", "b"] outputs = ["y"] status = "SPICE-Generated / RTL-Verified" truth = """ T T -> 1 T 0 -> 0 T 1 -> T 0 T -> 0 0 0 -> 0 0 1 -> 0 1 T -> T 1 0 -> 0 1 1 -> 1 """