--- title: "Common-Emitter Transistor Amplifier" id: 51375 type: "computer_media" slug: "common-emitter-transistor-amplifier" url: "http://localhost/computer_media/common-emitter-transistor-amplifier/" markdown_url: "http://localhost/computer_media/common-emitter-transistor-amplifier.md" published_at: "2023-07-29T21:39:26+00:00" modified_at: "2026-04-03T07:59:21+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2021/01/CETAD-Nachbaur-Syncware.png" excerpt: "A complete transistor amplifier design suite that solves bias, stability, gain, frequency response, and thermal effects — and draws the schematic in character graphics." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "SyncWare Co." slug: "syncware-co" taxonomy: "post_tag" url: "http://localhost/tag/syncware-co/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" genre: - name: "Electronics" slug: "electronics" taxonomy: "genre" url: "http://localhost/type/electronics/" media_type: "Cassette" programmers: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" download_url: "https://archive.org/download/timex-sinclair-software-archive/CE%20Amplifier%20%281983%29%28Nachbaur%2C%20Fred%29%28US%29%28TS1000%29%28Program%29.zip" mediadate: "1983" producer_company: - id: 11370 title: "SyncWare Co." type: "company" url: "http://localhost/company/syncware-co/" images: - url: "http://localhost/wp-content/uploads/2021/01/CETAD-Nachbaur-Syncware.png" related_products: - id: 12175 title: "Common-Emitter Transistor Amplifier" type: "product" url: "http://localhost/product/common-emitter-transistor-amplifier/" media_type_tags: "Electronics" --- # Common-Emitter Transistor Amplifier This program designs and analyzes common-emitter transistor amplifier circuits. It stores up to three transistor specification sheets (not five as stated in the external description) covering parameters such as beta, H-parameters, thermal resistance, and frequency characteristics. The program iteratively solves the Q-point bias equations using a convergence loop that accounts for VBE variation with collector current via a logarithmic model, leakage current temperature dependence via an exponential thermal model, and junction temperature rise. It draws a detailed ASCII schematic of the amplifier circuit using block graphics characters, and performs small-signal analysis including voltage gain, current gain, input/output impedance, low-frequency 3 dB corners for three coupling/bypass capacitors, and high-frequency bandwidth using a Miller-effect capacitance model. The BASIC code makes use of POKEs to the display file for direct screen manipulation, a machine-code return via RAND USR, and a subroutine dispatch technique using computed line numbers. *** ## Program Analysis ### Program Structure The program is organized as a menu-driven application with a main loop at line 500–590. Navigation uses computed `GOTO` and `GOSUB` targets of the form `M*VAL Z$`, where `M` is a line-number multiplier constant. The major functional sections are: 1. Lines 500–590: Main menu and dispatch 2. Lines 1000–1090: Transistor file listing 3. Lines 1100–1298: Transistor data sheet input 4. Lines 1300–1430: Data sheet print/display 5. Lines 1450–1499: Section heading subroutines (one per category) 6. Lines 2000–2590: Amplifier design procedure (Q-point, component selection) 7. Lines 2900–2985: Standard component value rounding (section 6) 8. Lines 3000–3199: Q-point stability analysis with three beta values 9. Lines 3200–3890: Parametric sweep of Q-point vs. a chosen variable, graphical or tabular 10. Lines 4000–4990: Low-frequency / mid-band AC analysis and design 11. Lines 5000–5150: High-frequency response using Hybrid-Pi model 12. Lines 6000–6310: Standard component value selection 13. Lines 7000–7260: Schematic diagram display 14. Lines 8000–8090: Re-run analysis (section 8) 15. Lines 9000–9050 / 9997–9999: Variable editor using machine code ### Constants and Named Line Numbers The program uses a set of numeric variables as aliases for frequently-used constants and line numbers. This is a classic ZX81 BASIC memory optimization — storing a number in a variable and reusing the variable avoids re-parsing the literal each time. Key aliases inferred from usage include: | Variable | Value / Purpose | | --- | --- | | `N0` | 0 | | `N1` | 1 | | `N2` | 2 | | `N3` | 3 | | `N4` | 4 | | `N5` | 5 | | `N6` | 6 | | `N7` | 7 | | `N8` | 8 | | `N9` | 9 | | `O0` | 10 | | `MM` | 1,000,000 (mega/micro scaling) | | `INF` | Very large number (used for infinite capacitance) | | `M` | Menu section base line multiplier (e.g., 1000) | | `H1`, `H5`, `P0`, `S1`, `S2`, `S3`, `S4`, `S5`, `BL`, etc. | Line number aliases for key subroutines and targets | | `PI` | 3.14159… | | `KH` | Thermal voltage VT ≈ 0.026 V | | `T0` | Reference temperature (°C or K) | | `KT` | Thermal scaling constant for ICBO | ### Transistor Data Storage Up to three transistor records are stored. Each record occupies a column in a two-dimensional numeric array `X(parameter, file)` and a string array `Q$(file)`. The string array holds the part number (characters 1–8), polarity (NPN/PNP) at position `N9`, and device type (Si/Ge/Darlington) at position `O0` (10). Parameter names and units are stored in the two-row string array `X$(row, parameter)`, with row 1 being the label and row 2 being the units string. The section heading subroutines at lines 1450–1499 use a computed `GOSUB 1449+C` dispatch where `C` is the parameter index; this prints the correct section header at parameter boundaries without storing section membership explicitly. ### Q-Point Iteration The bias solution routine starting at line 3750 uses a fixed-point iteration loop. It begins with an estimated `VBE` and iterates the base current equation: - Computes `IB` and `IQ` from the resistor network equations - Detects saturation (line 3840) and cutoff (line 3860) as boundary cases - Updates `VBE` using the diode equation `VBE = K1 + K2*LN(IQ)` (lines 3827–3828) - Updates junction temperature `TJ` and leakage current `ICB` using `ICBO*EXP(KT*(TJ-T0))` (lines 3832–3833) - Converges when both `IQ` and `VQ` change by less than tolerance `ER` - Aborts if iteration count exceeds `KI`, reporting “DIVERGED” The tolerance `ER` is set differently for table mode (`1/M`) and graph mode (`1/O1`) at line 3756, trading accuracy for speed in the graphical sweep. ### AC Small-Signal Analysis The mid-band analysis at lines 4800–4990 (subroutine `S5`) uses composite H-parameters that incorporate the partially bypassed emitter resistor `R4A`. The effective parameters `H21`, `H11`, `H12`, `H22` are derived from the device H-parameters (`HFE`, `HIE`, `HRE`, `HOE`) and `R4A`. Voltage gain `AV`, current gain `AI`, and power gain `AP` are computed from these. The input resistance `RI` is the parallel combination of `R1`, `R2`, and `RBE`. The high-frequency analysis at lines 5000–5120 uses the Hybrid-Pi model. Transconductance `GM = HFE/RBE`, the Miller-multiplied input capacitance `CIN = CBE + CBC*(1 + GM*(R4A+RO))`, and the 3 dB frequency `FH` are computed analytically. Low-frequency 3 dB corners are computed for all three capacitors (`C1`, `C2`, `C3`) independently at lines 4600–4620, which is an approximation (it ignores pole interaction) but is standard for a first-order design tool. ### Graphical Parametric Sweep Lines 3370–3641 implement a parametric sweep of Q-point versus a chosen variable (VBE, TA, BETA, R1, R2, R3, R4, VS). In graph mode, the display file base address is fetched via `PEEK 16396 + 256*PEEK 16397` (line 3415), and individual character cells are written directly with `POKE` (lines 3054, 1300). Block graphic characters are used to plot IQ and VCE as separate traces on the same 32×21 character grid. The operating region (ACTIVE/SATURATED/NEAR CUTOFF/CUTOFF) is annotated, and an overload code character (computed at line 60 from four Boolean conditions: BVCE, IMAX, PMAX, TMAX) is printed alongside each data point. ### Schematic Display The ASCII schematic at line 7102 is a single large `PRINT AT` string containing block graphic escape sequences that draw the complete CE amplifier circuit, including transistor symbol, bias resistors R1/R2/R3/R4A/R4B, coupling capacitors C1/C3, bypass capacitor C2, load RL, and source RS. PNP transistors get an inverted symbol drawn at lines 7130–7144. Component values are overlaid on the schematic by the loop at lines 7010–7080 using the same coordinate lookup subroutine (`GOSUB 25`) that extracts `AT` row/column from the schematic string. ### Machine Code Usage Lines 9000–9050 implement an interactive variable editor. The program POKEs the display file (via `POKE BL, N0/N1/N2`) and then executes `RAND USR VAL "9000"` at line 9997, which calls a machine code routine. The editor prompt at line 9030 uses the syntax `LET ?= NEW VAL`, which is entered as a direct BASIC command to modify any variable. Line 9050 ends with `RETURN \76`, where `\76` is the block graphic for the character at code 76, used as a display marker. The `GOTO VAL "9000"` at line 9999 re-enters the main menu after the editor exits. ### Standard Component Value Rounding Lines 6000–6310 round computed component values to the nearest E6 or E12 series value. The program normalizes the value to the range [1, 10), finds the bounding E-series entries in array `V()`, and picks the closer one using the expression `V(D+F*(C-V(D) >= V(D+F)-C))` — a compact way to select the nearer of two neighbors without an explicit conditional. ### Unit Conversion and Display Formatting The subroutine at lines 25–38 handles display of component values with automatic unit scaling. Resistances are shown in ohms or megohms; capacitances in picofarads or microfarads, with the threshold at 1E5 pF (0.1 µF). The string expressions `("PFD." AND Y$="C")+("OHMS" AND Y$="R")` exploit the ZX81 BASIC behavior where `AND` with a true condition returns the left operand and with a false condition returns the empty string, enabling conditional string selection without `IF` statements. ### Notable Idioms and Techniques - Computed `GOSUB` and `GOTO` targets using arithmetic on line-number variables avoid long `IF/ELSE` chains throughout - `VAL "number"` in `GOTO`/`GOSUB` is used as a memory-saving alternative to a literal line number - Boolean expressions in arithmetic context (`N1 AND condition`) are used pervasively for conditional assignment and string selection - The `RR` flag (re-run mode) suppresses interactive prompts and menu returns when sections are being called programmatically from section 8 - SLOW/FAST switching is used strategically: FAST for computation-heavy loops, SLOW for interactive input and display - The convergence check at line 3820 uses `ABS(I1-IQ) < ER/M AND ABS(V1-VQ) < ER`, combining relative current and absolute voltage tolerances ### Potential Anomalies - Line 13 contains `LET ****=C` — the variable name `****` appears to be a placeholder or corruption in the listing; this would cause a syntax error unless the actual variable name was lost in transcription - Line 52–53 use escape sequences `\!!` and `\;;` which do not correspond to standard block graphic mappings and may represent inverse or special characters that were not captured correctly in the listing - The description states storage for five transistor files, but the code consistently uses file indices 1–3 (lines 1040, 1115, 1720), suggesting the description is inaccurate or refers to a different version - Line 57 uses `PLOT` with an expression involving `R0`, `D`, `V`, and `E` — `PLOT` on the ZX81 addresses the display file by character position, not pixel; this is likely intentional use of PLOT as a character-level plotting primitive consistent with the rest of the graphics approach ## Source Code ``` 0 REM %C%E% %A%M%P--%1%:%2 0 GOTO H1 10 FOR B=N1 TO N4 11 POKE 16584+B,CODE Z$(B) 12 NEXT B 13 LET ****=C 14 RETURN 20 FOR B=N1 TO N4 21 POKE 16650+B,CODE Z$(B) 22 NEXT B 23 LET C=**** 24 RETURN 25 LET Z$=C$(N1,A)+" " 26 GOSUB O0+(O0 AND O$<>"I") 27 LET Y$=Z$(N1) 28 GOSUB 32 29 LET D=CODE C$(N2,A,N1) 30 LET E=CODE C$(N2,A,N2) 31 RETURN 32 IF Y$="C" THEN LET C=C*1E12 33 IF C>=1E5 THEN GOTO 37 34 LET Z$=("PFD." AND Y$="C")+("OHMS" AND Y$="R") 35 RETURN 37 LET C=C/MM 38 LET Z$=("UFD." AND Y$="C")+("MEGOM" AND Y$="R") 39 RETURN 40 LET R$=",," 41 LET U$="~~" 42 GOTO N5*O0 43 LET R$=".." 44 LET U$="''" 46 GOSUB N6*O0 48 PRINT AT N1,A+N3;W$ 50 IF Y/N2-INT (Y/N2)>N1/H1 THEN LET R$=U$ 51 LET L=DF+33*(P1-INT (Y/N2))+A+N4 52 IF PEEK L=O0 AND R$=".." THEN LET R$="!!" 53 IF PEEK L=N9 AND R$="''" THEN LET R$=";;" 54 POKE L,CODE R$ 55 IF Z$<>" VS " THEN RETURN 56 IF A=N0 THEN RETURN 57 PLOT N2*A+N6,R0*D/V+N2*A*(E-D)/V 59 RETURN 60 LET W$=CHR$ (156+(VCE>BVCE)+N2*(IQ>IMAX)+N4*(PQ>PMAX)+N8*(TJ>TMAX)) 62 IF W$="%0" THEN LET W$="-" 65 RETURN 70 LET BP=(BETA+N1)/BETA 71 LET VDC=R4B*IQ*BP 72 LET VE=VDC+R4A*IQ*BP 74 LET VC=VE+VQ+RC*IQ 75 LET VCE=VC-VE 76 LET VMIN=RL*(R3*(VDC-VC)+(R4A+RC)*(VS-VC))/((R4A+RC+RL)*(RL+R3)-RL*RL) 77 LET VMAX=RL*(VS-VC)/(RL+R3) 79 RETURN 80 LET R$="" 81 LET R$="VC VE VDC VCE VPP VMAXVMIN"+Z$ 82 PRINT AT N4,N0; 83 FOR F=N1 TO LEN R$/N4 84 LET Z$=R$(F*N4-N3 TO F*N4) 85 GOSUB P0 86 IF Z$="IB " OR Z$="ICB " THEN LET C=C*MM 87 PRINT Z$;TAB A*O0-N5;(STR$ C+E$)( TO N6) 88 NEXT F 89 RETURN 100 LET Z=N0 500 CLS 502 LET RR=N0 505 SLOW 510 PRINT " ===%C%O%M%M%O%N-%E%M%I%T%T%E%R %T%R%A%N%S%I%S%T%O%R===",," =%A%M%P%L%I%F%I%E%R %A%N%A%L%Y%S%I%S %A%N%D %D%E%S%I%G%N=",,,"BY F.NACHBAUR",,"(C)1983",, 515 PRINT ,,TAB O1;"%M%A%I%N% %M%E%N%U",,," 1. INPUT/VIEW TRANSISTOR SPECS 2. DESIGN AMPLIFIER FROM SPECS 3. ANALYZE Q-POINT STABILITY 4. LOW FREQ/MID-BAND RESPONSE 5. HIGH FREQUENCY RESPONSE 6. STANDARD COMPONENT VALUES 7. SCHEMATIC DIAGRAM 8. RE-RUN ANALYSIS"( TO ((Z+N1)*32 AND ZN4)) 530 PRINT ,," NEXT STEP = ";Z+N1,"START OVER = 0",,," SAVE = S"," STOP = A" 540 LET Z$=INKEY$ 545 IF Z$="" THEN GOTO 540 550 IF Z$="S" THEN SAVE "C%E" 552 IF Z$="S" THEN GOTO 540 555 IF Z$<"0" OR Z$>"A" THEN GOTO H5 560 IF Z$="A" THEN STOP 570 IF Z$<"6" THEN GOTO M*VAL Z$ 580 GOSUB M*VAL Z$ 590 GOTO H5 1010 CLS 1020 PRINT T$;P$;" FILES",,, 1030 PRINT TAB N5;"%F%I%L%E% %N%O","%T%R%A%N%S%I%S%T%O%R",,, 1040 FOR A=N1 TO N3 1045 PRINT ,,TAB N8;A, 1050 PRINT Q$(A)( TO N8),, 1055 PRINT "%P%O%L. ";Q$(A,N9);" : %T%Y%P%E ";Q$(A,O0) 1065 NEXT A 1067 IF RR THEN RETURN 1070 PRINT ,," RETURN TO MENU :%M",,," INPUT DATA SHEET:%I",,," PRINT DATA SHEET:%P",,,"ANALYSIS/ DESIGN:%R" 1072 SLOW 1075 IF INKEY$="" THEN GOTO 1075 1080 LET Z$=INKEY$ 1085 GOTO (600 AND Z$="I")+(800 AND Z$="P")+(1400 AND Z$="R")+H5 1090 GOTO 1075 1100 GOSUB VAL "1700" 1145 CLS 1150 PRINT AT O6,N0;" INPUT DATA IN UNITS SHOWN.",,,P$(N2 TO );" TAGGED ""*""-NOT VITAL.";AT P0-N1,N0;"% %V%B%L% %U%N%I%T%S %V%A%L%U%E",,, 1160 PRINT "TYPE NUMBER?", 1170 INPUT Q$(Q, TO N8) 1180 PRINT Q$(Q, TO N8) 1190 GOSUB S3 1192 PRINT ,"%NPN/%PNP?" 1193 LET Z$=INKEY$ 1194 IF Z$<>"N" AND Z$<>"P" THEN GOTO 1193 1200 LET Q$(Q,N9)=Z$ 1207 PRINT AT P1,O6;"%GE/%SI/%DARL?" 1210 LET Z$=INKEY$ 1212 IF Z$<>"G" AND Z$<>"S" AND Z$<>"D" THEN GOTO 1210 1220 LET Q$(Q,O0)=Z$ 1235 PRINT AT P1,O6;E$;AT P1,O6; 1238 GOSUB VAL "1650" 1240 GOSUB S3 1242 FOR C=N1 TO P4 1243 GOTO 1250 1245 LET C=C-N1 1247 PRINT AT P0,N0;E$;E$ 1250 IF C<>N1 AND C<>N5 AND C<>N7 AND C<>15 AND C<>P1 THEN GOTO 1260 1255 GOSUB S3 1257 PRINT AT P0,N0; 1258 GOSUB 1449+C 1259 GOSUB S3 1260 PRINT X$(N1,C);" (";X$(N2,C);")","?";AT P1,O6; 1265 INPUT Z$ 1270 IF Z$="" AND (C=N6 OR C=O0 OR C=O6-N1 OR C=P1) THEN LET Z$="." 1271 IF Z$="" THEN GOTO VAL "1265" 1273 IF Z$="E" THEN GOTO VAL "1245" 1274 LET X(C,Q)=VAL Z$ 1275 PRINT Z$; 1278 IF C=O1 OR C=O3 THEN PRINT " AT " 1285 GOSUB S3 1287 IF C=P1 AND Z$<>"." THEN LET C=P1+N1 1290 NEXT C 1295 GOSUB S2 1296 LET Z=N1 1298 GOTO M 1300 POKE BL,N0 1330 GOSUB VAL "1700" 1350 GOSUB S1 1351 CLS 1355 PRINT AT N0,N0;"%T%Y%P%E:";Q$(Q, TO N8), 1360 GOSUB VAL "1650" 1370 FOR C=N1 TO P4 1375 GOSUB 1449+C 1380 PRINT X$(N1,C);(STR$ X(C,Q)+E$)( TO N4);X$(N2,C);" :"; 1385 IF C=P1 AND X(C,Q)<>N0 THEN LET C=P1+N1 1400 NEXT C 1420 GOSUB S2 1430 GOTO M 1450 PRINT ,,TAB N3;"%A%B%S%O%L%U%T%E% %M%A%X%I%M%U%M% %R%A%T%I%N%G%S" 1453 RETURN 1454 PRINT ,,TAB N9;"%T%H%E%R%M%A%L% %C%H%A%R%." 1455 RETURN 1456 PRINT ,,TAB N7;"%D%C% %C%H%A%R%A%C%T%E%R%I%S%T%I%C%S" 1463 RETURN 1464 PRINT ,,TAB N3;"%L%F% %S%M%A%L%L%-%S%I%G%N%A%L% %P%A%R%A%M%E%T%E%R%S" 1469 RETURN 1470 PRINT ,,TAB N2;"%H%F% %E%Q%U%I%V%A%L%E%N%T% %C%I%R%C%U%I%T% %V%A%L%U%E%S" 1499 RETURN 1500 PRINT "%P%L%E%A%S%E% %S%T%A%N%D% %B%Y:" 1510 FAST 1515 PAUSE H1 1520 RETURN 1600 SCROLL 1610 PRINT AT P1,P1+O0;" ";AT P1,N0; 1620 RETURN 1635 POKE BL,N0 1637 SLOW 1638 PRINT AT P3,N0;" TO COPY - %Z : CONT - %C" 1640 POKE BL,N1 1642 IF INKEY$="Z" THEN COPY 1644 POKE BL,N2 1645 IF INKEY$="C" THEN RETURN 1647 GOTO S2+N5 1650 PRINT "%P%O%L. ";Q$(Q,N9);" : %T%Y%P%E ";Q$(Q,O0) 1680 RETURN 1700 PRINT AT P1,N0;"WHICH FILE? %1-%3 " 1710 LET Z$=INKEY$ 1720 IF Z$<"1" OR Z$>"3" THEN GOTO VAL "1710" 1740 LET Q=VAL Z$ 1750 RETURN 1900 GOSUB VAL "1700" 2000 CLS 2010 PRINT T$;"USED - ";Q$(Q)( TO N8),, 2015 GOSUB VAL "1650" 2020 GOSUB S1 2025 FOR A=N1 TO P4 2030 LET C=X(A,Q)*O0**(N6*(X$(N2,A,N1)="M"))*O0**(-N6*(X$(N2,A,N1)="U"))*O0**(-12*(X$(N2,A,N1)="P")) 2035 LET Z$=X$(N1,A) 2040 GOSUB O0 2045 NEXT A 2050 IF NOT KH THEN LET KH=VAL ".026" 2051 IF NOT VBES THEN LET VBES=.8*(Q$(Q,O0)="S")+.3*(Q$(Q,O0)="G")+1.5*(Q$(Q,O0)="D") 2052 LET RC=VCES/ISAT 2053 SLOW 2055 IF RR THEN RETURN 2060 PRINT AT N2,N0;E$," INPUT EXT. CIRCUIT";P$,,,"SUPPLY VLTG.","VS="; 2062 SLOW 2065 INPUT VS 2067 PRINT VS,,,"LOAD RES.(OHMS) RL="; 2070 INPUT RL 2072 PRINT RL,,,"SOURCE RES. RS="; 2075 INPUT RS 2077 PRINT RS 2078 GOSUB S2 2082 CLS 2085 PRINT ,,"%S%E%L%E%C%T% %M%O%D%E - %ANALYSIS/%DESIGN" 2090 LET M$=INKEY$ 2095 GOTO (810 AND M$="A")+(O0 AND M$="D")+2090 2100 CLS 2102 PRINT TAB N7;"%D%E%S%I%G%N% %P%R%O%C%E%D%U%R%E" 2104 PRINT "SPECIFY %OUTPUT SWING OR %Q-POINT?" 2105 LET N$=INKEY$ 2110 GOTO 2105+(15 AND N$="O")+(25 AND N$="Q") 2120 PRINT AT N1,N0;"DESIRED OUTPUT SWING? VP=";E$ 2122 INPUT VP 2125 PRINT AT N1,P7;VP 2127 GOTO VAL "2140" 2130 PRINT AT N1,N0;"Q-POINT:VQ=";E$;E$ 2131 INPUT VQ 2132 PRINT AT N1,O1;VQ;TAB N8;"IQ="; 2133 INPUT IQ 2136 PRINT IQ 2140 PRINT "DC STABILITY (R4/R3)=SF1="; 2142 INPUT SF1 2145 PRINT SF1 2147 LET R4A=N0 2150 LET BETA=BTYP 2160 IF N$="O" THEN GOTO VAL "2200" 2170 LET R3=((VS-VQ)/IQ-RC)/(N1+SF1) 2180 LET R4B=SF1*R3 2185 GOSUB N7*O0 2190 GOTO VAL "2400" 2200 GOSUB S1 2201 PRINT AT N3,N0;E$ 2202 LET R3=M 2203 LET VQ=VS/N2 2205 LET R4B=SF1*R3 2210 LET IQ=(VS-VQ)/(RC+R3+BP*R4B) 2212 GOSUB O0*N7 2235 LET VPP=VMAX-VMIN 2240 LET C=N2*VPP/(VP+VPP) 2250 IF ABS (C-N1)<1E-4 THEN GOTO VAL "2400" 2260 IF R3-H5 THEN GOTO 3030 3010 PRINT AT N2,N0;"AMBIENT TEMP TA="; 3020 INPUT TA 3030 IF DRTF=N0 THEN GOTO 3070 3040 PRINT AT N2,N0;"%FREE AIR OR %HEAT-SINKED?" 3050 GOTO (P0 AND INKEY$="H")+(O0 AND INKEY$="F")+3050 3060 LET OCA=N1/DRTF-OJC 3065 GOTO 3100 3070 PRINT AT N2,N0;"TH. RES. CASE-AMB=";E$; 3090 INPUT OCA 3100 PRINT AT N1,N0;"OCA=";OCA;AT N2,O6;E$;AT N2,N0; 3102 GOSUB S1 3103 PRINT AT N2,N0;" %M%I%N.%B%E%T%A %T%Y%P.%B%E%T%A %M%A%X.%B%E%T%A";AT O6+N2,N0;"%R%E%G%I%O%N:",,,,"%V/%I/%P/%T:" 3105 LET KT=N1/O3 3110 IF Q$(Q,O0)="S" THEN LET KT=N1/P0 3115 FOR A=N1 TO N3 3120 LET BETA=(BMIN AND A=N1)+(BTYP AND A=N2)+(BMAX AND A=N3) 3121 PRINT AT N3,A*O0-N4;"=";BETA 3122 LET Y$="T" 3125 GOSUB S4 3132 IF IT<=KI THEN GOTO 3140 3135 PRINT AT N5,A*O0-N7;"%D%I%V%E%R%G%E%D-" 3138 GOTO VAL "3194" 3140 GOSUB N7*O0 3145 LET Z$="VB VBE IB ICB IQ PQ TJ " 3147 GOSUB N8*O0 3162 LET R$="ACTIVE" 3165 IF VQ=N0 THEN LET R$="SATUR""D" 3168 IF VQ>.9*VS THEN LET R$="NR CTOFF" 3170 IF VQ=VS THEN LET R$="CUTOFF" 3188 PRINT AT O9,A*O0-N7;R$ 3190 GOSUB N6*O0 3191 PRINT AT P1,A*O0-N7; 3192 IF W$="-" THEN PRINT " OK" 3193 IF W$<>"-" THEN PRINT "B/O-CODE";W$ 3194 NEXT A 3195 LET BETA=BTYP 3196 PRINT AT O3,P1+N1;"%U%A";TAB P1+N1;"%U%A" 3197 GOSUB S4 3198 GOSUB N7*O0 3199 GOSUB S2 3200 CLS 3201 SLOW 3202 PRINT AT N0,N0;"%C%H%A%N%G%E% %A% %V%B%L%? Y/N" 3203 IF INKEY$="Y" THEN GOSUB 9000 3205 IF INKEY$<>"N" THEN GOTO 3202 3208 PRINT AT N0,N0;"%E%X%T%R%E%M%A%L% %B%I%A%S" 3210 IF INKEY$<>"" THEN GOTO 3210 3212 IF INKEY$="" THEN GOTO 3212 3215 IF INKEY$="Y" THEN GOTO 3230 3217 IF RR THEN RETURN 3218 LET Z=N3 3220 GOTO H5 3230 PRINT AT N0,O3;E$,,,"%GRAPH OR %TABLE?" 3232 LET Y$=INKEY$ 3234 IF Y$<>"G" AND Y$<>"T" THEN GOTO 3232 3240 LET R$=" VS VBE TA BETA R1 R2 R3 R4 " 3250 PRINT AT N2,N0;" RUN VQ/IQ VERSUS WHICH VBL?",,,R$,, 3260 FOR A=N1 TO N8 3265 PRINT " ";CHR$ (A+156);" "; 3270 NEXT A 3280 LET A=CODE INKEY$-28 3290 IF AN8 THEN GOTO 3280 3300 LET Z$=R$(N4*A-N3 TO N4*A) 3301 PRINT ,,Z$; 3302 GOSUB P0 3305 GOSUB O0 3306 PRINT "=";C 3307 LET G=C 3310 PRINT "MIN. VALUE=", 3320 INPUT D 3330 PRINT D,"MAX. VALUE=", 3340 INPUT E 3350 PRINT E 3352 LET V=VS 3354 IF Z$=" VS " THEN LET V=E 3356 LET W=VS/(R4+RC+R3) 3358 IF Z$=" VS " THEN LET W=E/(R4+RC+R3) 3359 IF Z$=" R4 " THEN LET W=VS/(D+R3+RC) 3360 IF Z$=" R3 " THEN LET W=VS/(D+RC+R4) 3365 GOSUB S1 3370 CLS 3372 POKE BL,N0 3373 IF Y$="T" THEN GOTO 3450 3376 PRINT AT N4,P4;"OJA=";TAB P4;(STR$ (OCA+OJC)+E$)( TO N8) 3380 FOR A=N0 TO P0 3385 LET R$=CHR$ (P7-N4*(A/N5=INT (A/N5))) 3390 PRINT AT A+N1,N3;R$;TAB P3;R$;AT P1,A+N3;R$ 3400 NEXT A 3405 PRINT AT N0,N0;" VQ.. EXC. V/I/P/T CODE ,,IQ","VS-";TAB P4;"-ISAT=",V;TAB P4;(STR$ W+E$)( TO N8) 3410 PRINT AT P1,N1;"0-";TAB P4;"-0";TAB N2;D;TAB O0;Z$;TAB P1;E 3415 LET DF=PEEK 16396+256*PEEK 16397 3420 GOTO 3500 3450 PRINT "% ";Z$;" % %V%(%C%E%)% %I%(%Q%)% % %P%(%Q%)% % %T%(%J%)% % " 3455 LET R$="" 3500 FOR A=N0 TO P0 3510 LET C=D+A*(E-D)/P0 3520 GOSUB O3 3530 GOSUB S4 3540 IF Y$="G" THEN GOTO 3558 3545 GOSUB N6*O0 3550 PRINT AT A+N1,N0;W$;(STR$ C+" ----")( TO N6);"% "; 3552 IF IT<=KI THEN PRINT (STR$ VCE+E$)( TO N5);"% ";(STR$ IQ+F$)( TO N5);"% ";(STR$ PQ+F$)( TO N5);"% ";(STR$ TJ+F$)( TO N5);"% " 3553 IF IT>KI THEN PRINT "=====INDETERMINATE=====% " 3555 GOTO 3640 3558 IF IT<=KI THEN GOTO 3565 3560 LET R$=CHR$ (137+(A/N2=INT (A/N2))) 3561 FOR B=N2 TO P0 3562 PRINT AT B,A+N3;R$ 3563 NEXT B 3564 GOTO 3640 3565 LET Y=INT (R0*IQ/W+N1/N2) 3570 GOSUB R0 3600 LET Y=INT (R0*VCE/V+N1/N2) 3630 GOSUB R0+N3 3640 PAUSE H1 3641 NEXT A 3642 IF Y$="G" THEN GOTO 3645 3643 PRINT "MAX V/I=";V;"/";W 3645 LET C=G 3650 GOSUB O3 3655 GOSUB S4 3660 GOSUB S2 3670 GOTO VAL "3200" 3750 LET IT=N0 3751 LET BP=(BETA+N1)/BETA 3755 LET PQ=N0 3756 LET ER=(N1/M AND Y$="T")+(N1/O1 AND Y$="G") 3760 IF Z$<>"VBE " THEN LET VBE=VBES 3765 LET ICB=ICBO 3770 LET VBB=VS*R1/(R1+R2) 3775 LET RBB=N1/(N1/R1+N1/R2) 3790 LET V1=VS/N2 3795 LET I1=V1/(R4+R3+RC) 3800 LET IB=(VBB-VBE-BETA*ICB*R4)/(RB+RBB+R4*(BETA+N1)) 3802 IF IB+ICBKI THEN RETURN 3827 IF Z$<>"VBE " THEN LET VBE=K1+K2*LN IQ 3828 IF VBE>VBB THEN LET VBE=VBB 3830 LET VCE=VQ+RC*IQ 3831 LET PQ=VCE*IQ+(IB+ICB)*VBE 3832 LET TJ=TA+PQ*(OJC+OCA) 3833 LET ICB=ICBO*EXP (KT*(TJ-T0)) 3835 LET V1=VQ 3837 LET I1=IQ 3839 GOTO 3800 3840 REM %S%A%T 3845 LET IB=((VBB-VBE)*(R3+RC+R4)-VS*R4)/((RBB+RB+R4)*(RC+R3+R4)-R4*R4) 3848 IF IB+ICBO<=N0 THEN GOTO 3860 3850 LET IQ=(VS*(RBB+RB+R4)-R4*(VBB-VBE))/((RBB+RB+R4)*(RC+R3+R4)-R4*R4) 3852 LET VQ=N0 3855 GOTO 3820 3860 REM %C%O 3862 LET IB=-ICB 3864 LET IQ=ICB 3868 GOTO 3810 3870 LET VE=R4*IQ 3880 LET VB=VBE+RB*IB+VE 3885 LET VC=VE+VCE 3890 RETURN 4000 CLS 4010 LET RO=(RC+R3)*RL/(RC+R3+RL) 4020 IF M$="A" THEN GOTO 4500 4100 FAST 4101 PRINT "%A%C% %V%O%L%T%A%G%E% %G%A%I%N" 4105 LET R4A=N0 4110 LET HFE=HMIN 4120 GOSUB S5 4130 PRINT "MAX. AV AT HMIN =";AV 4140 LET R4A=R4 4150 LET HFE=HMAX 4160 GOSUB S5 4170 PRINT "MIN. AV AT HMAX =";AV 4180 PRINT "%D%E%S%I%R%E%D% %A%V ="; 4190 INPUT AD 4195 PRINT AD 4200 LET HFE=HTYP 4210 LET R4A=R4/N2 4220 GOSUB S5 4230 IF ABS ((AV-AD)/AD)R4 THEN GOTO 4260 4240 LET R4A=R4A*(AV/AD) 4250 GOTO 4220 4260 PRINT ,,"NO SOLUTION" 4270 GOSUB S2 4275 GOTO N4*M 4280 LET R4B=R4-R4A 4283 GOSUB N7*O0 4285 LET A=N1 4287 LET Z$="R4A R4B R4 " 4288 GOSUB N8*O0 4290 GOSUB S2 4300 CLS 4310 PRINT "%S%P%E%C%I%F%Y% %L%F% %3% %D%B% %C%O%R%N%E%R%S:" 4320 PRINT ,,"INPUT COUPLING:", 4325 INPUT FL1 4330 PRINT FL1,,,"EMITTER BYPASS:", 4335 INPUT FL2 4340 PRINT FL2,,,"OUTPUT COUPLING", 4345 INPUT FL3 4350 PRINT FL3 4355 GOSUB S1 4360 LET C1=N1/(N2*PI*FL1*(RS+RI)) 4365 LET C2=N1/(N2*PI*FL2*R4B) 4370 LET C3=N1/(N2*PI*FL3*(RL+R3/HOE/(R3+N1/HOE))) 4375 GOSUB N7*M 4380 LET M$="A" 4385 GOTO N4*M 4500 GOSUB S1 4502 CLS 4505 PRINT "%P%A%S%S%B%A%N%D/%L%F% %R%E%S%P%O%N%S%E" 4510 PRINT ,," %M%I%N.%H%F%E% %T%Y%P.%H%F%E% %M%A%X.%H%F%E% " 4530 FOR A=N1 TO N3 4550 LET HFE=(HMIN AND A=N1)+(HTYP AND A=N2)+(HMAX AND A=N3) 4580 PRINT AT N3,A*O0-N4;"=";HFE 4590 GOSUB S5 4600 LET FL1=N1/(N2*PI*C1*(RS+RI)) 4610 LET FL2=N1/(N2*PI*C2*R4B) 4620 LET FL3=N1/(N2*PI*C3*(RL+R3/HOE/(R3+N1/HOE))) 4625 LET APDB=O0*LN AP/LN O0 4630 LET R$="FL1 FL2 FL3 AV AI AP APDBRI " 4638 GOSUB 82 4640 NEXT A 4642 LET HFE=HTYP 4645 GOSUB S5 4650 GOSUB S2 4652 IF RR THEN RETURN 4655 LET Z=N4 4660 GOTO H5 4800 LET HIE=RB+HFE*KH/(IQ+IB) 4810 IF R4A=N0 THEN LET R4A=1/INF 4820 LET H21=HFE+HOE*(HFE+N1)/(HOE+N1/R4A) 4830 LET H11=HIE+R4A*(N1+H21)+HRE*(HFE+N1)/(HOE+N1/R4A) 4840 LET H12=(R4A*HOE+HRE)/(R4A*HOE+N1) 4850 LET H22=HOE/(R4A*HOE+N1) 4870 LET RBE=H11/(N1+(H21*H12)/(H11*H22-H21*H12+H11/RO)) 4880 LET RI=N1/(N1/R1+N1/R2+N1/RBE) 4890 LET AV=(-H21/(H11*H22-H21*H12+H11/RO))*RI/(RI+RS) 4900 LET AI=(H21/(N1+H22*RO))*(R3+RC)/(R3+RC+RL) 4910 LET AP=ABS (AI*AV) 4990 RETURN 5000 CLS 5010 PRINT "%H%F% %R%E%S%P%O%N%S%E" 5015 LET HFE=HTYP 5020 LET GM=HFE/RBE 5030 IF X(P1,Q)=N0 THEN GOTO 5100 5040 LET CBE=GM/(N2*PI*FT) 5100 LET CIN=CBE+CBC*(N1+GM*(R4A+RO)) 5110 LET FH=(HFE+GM*(RB+RS)+GM*R4A*(N1+HFE))/(N2*PI*HFE*(R4A+RB+RS)*CIN) 5120 PRINT ,,"C(IN)=",CIN*MM*MM;" PF",,,"F(3DB)=",FH/MM;" MHZ" 5130 GOSUB S2 5135 IF RR THEN RETURN 5140 LET Z=N5 5150 GOTO H5 6000 CLS 6004 PRINT "5 OR 10 '/. ?",,"(1) (2)" 6005 INPUT F 6006 IF FN2 THEN GOTO 6005 6010 GOSUB S1 6020 FOR A=N1 TO N8 6025 LET Z$=C$(N1,A)+" " 6030 GOSUB P0 6040 LET E=N0 6050 GOTO 6200+(H1 AND C=N0)-(H1 AND C<=N1 AND C<>N0)-(H1/N2 AND C>O0) 6100 LET C=C*O0 6110 LET E=E-N1 6120 GOTO 6050 6150 LET C=C/O0 6160 LET E=E+N1 6170 GOTO 6050 6200 LET D=N1 6210 IF C>=V(D) AND C<=V(D+F) THEN GOTO 6250 6220 LET D=D+F 6230 GOTO 6210 6250 LET C=O0**E*V(D+F*(C-V(D)>=V(D+F)-C)) 6260 GOSUB O0 6300 NEXT A 6310 LET Z=N7 7000 GOSUB VAL "7100" 7010 FOR A=N1 TO N8 7020 GOSUB 25 7070 PRINT AT D,E;(STR$ C+E$)( TO N5);TAB E;Z$;" " 7080 NEXT A 7085 GOSUB S2 7090 RETURN 7100 CLS 7102 PRINT AT N0,N0;"DC AND LF SCHEMATIC DIAGRAM - CE :''''''''''''''':''''''''''''''''''''''''''''''': : : %T%R%A%N%S%I%S%T%O%R:: : '. R3 : %I%N%P%U%T : '. : '. R2 '. %O%U%T%P%U%T : C1 '. '. . . : '. :....: :......% <... : '. .. .' : : : : . . : % .' C3 : : + .%>.: :....:.........% R .' : : : : : % . L .' V ''''' : : % '.: .' S ''' :R : '''. .' ''''' '. S .' R1 '. R4A : ':' '. .' '. : : -'. .' '. : : '. .' :.....'.'.'.'... : : .:. : C2 : R4B : : : :.: V : ''''' : : : : IN : '':'' : : : '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' " 7105 PRINT AT N3,P1;Q$(Q)( TO N8) 7120 IF Q$(Q,N9)="N" THEN GOTO 7150 7130 PRINT AT O1+N1,O1+N1;" ::'";TAB O1+N1;" ' '" 7144 PRINT AT N9,P9+N2;"-";AT O6-N1,P9+N2;"+" 7200 PRINT AT O6-N1,P0+N5;(STR$ VS+E$)( TO N4);TAB P0+N5;"VOLTS" 7210 LET C=RL 7215 LET Y$="R" 7220 GOSUB 32 7230 PRINT AT O0+N2,P0-N2;(STR$ C+E$)( TO N5);TAB P0-N2;Z$ 7240 LET C=RS 7245 GOSUB 32 7250 PRINT AT 15,N1;(STR$ C+E$)( TO N5);TAB N1;Z$ 7260 RETURN 8000 CLS 8010 LET RR=N1 8020 GOSUB M 8030 GOSUB VAL "1700" 8040 GOSUB N2*M 8050 CLS 8060 IF Z>N2 THEN GOSUB VAL "3010" 8070 IF Z>N3 THEN GOSUB N4*M 8080 IF Z>N4 THEN GOSUB N5*M 8090 RETURN 9000 FAST 9010 GOSUB N7*M 9015 POKE BL,N0 9020 SLOW 9030 PRINT AT P3-N1,N0;" LET ?= NEW VAL , RETURN OR CONT ";E$;"%Y" 9040 POKE 16384,89 9050 RETURN 76 9997 RAND USR VAL "9000" 9999 GOTO VAL "540" ```