Merge pull request #262 from Radvall/add_flip_flops

Added spice entry for flip-flops
This commit is contained in:
Vadim Kuznetsov 2023-04-21 17:04:56 +02:00 committed by GitHub
commit 7e2f2abcd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 331 additions and 6 deletions

View File

@ -0,0 +1,218 @@
<Qucs Schematic 1.0.1>
<Properties>
<View=154,-280,3550,1981,0.613003,0,0>
<Grid=10,10,1>
<DataSet=flip_flops_truth_tables.dat>
<DataDisplay=flip_flops_truth_tables.dpl>
<OpenDisplay=0>
<Script=flip_flops_truth_tables.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
</Symbol>
<Components>
<GND * 1 1290 70 0 0 0 0>
<GND * 1 1620 -20 0 0 0 0>
<R R3 1 1550 -90 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R4 1 1550 70 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<jkff_SR Y2 1 1430 -10 18 -71 0 0 "6" 0 "5" 0 "1e-12" 0>
<GND * 1 1620 140 0 0 0 0>
<GND * 1 1290 160 0 0 0 0>
<vPWL V5 1 1290 140 44 -26 0 1 "DC 0 PWL(0 0 2.3e-06 0 2.301e-06 3.3 4.6010000000000005e-06 3.3 4.602e-06 0 6.902e-06 0 6.903e-06 3.3 9.203e-06 3.3 9.204e-06 0 1.1504e-05 0 1.1505e-05 3.3 1.3805e-05 3.3 1.3806000000000001e-05 0 1.6106e-05 0 1.6107e-05 3.3 1.8407000000000002e-05 3.3 1.8408e-05 0 2.0708e-05 0 2.0708999999999998e-05 3.3 2.3008999999999996e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<vPWL V6 1 1290 40 44 -26 0 1 "DC 0 PWL(0 0 1e-06 0 1.001e-06 3.3 2.001e-06 3.3 2.002e-06 0 3.0020000000000002e-06 0 3.0030000000000003e-06 3.3 4.0030000000000005e-06 3.3 4.004e-06 0 5.004e-06 0 5.0049999999999995e-06 3.3 6.004999999999999e-06 3.3 6.005999999999999e-06 0 7.005999999999999e-06 0 7.006999999999998e-06 3.3 8.006999999999998e-06 3.3 8.007999999999999e-06 0 9.007999999999999e-06 0 9.009e-06 3.3 1.0009e-05 3.3 1.001e-05 0 1.1010000000000001e-05 0 1.1011000000000002e-05 3.3 1.2011000000000002e-05 3.3 1.2012000000000003e-05 0 1.3012000000000003e-05 0 1.3013000000000004e-05 3.3 1.4013000000000005e-05 3.3 1.4014000000000005e-05 0 1.5014000000000006e-05 0 1.5015000000000006e-05 3.3 1.6015000000000005e-05 3.3 1.6016000000000004e-05 0 1.7016000000000004e-05 0 1.7017000000000003e-05 3.3 1.8017000000000004e-05 3.3 1.8018000000000003e-05 0 1.9018000000000003e-05 0 1.9019000000000002e-05 3.3 2.0019000000000003e-05 3.3 2.002e-05 0 2.1020000000000002e-05 0 2.1021e-05 3.3 2.2021e-05 3.3 2.2022e-05 0 2.3022e-05 0 2.3023e-05 3.3 2.4023e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 1430 170 0 0 0 0>
<vPWL V7 1 1430 140 44 -26 0 1 "DC 0 PWL(0 0 4.5e-06 0 9e-06 0 1.35e-05 0 1.3501e-05 3.3 1.8001e-05 3.3 2.2501e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 1238 7 0 0 0 0>
<vPWL V8 1 1238 -23 44 -26 0 1 "DC 0 PWL(0 0 2.3e-06 0 4.6e-06 0 4.601e-06 3.3 6.901e-06 3.3 9.200999999999999e-06 3.3 9.202e-06 0 1.1502e-05 0 1.3802e-05 0 1.3803e-05 3.3 1.6102999999999998e-05 3.3 1.8403e-05 3.3 1.8404e-05 0 2.0703999999999997e-05 0 2.3004e-05 0 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 1240 -90 0 0 0 0>
<vPWL V9 1 1240 -110 44 -26 0 1 "DC 0 PWL(0 0 4.5e-06 0 9e-06 0 9.001e-06 3.3 1.3501000000000002e-05 3.3 1.3502000000000002e-05 0 1.8002e-05 0 1.8003e-05 3.3 2.2503e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 3260 20 0 0 0 0>
<R R5 1 3190 -50 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<GND * 1 2950 120 0 0 0 0>
<vPWL V10 1 2950 90 44 -26 0 1 "DC 0 PWL(0 0 1e-06 0 1.001e-06 3.3 2.001e-06 3.3 2.002e-06 0 3.0020000000000002e-06 0 3.0030000000000003e-06 3.3 4.0030000000000005e-06 3.3 4.004e-06 0 5.004e-06 0 5.0049999999999995e-06 3.3 6.004999999999999e-06 3.3 6.005999999999999e-06 0 7.005999999999999e-06 0 7.006999999999998e-06 3.3 8.006999999999998e-06 3.3 8.007999999999999e-06 0 9.007999999999999e-06 0 9.009e-06 3.3 1.0009e-05 3.3 1.001e-05 0 1.1010000000000001e-05 0 1.1011000000000002e-05 3.3 1.2011000000000002e-05 3.3 1.2012000000000003e-05 0 1.3012000000000003e-05 0 1.3013000000000004e-05 3.3 1.4013000000000005e-05 3.3 1.4014000000000005e-05 0 1.5014000000000006e-05 0 1.5015000000000006e-05 3.3 1.6015000000000005e-05 3.3 1.6016000000000004e-05 0 1.7016000000000004e-05 0 1.7017000000000003e-05 3.3 1.8017000000000004e-05 3.3 1.8018000000000003e-05 0 1.9018000000000003e-05 0 1.9019000000000002e-05 3.3 2.0019000000000003e-05 3.3 2.002e-05 0 2.1020000000000002e-05 0 2.1021e-05 3.3 2.2021e-05 3.3 2.2022e-05 0 2.3022e-05 0 2.3023e-05 3.3 2.4023e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 2870 90 0 0 0 0>
<vPWL V11 1 2870 60 44 -26 0 1 "DC 0 PWL(0 0 2.3e-06 0 2.301e-06 3.3 4.6010000000000005e-06 3.3 4.602e-06 0 6.902e-06 0 6.903e-06 3.3 9.203e-06 3.3 9.204e-06 0 1.1504e-05 0 1.1505e-05 3.3 1.3805e-05 3.3 1.3806000000000001e-05 0 1.6106e-05 0 1.6107e-05 3.3 1.8407000000000002e-05 3.3 1.8408e-05 0 2.0708e-05 0 2.0708999999999998e-05 3.3 2.3008999999999996e-05 3.3 2.3009999999999995e-05 0 2.5309999999999993e-05 0 2.5310999999999992e-05 3.3 2.761099999999999e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 3070 60 0 0 0 0>
<DFF Y3 1 3070 30 -26 34 0 0 "1e-9" 0>
<GND * 1 2070 120 0 0 0 0>
<GND * 1 2000 80 0 0 0 0>
<GND * 1 2400 30 0 0 0 0>
<R R6 1 2330 -40 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R7 1 2330 120 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<tff_SR Y4 1 2210 40 -46 64 0 0 "6" 0 "5" 0 "1 ns" 0>
<vPWL V12 1 2000 50 44 -26 0 1 "DC 0 PWL(0 0 2.3e-06 0 2.301e-06 3.3 4.6010000000000005e-06 3.3 4.602e-06 0 6.902e-06 0 6.903e-06 3.3 9.203e-06 3.3 9.204e-06 0 1.1504e-05 0 1.1505e-05 3.3 1.3805e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<vPWL V13 1 2070 90 44 -26 0 1 "DC 0 PWL(0 0 1e-06 0 1.001e-06 3.3 2.001e-06 3.3 2.002e-06 0 3.0020000000000002e-06 0 3.0030000000000003e-06 3.3 4.0030000000000005e-06 3.3 4.004e-06 0 5.004e-06 0 5.0049999999999995e-06 3.3 6.004999999999999e-06 3.3 6.005999999999999e-06 0 7.005999999999999e-06 0 7.006999999999998e-06 3.3 8.006999999999998e-06 3.3 8.007999999999999e-06 0 9.007999999999999e-06 0 9.009e-06 3.3 1.0009e-05 3.3 1.001e-05 0 1.1010000000000001e-05 0 1.1011000000000002e-05 3.3 1.2011000000000002e-05 3.3 1.2012000000000003e-05 0 1.3012000000000003e-05 0 1.3013000000000004e-05 3.3 1.4013000000000005e-05 3.3 1.4014000000000005e-05 0 1.5014000000000006e-05 0 1.5015000000000006e-05 3.3 1.6015000000000005e-05 3.3 1.6016000000000004e-05 0 1.7016000000000004e-05 0 1.7017000000000003e-05 3.3 1.8017000000000004e-05 3.3 1.8018000000000003e-05 0 1.9018000000000003e-05 0 1.9019000000000002e-05 3.3 2.0019000000000003e-05 3.3 2.002e-05 0 2.1020000000000002e-05 0 2.1021e-05 3.3 2.2021e-05 3.3 2.2022e-05 0 2.3022e-05 0 2.3023e-05 3.3 2.4023e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 2250 -70 0 0 0 0>
<vPWL V14 1 2250 -100 44 -26 0 1 "DC 0 PWL(0 0 4e-06 0 8e-06 0 8.001e-06 3.3 1.2000999999999999e-05 3.3 1.2002e-05 0 1.6002e-05 0 1.6003e-05 3.3 2.0002999999999998e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<dff_SR Y1 1 610 -10 -46 64 0 0 "6" 0 "5" 0 "1 ns" 0>
<GND * 1 800 -30 0 0 0 0>
<R R1 1 730 -100 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R2 1 730 10 -26 15 0 0 "10 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<GND * 1 800 20 0 0 0 0>
<GND * 1 490 70 0 0 0 0>
<vPWL V1 1 490 40 44 -26 0 1 "DC 0 PWL(0 0 1e-06 0 1.001e-06 3.3 2.001e-06 3.3 2.002e-06 0 3.0020000000000002e-06 0 3.0030000000000003e-06 3.3 4.0030000000000005e-06 3.3 4.004e-06 0 5.004e-06 0 5.0049999999999995e-06 3.3 6.004999999999999e-06 3.3 6.005999999999999e-06 0 7.005999999999999e-06 0 7.006999999999998e-06 3.3 8.006999999999998e-06 3.3 8.007999999999999e-06 0 9.007999999999999e-06 0 9.009e-06 3.3 1.0009e-05 3.3 1.001e-05 0 1.1010000000000001e-05 0 1.1011000000000002e-05 3.3 1.2011000000000002e-05 3.3 1.2012000000000003e-05 0 1.3012000000000003e-05 0 1.3013000000000004e-05 3.3 1.4013000000000005e-05 3.3 1.4014000000000005e-05 0 1.5014000000000006e-05 0 1.5015000000000006e-05 3.3 1.6015000000000005e-05 3.3 1.6016000000000004e-05 0 1.7016000000000004e-05 0 1.7017000000000003e-05 3.3 1.8017000000000004e-05 3.3 1.8018000000000003e-05 0 1.9018000000000003e-05 0 1.9019000000000002e-05 3.3 2.0019000000000003e-05 3.3 2.002e-05 0 2.1020000000000002e-05 0 2.1021e-05 3.3 2.2021e-05 3.3 2.2022e-05 0 2.3022e-05 0 2.3023e-05 3.3 2.4023e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 410 40 0 0 0 0>
<GND * 1 380 170 0 0 0 0>
<vPWL V2 1 380 140 44 -26 0 1 "DC 0 PWL(0 0 1.5e-05 0 1.5001000000000001e-05 3.3 3.0001e-05 3.3 3.0002e-05 0 4.5002e-05 0 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 380 -50 0 0 0 0>
<vPWL V3 1 410 10 44 -26 0 1 "DC 0 PWL(0 0 2.3e-06 0 2.301e-06 3.3 4.6010000000000005e-06 3.3 4.602e-06 0 6.902e-06 0 6.903e-06 3.3 9.203e-06 3.3 9.204e-06 0 1.1504e-05 0 1.1505e-05 3.3 1.3805e-05 3.3 1.3806000000000001e-05 0 1.6106e-05 0 1.6107e-05 3.3 1.8407000000000002e-05 3.3 1.8408e-05 0 2.0708e-05 0 2.0708999999999998e-05 3.3 2.3008999999999996e-05 3.3 2.3009999999999995e-05 0 2.5309999999999993e-05 0 2.5310999999999992e-05 3.3 2.761099999999999e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<vPWL V4 1 380 -80 44 -26 0 1 "DC 0 PWL(0 0 6.5e-06 0 6.500999999999999e-06 3.3 1.3001e-05 3.3 1.3002e-05 0 1.95e-05 0 1.951e-5 3.3)" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<.TR TR3 1 710 1720 0 86 0 0 "lin" 1 "0" 1 "25 us" 1 "100" 1 "Trapezoidal" 0 "2" 0 "1 ns" 0 "1e-16" 0 "150" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "26.85" 0 "1e-3" 0 "1e-6" 0 "1" 0 "CroutLU" 0 "no" 0 "yes" 0 "0" 0>
<SpicePar SpicePar3 1 300 1720 -27 18 0 0 "vcc=3.3" 1 "tripdt=6n" 1>
<SPICEINIT SPICEINIT3 1 309 1841 -32 18 0 0 "codemodel /lib/ngspice/digital.cm" 1>
<vPWL V15 1 2210 160 44 -26 0 1 "DC 0 PWL(0 0 4e-06 0 8e-06 0 1.2e-05 0 1.2001e-05 3.3 1.6001e-05 3.3 2.0001e-05 3.3 )" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0 "" 0>
<GND * 1 2210 190 0 0 0 0>
<GND * 1 2400 180 0 0 0 0>
</Components>
<Wires>
<1480 10 1490 10 "" 0 0 0 "">
<1480 -30 1490 -30 "" 0 0 0 "">
<1620 -90 1620 -20 "" 0 0 0 "">
<1580 -90 1620 -90 "" 0 0 0 "">
<1490 -90 1490 -30 "Q_JK" 1510 -30 37 "">
<1490 -90 1520 -90 "" 0 0 0 "">
<1490 10 1490 70 "NQ_JK" 1510 20 27 "">
<1490 70 1520 70 "" 0 0 0 "">
<1580 70 1620 70 "" 0 0 0 "">
<1620 70 1620 140 "" 0 0 0 "">
<1290 -10 1380 -10 "clc_JK" 1294 -40 60 "">
<1290 -10 1290 10 "" 0 0 0 "">
<1380 10 1380 110 "" 0 0 0 "">
<1290 160 1290 170 "" 0 0 0 "">
<1290 110 1380 110 "K" 1350 80 54 "">
<1430 50 1430 110 "reset_JK" 1440 80 28 "">
<1380 -53 1380 -30 "" 0 0 0 "">
<1238 -53 1380 -53 "J" 1350 -80 84 "">
<1430 -140 1430 -70 "" 0 0 0 "">
<1240 -140 1430 -140 "set_JK" 1410 -170 139 "">
<1240 -90 1240 -80 "" 0 0 0 "">
<3130 -50 3130 20 "Q_RS" 3150 20 47 "">
<3130 -50 3160 -50 "" 0 0 0 "">
<3260 -50 3260 20 "" 0 0 0 "">
<3220 -50 3260 -50 "" 0 0 0 "">
<2870 20 2870 30 "" 0 0 0 "">
<2870 20 3040 20 "D_RS" 2960 -10 60 "">
<2950 60 3040 60 "clc_RS" 2970 30 0 "">
<3040 40 3040 60 "" 0 0 0 "">
<3100 20 3130 20 "" 0 0 0 "">
<2260 60 2270 60 "" 0 0 0 "">
<2160 -20 2160 20 "" 0 0 0 "">
<2000 -20 2160 -20 "T" 2110 -50 77 "">
<2000 -20 2000 20 "" 0 0 0 "">
<2260 20 2270 20 "" 0 0 0 "">
<2400 -40 2400 30 "" 0 0 0 "">
<2360 -40 2400 -40 "" 0 0 0 "">
<2270 -40 2270 20 "Q_T" 2290 20 37 "">
<2270 -40 2300 -40 "" 0 0 0 "">
<2270 60 2270 120 "NQ_T" 2290 70 27 "">
<2270 120 2300 120 "" 0 0 0 "">
<2070 60 2160 60 "clc_T" 2100 10 11 "">
<2210 -130 2210 -20 "" 0 0 0 "">
<2210 -130 2250 -130 "set_T" 2240 -170 6 "">
<660 -30 670 -30 "" 0 0 0 "">
<670 -100 670 -30 "Q_D" 690 -30 47 "">
<670 -100 700 -100 "" 0 0 0 "">
<800 -100 800 -30 "" 0 0 0 "">
<760 -100 800 -100 "" 0 0 0 "">
<660 10 700 10 "" 0 0 0 "">
<760 10 800 10 "" 0 0 0 "">
<800 10 800 20 "" 0 0 0 "">
<490 10 560 10 "clc_D" 540 -20 0 "">
<610 -110 610 -70 "" 0 0 0 "">
<380 -110 610 -110 "set_D" 610 -150 198 "">
<410 -30 560 -30 "D" 500 -60 60 "">
<410 -30 410 -20 "" 0 0 0 "">
<610 50 610 110 "" 0 0 0 "">
<380 110 610 110 "reset_D" 570 130 170 "">
<2210 100 2210 130 "reset_T" 2121 130 17 "">
<2360 120 2400 120 "" 0 0 0 "">
<2400 120 2400 180 "" 0 0 0 "">
<700 10 700 10 "NQ_D" 651 30 0 "">
</Wires>
<Diagrams>
<Rect 240 1400 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(q_d)" #0900fe 0 3 0 0 0>
</Rect>
<Rect 240 440 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(d)" #0900fe 0 3 0 0 0>
</Rect>
<Rect 240 680 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(clc_d)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 240 920 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(set_d)" #0900fe 0 3 0 0 0>
</Rect>
<Rect 240 1160 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(reset_d)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 240 1640 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(nq_d)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1900 670 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(clc_t)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1059 914 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(clc_jk)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 1060 1160 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(set_jk)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1060 1400 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(reset_jk)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 1060 1640 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(q_jk)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1060 1879 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(nq_jk)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 1060 440 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(j)" #0900fe 0 3 0 0 0>
</Rect>
<Rect 1060 680 739 179 3 #c0c0c0 1 00 1 0 1e-06 1e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(k)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1900 1640 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(nq_t)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1900 1400 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(q_t)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 1900 1160 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(reset_t)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1900 920 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(set_t)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 2738 916 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(q_rs)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 2743 673 739 179 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 1 1 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(clc_rs)" #ff0000 0 3 0 0 0>
</Rect>
<Rect 1900 440 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(t)" #0900fd 0 3 0 0 0>
</Rect>
<Rect 2743 443 739 179 3 #c0c0c0 1 00 1 0 2e-06 2.5e-05 1 -0.33 2 4 1 -1 1 1 315 0 225 0 0 0 "" "" "">
<"ngspice/tran.v(d)" #0900fd 0 3 0 0 0>
</Rect>
</Diagrams>
<Paintings>
<Line 1020 -240 0 2180 #000000 1 1>
<Line 2680 -240 0 2180 #000000 1 1>
<Text 2140 -230 20 #000000 0 "T flip-flop with SR">
<Text 3020 -230 20 #000000 0 "RS flip-flop">
<Line 1860 220 1650 0 #000000 1 1>
<Line 200 -180 3310 0 #000000 1 1>
<Line 200 1690 820 0 #000000 1 1>
<Rectangle 200 220 3310 1720 #000000 1 1 #c0c0c0 1 0>
<Rectangle 200 -240 3310 460 #000000 1 1 #c0c0c0 1 0>
<Text 450 -230 20 #000000 0 "D flip-flop with SR">
<Text 1390 -230 20 #000000 0 "JK flip-flop with SR">
<Line 1850 -240 0 2180 #000000 1 1>
</Paintings>

View File

@ -17,10 +17,11 @@
#include "d_flipflop.h"
#include "node.h"
#include "misc.h"
#include "extsimkernels/spicecompat.h"
D_FlipFlop::D_FlipFlop()
{
Type = isDigitalComponent;
Type = isComponent;
Description = QObject::tr("D flip flop with asynchronous reset");
Props.append(new Property("t", "0", false, QObject::tr("delay time")));
@ -52,6 +53,7 @@ D_FlipFlop::D_FlipFlop()
ty = y2+4;
Model = "DFF";
Name = "Y";
SpiceModel = "A";
}
// -------------------------------------------------------
@ -119,3 +121,28 @@ Element* D_FlipFlop::info(QString& Name, char* &BitmapFile, bool getNewOne)
if(getNewOne) return new D_FlipFlop();
return 0;
}
QString D_FlipFlop::spice_netlist(bool isXyce)
{
if (isXyce) return QString("");
QString s = SpiceModel + Name;
QString tmp_model = "model_" + Name;
QString td = spicecompat::normalize_value(getProperty("t")->Value);
QString SET = "0";
QString QB = "QB_" + Name;
QString D = spicecompat::normalize_node_name(Ports.at(0)->Connection->Name);
QString CLK = spicecompat::normalize_node_name(Ports.at(1)->Connection->Name);
QString Q = spicecompat::normalize_node_name(Ports.at(2)->Connection->Name);
QString RESET = spicecompat::normalize_node_name(Ports.at(3)->Connection->Name);
s += " " + D + " " + CLK + " " + SET + " " + RESET + " " + Q + " " + QB;
s += " " + tmp_model + "\n";
s += QString(".model %1 d_dff(clk_delay=%2 set_delay=%2 reset_delay=%2 rise_delay=%2 fall_delay=%2)\n")
.arg(tmp_model).arg(td);
s += QString("C%1 QB_%1 0 1e-9 \n").arg(Name); // capacitor load for unused QB pin
return s;
}

View File

@ -31,6 +31,7 @@ public:
protected:
QString vhdlCode(int);
QString verilogCode(int);
QString spice_netlist(bool isXyce);
};
#endif

View File

@ -18,6 +18,7 @@
#include "dff_SR.h"
#include "node.h"
#include "misc.h"
#include "extsimkernels/spicecompat.h"
dff_SR::dff_SR()
{
@ -37,6 +38,7 @@ dff_SR::dff_SR()
ty = y2 + 4;
Model = "dff_SR";
Name = "Y";
SpiceModel = "A";
}
Component * dff_SR::newOne()
@ -173,3 +175,26 @@ QString dff_SR::verilogCode( int )
" end\n";
return l;
}
QString dff_SR::spice_netlist(bool isXyce)
{
if (isXyce) return QString("");
QString s = SpiceModel + Name;
QString tmp_model = "model_" + Name;
QString td = spicecompat::normalize_value(getProperty("Delay")->Value);
QString SET = spicecompat::normalize_node_name(Ports.at(0)->Connection->Name);
QString D = spicecompat::normalize_node_name(Ports.at(1)->Connection->Name);
QString CLK = spicecompat::normalize_node_name(Ports.at(2)->Connection->Name);
QString RESET = spicecompat::normalize_node_name(Ports.at(3)->Connection->Name);
QString QB = spicecompat::normalize_node_name(Ports.at(4)->Connection->Name);
QString Q = spicecompat::normalize_node_name(Ports.at(5)->Connection->Name);
s += " " + D + " " + CLK + " " + SET + " " + RESET + " " + Q + " " + QB;
s += " " + tmp_model + "\n";
s += QString(".model %1 d_dff(clk_delay=%2 set_delay=%2 reset_delay=%2 rise_delay=%2 fall_delay=%2)\n")
.arg(tmp_model).arg(td);
return s;
}

View File

@ -24,6 +24,7 @@ class dff_SR : public Component
void createSymbol();
QString vhdlCode(int);
QString verilogCode(int);
QString spice_netlist(bool isXyce);
};
#endif /* dff_SR_H */

View File

@ -18,6 +18,7 @@
#include "jkff_SR.h"
#include "node.h"
#include "misc.h"
#include "extsimkernels/spicecompat.h"
jkff_SR::jkff_SR()
{
@ -37,6 +38,7 @@ jkff_SR::jkff_SR()
ty = y2 + 4;
Model = "jkff_SR";
Name = "Y";
SpiceModel = "A";
}
Component * jkff_SR::newOne()
@ -183,3 +185,27 @@ QString jkff_SR::verilogCode( int )
" end\n";
return l;
}
QString jkff_SR::spice_netlist(bool isXyce)
{
if (isXyce) return QString("");
QString s = SpiceModel + Name;
QString tmp_model = "model_" + Name;
QString td = spicecompat::normalize_value(getProperty("Delay")->Value);
QString SET = spicecompat::normalize_node_name(Ports.at(0)->Connection->Name);
QString J = spicecompat::normalize_node_name(Ports.at(1)->Connection->Name);
QString CLK = spicecompat::normalize_node_name(Ports.at(2)->Connection->Name);
QString K = spicecompat::normalize_node_name(Ports.at(3)->Connection->Name);
QString RESET = spicecompat::normalize_node_name(Ports.at(4)->Connection->Name);
QString QB = spicecompat::normalize_node_name(Ports.at(5)->Connection->Name);
QString Q = spicecompat::normalize_node_name(Ports.at(6)->Connection->Name);
s += " " + J + " " + K + " " + CLK + " " + SET + " " + RESET + " " + Q + " " + QB;
s += " " + tmp_model + "\n";
s += QString(".model %1 d_jkff(clk_delay=%2 set_delay=%2 reset_delay=%2 rise_delay=%2 fall_delay=%2)\n")
.arg(tmp_model).arg(td);
return s;
}

View File

@ -24,6 +24,7 @@ class jkff_SR : public Component
void createSymbol();
QString vhdlCode(int);
QString verilogCode(int);
QString spice_netlist(bool isXyce);
};
#endif /* jkff_SR_H */

View File

@ -18,6 +18,7 @@
#include "tff_SR.h"
#include "node.h"
#include "misc.h"
#include "extsimkernels/spicecompat.h"
tff_SR::tff_SR()
{
@ -36,7 +37,8 @@ tff_SR::tff_SR()
tx = x1 + 4;
ty = y2 + 4;
Model = "tff_SR";
Name = "Y";
Name = "Y";
SpiceModel = "A";
}
Component * tff_SR::newOne()
@ -174,3 +176,26 @@ QString tff_SR::verilogCode( int )
" end\n";
return l;
}
QString tff_SR::spice_netlist(bool isXyce)
{
if (isXyce) return QString("");
QString s = SpiceModel + Name;
QString tmp_model = "model_" + Name;
QString td = spicecompat::normalize_value(getProperty("Delay")->Value);
QString SET = spicecompat::normalize_node_name(Ports.at(0)->Connection->Name);
QString T = spicecompat::normalize_node_name(Ports.at(1)->Connection->Name);
QString CLK = spicecompat::normalize_node_name(Ports.at(2)->Connection->Name);
QString RESET = spicecompat::normalize_node_name(Ports.at(3)->Connection->Name);
QString QB = spicecompat::normalize_node_name(Ports.at(4)->Connection->Name);
QString Q = spicecompat::normalize_node_name(Ports.at(5)->Connection->Name);
s += " " + T + " " + CLK + " " + SET + " " + RESET + " " + Q + " " + QB;
s += " " + tmp_model + "\n";
s += QString(".model %1 d_tff(clk_delay=%2 set_delay=%2 reset_delay=%2 rise_delay=%2 fall_delay=%2)\n")
.arg(tmp_model).arg(td);
return s;
}

View File

@ -24,6 +24,7 @@ class tff_SR : public Component
void createSymbol();
QString vhdlCode(int);
QString verilogCode(int);
QString spice_netlist(bool isXyce);
};
#endif /* tff_SR_H */

View File

@ -447,11 +447,7 @@ void Module::registerModules (void) {
REGISTER_DIGITAL_1 (fa1b);
REGISTER_DIGITAL_1 (fa2b);
REGISTER_DIGITAL_1 (RS_FlipFlop);
REGISTER_DIGITAL_1 (D_FlipFlop);
REGISTER_DIGITAL_1 (dff_SR);
REGISTER_DIGITAL_1 (JK_FlipFlop);
REGISTER_DIGITAL_1 (jkff_SR);
REGISTER_DIGITAL_1 (tff_SR);
REGISTER_DIGITAL_1 (gatedDlatch);
REGISTER_DIGITAL_1 (logic_0);
REGISTER_DIGITAL_1 (logic_1);
@ -481,6 +477,10 @@ void Module::registerModules (void) {
REGISTER_DIGITAL_1 (Logical_AND);
REGISTER_DIGITAL_1 (Logical_XOR);
REGISTER_DIGITAL_1 (Logical_XNOR);
REGISTER_DIGITAL_1 (D_FlipFlop);
REGISTER_DIGITAL_1 (dff_SR);
REGISTER_DIGITAL_1 (jkff_SR);
REGISTER_DIGITAL_1 (tff_SR);
}
// file components