* Z:\home\khalils\Downloads\files\data\raw_asc\46451baed6fe_diff_amp_learning1.asc
* Generated by LTspice 26.0.1 for Windows.
* .dc VINA -12 12 0.1
* .ac oct 100 1 100mega
;.dc VINA -100m 100m 0.1m
;.step temp -25 125 25
;.step param Rfb 0.01m 100 10
;.step param Va 8 16 1
;.step param iset 5m 20m 1m
R5 0 OA {Rt2}
VINB INB 0 0 AC -0.5
R14 V+ CA {Rt}
VP1 VCC 0 3.3
R2 N007 N008 {Rfb}
Q1 CA INA N006 0 2N3904
VINA INA 0 PWL file=ampl_train.pwl AC 0.5
VN 0 V- {Va}
Q3 OB N005 N003 0 2N3906
R4 N004 N002 {Rfb2}
I1 N008 V- {Iset}
I2 V+ N002 {Iset2}
R13 V+ CB {Rt}
R3 N003 N002 {Rfb2}
Q5 V+ CA N001 0 2N3904
R1 N006 N008 {Rfb}
R6 0 OB {Rt2}
Q2 CB INB N007 0 2N3904
R8 N005 0 4.7k
R7 N001 0 4.7k
Q6 V+ CB N005 0 2N3904
Q4 OA N001 N004 0 2N3906
VP V+ 0 {Va}
.model NPN NPN
.model PNP PNP
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.bjt
.dc VINA -100m 100m 0.1m
.param Rfb=Rt/sqrt(sqrt(2)*gain)
.param Rt=Va/Iset
.param Iset = 7m
.param Va = 12
.param Rt2=cm_out*2/Iset2
.param gain=40
.param Rfb2=Rt2/sqrt(sqrt(2)*gain)
.param cm_out=0.6
.param Iset2 = Iset
.backanno
.end

* LTspice schematic (.asc):
Version 4.1
SHEET 1 4868 1080
WIRE -224 -1328 -272 -1328
WIRE -176 -1328 -224 -1328
WIRE -64 -1328 -112 -1328
WIRE -32 -1328 -64 -1328
WIRE 144 -1328 64 -1328
WIRE 368 -1328 144 -1328
WIRE 608 -1328 560 -1328
WIRE 656 -1328 608 -1328
WIRE 304 -1264 240 -1264
WIRE 368 -1264 304 -1264
WIRE -272 -1200 -272 -1328
WIRE -112 -1200 -112 -1328
WIRE 64 -1200 64 -1328
WIRE 240 -1200 240 -1264
WIRE 560 -1200 560 -1328
WIRE -64 -272 -112 -272
WIRE 240 -272 -64 -272
WIRE 432 -272 240 -272
WIRE 752 -272 432 -272
WIRE 912 -272 752 -272
WIRE 1328 -272 912 -272
WIRE 1760 -272 1328 -272
WIRE 1328 -208 1328 -272
WIRE 240 -192 240 -272
WIRE 432 -192 432 -272
WIRE 752 -112 752 -272
WIRE 240 -64 240 -112
WIRE 512 -64 240 -64
WIRE 688 -64 512 -64
WIRE 1568 -64 1120 -64
WIRE 1328 0 1328 -128
WIRE 1328 0 1216 0
WIRE 1408 0 1328 0
WIRE 912 16 912 -272
WIRE 432 64 432 -112
WIRE 512 64 432 64
WIRE 848 64 512 64
WIRE 1216 64 1216 0
WIRE 1408 64 1408 0
WIRE 240 112 240 -64
WIRE 432 112 432 64
WIRE -144 160 -192 160
WIRE 176 160 -144 160
WIRE 592 160 496 160
WIRE 1216 192 1216 144
WIRE 1408 192 1408 144
WIRE 752 208 752 -16
WIRE 1120 208 1120 -64
WIRE 1120 208 752 208
WIRE 912 240 912 112
WIRE 1152 240 912 240
WIRE 1568 240 1568 -64
WIRE 1568 240 1472 240
WIRE 240 256 240 208
WIRE 432 256 432 208
WIRE 1408 384 1408 288
WIRE 1488 384 1408 384
WIRE 1680 384 1488 384
WIRE 240 400 240 336
WIRE 352 400 240 400
WIRE 432 400 432 336
WIRE 432 400 352 400
WIRE -144 432 -192 432
WIRE 592 432 592 160
WIRE 592 432 -144 432
WIRE 752 432 752 208
WIRE 912 432 912 240
WIRE 1216 464 1216 288
WIRE 1488 464 1216 464
WIRE 1712 464 1488 464
WIRE 352 496 352 400
WIRE 1216 512 1216 464
WIRE 1408 512 1408 384
WIRE 1216 624 1216 592
WIRE 1312 624 1216 624
WIRE 1408 624 1408 592
WIRE 1408 624 1312 624
WIRE -64 672 -96 672
WIRE 352 672 352 576
WIRE 352 672 -64 672
WIRE 752 672 752 512
WIRE 912 672 912 512
WIRE 1312 672 1312 624
SYMBOL current 1328 -208 R0
SYMATTR InstName I2
SYMATTR Value {Iset2}
SYMBOL res 224 -208 R0
SYMATTR InstName R14
SYMATTR Value {Rt}
SYMBOL voltage 240 -1216 R0
WINDOW 123 24 44 Left 2
WINDOW 39 0 0 Left 0
SYMATTR Value2 AC -0.5
SYMATTR InstName VINB
SYMATTR Value 0
SYMBOL res 1392 160 M180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R4
SYMATTR Value {Rfb2}
SYMBOL voltage -112 -1104 R180
WINDOW 0 24 96 Left 2
WINDOW 3 24 16 Left 2
SYMATTR InstName VN
SYMATTR Value {Va}
SYMBOL res 416 -208 R0
SYMATTR InstName R13
SYMATTR Value {Rt}
SYMBOL npn 688 -112 R0
SYMATTR InstName Q5
SYMATTR Value 2N3904
SYMBOL npn 176 112 R0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL res 224 240 R0
SYMATTR InstName R1
SYMATTR Value {Rfb}
SYMBOL pnp 1472 288 R180
SYMATTR InstName Q4
SYMATTR Value 2N3906
SYMBOL npn 848 16 R0
SYMATTR InstName Q6
SYMATTR Value 2N3904
SYMBOL res 736 416 R0
SYMATTR InstName R7
SYMATTR Value 4.7k
SYMBOL voltage 560 -1216 R0
SYMATTR InstName VP1
SYMATTR Value 3.3
SYMBOL res 1392 608 M180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R5
SYMATTR Value {Rt2}
SYMBOL res 1200 160 M180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R3
SYMATTR Value {Rfb2}
SYMBOL current 352 496 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName I1
SYMATTR Value {Iset}
SYMBOL npn 496 112 M0
SYMATTR InstName Q2
SYMATTR Value 2N3904
SYMBOL res 416 240 R0
SYMATTR InstName R2
SYMATTR Value {Rfb}
SYMBOL pnp 1152 288 M180
SYMATTR InstName Q3
SYMATTR Value 2N3906
SYMBOL voltage 64 -1216 R0
WINDOW 123 24 44 Left 2
WINDOW 39 0 0 Left 0
SYMATTR Value2 AC 0.5
SYMATTR InstName VINA
SYMATTR Value PWL file=ampl_train.pwl
SYMBOL res 896 416 R0
SYMATTR InstName R8
SYMATTR Value 4.7k
SYMBOL res 1200 608 M180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R6
SYMATTR Value {Rt2}
SYMBOL voltage -272 -1216 R0
SYMATTR InstName VP
SYMATTR Value {Va}
FLAG -144 160 INA
FLAG -144 432 INB
FLAG -64 -272 V+
FLAG -64 672 V-
FLAG -272 -1120 0
FLAG 64 -1120 0
FLAG -112 -1120 0
FLAG 240 -1120 0
FLAG -224 -1328 V+
FLAG -64 -1328 V-
FLAG 144 -1328 INA
FLAG 304 -1264 INB
FLAG 560 -1120 0
FLAG 608 -1328 VCC
FLAG 512 -64 CA
FLAG 512 64 CB
FLAG 1488 464 OB
FLAG 1488 384 OA
FLAG 1312 672 0
FLAG 752 672 0
FLAG 912 672 0
TEXT -304 976 Left 2 !;.dc VINA -100m 100m 0.1m
TEXT -304 1008 Left 2 !.dc VINA -100m 100m 0.1m
TEXT -232 1064 Left 2 !;.step temp -25 125 25
TEXT -216 800 Left 2 !;.step param Rfb 0.01m 100 10
TEXT -304 1040 Left 2 ;.dc VINA -12 12 0.1
TEXT -296 944 Left 2 ;.ac oct 100 1 100mega
TEXT -136 16 Left 2 !.param Rfb=Rt/sqrt(sqrt(2)*gain)
TEXT -136 -8 Left 2 !.param Rt=Va/Iset
TEXT -136 -112 Left 2 !.param Iset = 7m
TEXT -136 -136 Left 2 !.param Va = 12
TEXT -136 56 Left 2 !.param Rt2=cm_out*2/Iset2
TEXT -216 776 Left 2 !;.step param Va 8 16 1
TEXT -136 -184 Left 2 !.param gain=40
TEXT -136 80 Left 2 !.param Rfb2=Rt2/sqrt(sqrt(2)*gain)
TEXT -136 -160 Left 2 !.param cm_out=0.6
TEXT -136 -88 Left 2 !.param Iset2 = Iset
TEXT -96 -376 Left 2 !;.step param iset 5m 20m 1m