CHIP  7:7:::5,4;"Please wait while I load";7,10 ;"MAKE A CHIP";1;7,10 ;"___________":16,0;: "" }PART 2 &_z 8]c]s]Ì]Ý]è]\w7?R(+>(X!Z\!W2\+@\>>(2H\r#r#] ] ] ] ]!X?h ]]` ]] ]]` ]]:\??2\O:\2\c] !!:\O2\:\=''O:\Oc]=2\O:\_:\G:\/ //O!9Ð dn=ç:n1=n:n2=n1+n1:n3=:n4=n2+n2:n5=n3+n2:n6=n3+n3:n7=n4+n3:n8=n4+n4:n9=n3*n3:n0=n9+n1  9000(# 2Bn7:n7:n1:::n1/n2,-n0:n0,n2;"Turn your tape recorder off." 20,n;"Where do you want to start? ":n0+n5,n ]"Part 1 (learn), 2 (examples), 3 (experiment) or 4(STOP)";n$:n$n1 sd/n0,n:220 n$="3"400 n$="4" n$="2"370r n$"1"sd/n0,n:"" ,n:it:sa:so:sn:snd:sr 6cls:''"You have now learnt about the basic elements used in circuit design. The next part of the program enables you to combine gates and to see what happens with a selection of different input values." @=n3*n7,n;"Type C to continue, or S to stop":n$ Jn$=nsd/n0,n:320@ Tn$(n1)="s"n$(n1)="S": ^N$"C"n1/n2,n:320@ r 7100 |Yn3*n7,N;"Type C to continue, or S to stop":n$:N$N1SD/N0,N:380| n$(n1)="s"n$(n1)="S": N$"C"n1/n2,n:320@  980 CT:17,N;"Type R to run the circuit, C to continue design, L to learn about gates, E to see the examples.";17,n 1"R, C, L or E :";a$:a$n1sd/n0,n:405 a$="C"rd=n1400 a$="C"rd=nedit:402 +a$="L"5820:RD=1:400 a$="E"370r a$"R"sd/n0,n:405 6280:6370 ct:n0+n7,0;"Type 1 for the computer to try each set of inputs in turn, or type 2 (or 3) to try particular sets of inputs. Type 3 to guessthe output for your input values" -"1, 2 or 3 :";a$:a$=""sd/n0,n:430 a$="1"500 a$="2"600X a$="3"800  sd/n0,n:430 5600:700 X6150:6570 b6630:MODE 1 l/mode=n1:6800:more i/p etc then mode 1 v 700 CT Ɯn0+n7,n;"Type A to amend the circuit, R to set inputs & run, L to learn about gates, E to see example circuits, S to stop." 4"A, S, R, L or E :";a$:a$n1sd/n0,n:720 a$="A"edit:700  a$="S" a$="R"418 +a$="L"5820:7620:700 +a$="E"7100:7620:700  sd/n0,n:720  6150:6570 *$mode=n3:p(n4):I=N1N4:P(I)=N:I 4<ct:17,n;"What do you think the outputs will be?" >o=n1n4:o(o,n1)nn0+n9,n;"Output ";o;" will have value ?":ib:p(o)=ip:n0+n9,n5*n5;ip:CX=n5:CY=O:1350F:Y1+n1,X1;N1;"?";IP:WT:n Ho R 6630 \CT:o=n1n4:o(o,N1)nn0+n9,n;"Output ";o;" was ";o(o,n2)'("You guessed correctly"p(o)=o(o,n2));("Your guess was wrong"p(o)o(o,n2));". ":WT:200 fO:6800 p #N:RD=N:old=n17620:edit CLS:"In this part you can experiment with the gates and try to createyour own circuits."''"You may use any of the gates - AND, OR, NOT, NOR and NAND. Youhave a command COPY which will copy your circuit to the ZX Printer if it is connected. A command OUT allows you to set up to 4 outputs. STOP will stopthe design part, I will then check the circuit is valid, and will work out the output for anyinput combination you select."''"Have fun!":pk xold=n1::i=sc+bt:n:n,n0+n1;"MAKE A CHIP";n1,n;n5;"in <-----gates----> out":n:cx=n2:cy=n1 BT:ct:'"To move the cursor use keys 5-8.When you press enter you will beable to specify the type of gateor enter a command." xh=n4:xl=n2:1200:ct:"Type STOP to stop design COPY tO print circuit OUT to set outputs NEW to start again, or AND OR NOT NAND NOR for gate." KN0,N:"Type your command: ";a$:g=n1:A$N4sd/n0,n:1030 5J=A$:a$(n1j)s$(g,n1j)gxh ct:'"You can not position a gate here! Try again.":sd/n0,n:pk:1010 8Mm(cx-n1,cy,n1)n3M(CX-N1,CY,N1)Ngn3m(cx-n1,cy,n1)=g:6520x:edit =m(cx-n1,cy,n1)n77302 B/m(cx-n1,cy,n1)=g:gx=cx-n1:gy=cy:6520x Lp1,cx:p2,cy:t=fnz Vct:"Select where the inputs to this gate come from. Position the cursor where the input is from, or at one of the outputs if you are unsure." `6xl=n1:xh=n5:1200:p1,cx:p2,cy:in1=fnz:ct e4s=in1:sxl):1310 1i$=n8cx=(xhcx=xh)+(cx+n1cxn1):1310 1i$=n6cy=(n4cy=n4)+(cy+n1cyn4)+(n4s>n8)+(n4s>n0+n2)+(n4s>n4*n4):t1=n1+(n4t>n4)+(n4t>n8)+(n4t>n3*n4)+(n4t>n4*n4) 021,0;"I am drawing the connexion" /fb=(nsnb(st)=s  stnj(j,n2)=n2:j(j,n3)=n1:j=j+n1 )l(n2)>nj(j,n2)=n7:j(j,n3)=n2:j=j+n1 )l(n3)>nj(j,n2)=n0:j(j,n3)=n3:j=j+n1 /l(n4)>nj(j,n2)=15:j(j,n3)=n4:j=j+n1 tCT:LT=J-n1:LST=-n1+n2^LT:u=nLST:n0+n7,N;"I shall select a set of inputs":j=n1n4:i(j)=n:J(J,N1)=N:j:j=u &jn8J(n4,N1)=n1:j=j-n8 0jn4j(n3,n1)=n1:j=j-n4 :jn2j(n2,n1)=n1:j=j-n2 D j(n1,n1)=J NAJ=N1N4:J(J,2)>NI(J(J,N3))=J(J,N1):J(J,N2),N;J(J,N1) XJ bJ=N1N4:L(J)=NI(J)=N lJ v6630:CT 7FDBCK=n1i=n1n3:j=n1n4:m(i,j,n4)=m(i,j,n5):j:i CT:n0+n7,n;"Do you want me to print a copy of the circuit on ZX Printer? Type C for a copy, or type N forthe next set of input values.";n0+n7,N;: @"C (Copy) or N (Next inputs) ";a$:a$n1sd/n0,n:5780 ,a$(n1)"C"a$(n1)"N"sd/n0,n:5780 CT:a$(n1)="C" 7740<:U: 7:1:0:CLS:"What type of gate do you want tofind out about?"''" AND NAND "'" "''" OR NOR "'" "''" NOT "'" " <15,N;"Type QUIT to leave this part of the program." >"Type the gate name ";g$:g$n4sd/n0,n:5840 g$="QUIT"CLS: g$="AND"CLS:sa:5820 !g$="NAND"CLS:snd:5820 g$="OR"CLS:so:5820 g$="NOR"CLS:sr:5820  g$="NOT"CLS:sn:5820 sd/n0,n:5840  0B$(S,CL)"0"ST=B$(S,CL):5:0: "5920 +5*CL %HB$(S,2)"0"E=B$(S,N2)-N8:B(E)=NST=E:B(E)=S:B$(S,N1)=E: 'KB$(S,3)"0"E=B$(S,N3)-N8-N8:B(E)=NST=E:B(E)=S:B$(S,N1)=E: ( 59459 *CB$(S,N1)"0"E=B$(S,N1)+N8:B(E)=NST=E:B(E)=S:B$(S,N2)=E: ,CB$(S,N3)"0"E=B$(S,N3)-N8:B(E)=NST=E:B(E)=S:B$(S,N2)=E: - 59459 /FB$(S,N1)"0"E=B$(S,N1)+N8+n8:B(E)=NST=E:B(E)=S:B$(S,N3)=E: 1CB$(S,N2)"0"E=B$(S,N2)+N8:B(E)=NST=E:B(E)=S:B$(S,N3)=E: 9H=N1:EN1=N8 >=HEN1(B(H)=NB(H+N8)=NB(H+N8+N8)=N)H=H+N1:5950> H,HEN1ST=ST+H-N1:B$(S,CL)=ST:B(ST)=S: RH=ST \'HEDB(H)NH=H+1:5980\ fB(H)=S:B$(S,CL)=H:ST=H: p@n,"`":n,"&":23,n:n,"`":23,n:n,"&",: z=n,"d":n," ":" ",-n8-n8:-" ",-n8-n8:د"Q","t",n2: an,"`":n,"&",/n2:23,n:23,-n0-n9,-/n4:-23,-n0-n9,-/n4:-23,n: an:د"\","s",n2: or:د"`","s",n2: !i=n0+n2n3*n7:i,n;" ";n:i: fn2,n5*n5;"Truth";n3,n5*n5;"table";n5,n5*n5;"in out":"","":n1;"=",n:"","_":n,n0*n4: k=n1n5*n5:k: Kwt:n0:pk:c,"8":a,c:b,c:n6,n1;" ";n8,n1;" ";n7,n7+n7;" ":wt: wt:pk:cls: ?a,set:ib:in1=ip:n6,n1;in1:a,(lnin1=on)+(lfin1=off):wt Ab,set:ib:in2=ip:b,(lnin2=on)+(lfin2=off):n8,n1;in2:wt: 'i=n1n3*n7:i,n;" ";n:i:n2,n;: ,i=n0+n7n3*n7:i,n;" ";n:i:n0+n7,n;: Rn0:n3*n7,n;"Please press any key to continue":n:"Q"n3*n7,n;" ";n: n3*n7,n;" ";n:200 'ct:l(n1)=nl(n2)=nl(n3)=nl(n4)=n <''"Now select the values for the inputs to the circuit." ki=n1n4:k=i+i+(n3in2)+(n1in3)+(n3in4):l(i)>nk,n;n4;" "'" ":ib:i(i)=ip:k,n;i(i);" "'" " $i: .9n3*n7,n;"Press 1 for ON, and 0 for OFF " 8i$=:i$=""62008 B$i$"0"i$"1"sd/n0,n:62008 Lip=i$-n:n3*n7,n;" ";n: Vct:"You have missed out an input to this gate, where should it come from?":xl=n1:xh=n4:cx=k+n1:cy=j:1200:p1,cx:p2,cy:in=fnz:l(in)=l(in)+n1:ct:BT: `)K=n1n3:j=n1n4:p1,k+n1:p2,j:t=fnz em(k,j,n1)=n6270~ jXm(k,j,n2)=n6230V:BT:m(k,j,n2)=in:s=in:pt=+n4-(n2m(k,j,n1)=n3):5000 tOm(k,j,n1)n3m(k,j,n3)=n6230V:m(k,j,n3)=in:s=in:pt=-n4:5000 ~j:k: select output lines /o(n1,n1)no(n2,n1)no(n3,n1)no(n4,n1)n 9o(n1,n1)no(n2,n1)no(n3,n1)no(n4,n1)n6330 ct:17,n;"Where do you want the lines intothe outputs to come from? First select an output, by usingcursor controls and then press enter.":xl=n5:xh=n5:cx=n5:cy=n1:bt:1200 o(cy,n1)nct:"This output is already being used. Remember there can only beone line into an output.":sd/n0,n:pk:6280 to=cy:ct:"Where should the output come from? Use cursor controls to select the position, then press enter." xl=n1:xh=n4:1200:p1,cx:p2,cy:in=fnz:inn6430:BT !l(i)>nm(x,y,n1)=n6500d  in0+n2  f(f,n1)=n yf(f,n2)nt=f(f,n1):s=f(f,n2):6550:6530:1;Y1,X1;" ";Y1+N1,X1;" ";YT,XT;" ";YT+N1,XT;" " yf(f,n3)nt=f(f,n1):s=f(f,n3):6550:6530:1;Y1,X1;" ";Y1+N1,X1;" ";YT,XT;" ";YT+N1,XT;" " f=f+n1:6580 23871?],40(:bt:23871?],104h:SD/15,30:ct:n9+n9,n;"Now I shall calculate the outputvalues." Ei=n1n4:k=i+i+(n3in2)+(n1in3)+(n3in4):l(i)>nk,n;i(i);" " i ;j=n1n3:k=n1n4:cx=j+N1:cy=k:m(J,cy,n1)=n67106 5m(j,k,n1)=n37000X:p1,in1:p3,n3:6670 `7000X:7040:IN2=(n1IN2n1):IN1=(n1IN1n1):p1,in1:p2,(n1IN2=n1):p3,m(j,k,n1)  OUT=FN I1350F:p=n8*x1:q=175-n8*y1:out=n1p+n6,q-n7:n2,n2:n,-n5 "out=np+n8,q-n7,n2 ,m(J,cy,n5)=out 6*k:SD/15,30+J+J:30:j @%o=n1n4:s=o(o,n1):s=n6760h JSn4OUT=I(S):6750^ T?p1,s:x2=fnx:p1,s:y2=fny:out=m(x2-N1,y2,n5):o(o,n2)=out ^=O(O,N1)NCY=O:CX=5:1350F:Y1,X1+1;OUT hO:SD/15,38&:wt: ,pk:ct:7740<:f(n1,n1)=n6950& |n0+n7,N;"Type F to try another set of initial feedback values, type I to try another set of inputs or type S to STOP." "F, I or S :";a$ a$n1sd/n0,n:6820 a$="F"6570 a$="I"6150 a$="S"700 +a$"F"a$"I"a$"S"sd/n0,n:6820 a$="F"6900 !MODE=n16630:6800 MODE=n38204 qct:n0+n7,n;"Would you like to give the inputs new values? Type I to set the inputs or C to continue." ,"I or C: ";a$:a$n1sd/n0,n:6910 a$="I"6150 $a$"I"a$"C"sd/n0,n:6910  6890 &nct:n0+n7,n;"Would you like to give the inputs new values? Type I to set the inputs, or S to stop." 0,"I or S: ";a$:a$n1sd/n0,n:69600 :a$="S"700 D a$="I"6150:6890 Nsd/n0,n:69600 X5I=M(J,K,n2):p1,i:x2=fnx:fb=x2cx:p1,i:y2=fny bfb=n1in1=m(x2-n1,y2,n4): lx2=n1in1=i(y2): vin1=m(x2-n1,y2,n5): 5I=M(J,K,n3):p1,i:x2=fnx:fb=x2cx:p1,i:y2=fny fb=n1in2=m(x2-n1,y2,n4): x2=n1in2=i(y2): in2=m(x2-n1,y2,n5): >N7::N7::N1:n:N,11 ;"MAKE A CHIP" <N3,N;"In the first part of the programyou learnt about gates - what they are called and under what conditions they are ON or OFF."''"In this part of the program we shall see how to join gates to make circuits, and what FEEDBACKis."''"The third part of the program iswhere you design your own circuits."  PK:CLS ڼN3,N5;" ";N4,N5;" ";N6,N5;"";N7,N5;"";n2,n5*n5;"in out";n1;n2,n5*n5;"_______";n3,n5*n5;"0 0";n4,n5*n5;"0 1";n5,n5*n5;"1 0";n6,n5*n5;"1 1":"","x":n,"%" n8,"":31,n:N0+N0:n8,"{":n8,n:n,n8+n8:23,n:N0+N0:n8+n8,"{":n,-n8:23,n:N0+N0:n4*n6,"":n,-n4*n6:n7+n8,n:N0:"8","":31,n:N0:"h","":n8+n8,n:N0:"8","x":n8*n8,n:N0 n9,n;"When we draw logic gates across the screen we work out their function from left to right."''"The computer works out each column of gates in one very small interval of time." pk:i=9 20:i,n;" ";n:i:N9,N;"In the first part we learnt thata NAND gate is really an AND gate followed by a NOT gate. Theabove circuit shows two outputs,one from a NAND gate, the other from a sequence of gates."  PK:i=n8n3*n7:i,n;" ";n:i n9,n;"Watch what happens to the outputof each gate for each set of input values. Note how the same values occur at both outputs."  PK:sd/15,30:n3,n;"0";n6,n;"0";4,7;"0";7,7;"1";3,15;"1";7,15;"1";3,29;"1 1":pk *sd/15,30:n3,n;"1";n6,n;"0";4,7;"0";7,7;"1";3,15;"1";7,15;"1";4,29;"1 1":pk 4qsd/15,n3*n0:n3,n;"0";n6,n;"1";n4,n7;"0";n7,n7;"1";n3,n0+n5;"1";n7,n0+n5;"1";n5,29;"1 1":pk >msd/15,n3*n0:n3,n;"1";n6,n;"1";n4,n7;"1";n7,n7;"0";n3,n0+n5;"0";n7,n0+n5;"0";n6,29;"0 0" RKPK:i=n8n3*n7:i,n;" ";n:i:n3,n;" ";n6,n;" ";n4,n7;" ";n7,n7;" ";n3,15;" ";n7,15;" ";n3,29;" ";n4,29;" ";n5,29;" ";n6,29;" ";n3,n5;"";n4,n5;"";n6,n5;"";n7,n5;"";n0,n;"Now we will see that a NOR gate is really the same as an OR gateand a NOT gate in series." \xPK:sd/15,30:n3,n;"0";n6,n;"0";n4,n7;"0";n7,n7;"1";n3,n0+n5;"1";n7,n0+n5;"1";n3,29;"1 1":pk fzsd/15,30:n3,n;"0";n6,n;"1";n4,n7;"1";n7,n7;"0";n3,15;"0";n7,15;"0";n4,29;"0 0":pk pzsd/15,30:n3,n;"1";n6,n;"0";n4,n7;"1";n7,n7;"0";n3,15;"0";n7,15;"0";n5,29;"0 0":pk zzsd/15,30:n3,n;"1";n6,n;"1";n4,n7;"1";n7,n7;"0";n3,15;"0";n7,15;"0";n6,29;"0 0":pk 9i=n821:i,n;" ";n:i:n3,n;" ";n6,n;" ";n4,n7;" ";n7,n7;" ";n3,15;" ";n7,15;" ";n3,29;" ";n4,29;" ";n5,29;" ";n6,29;" ";n3,n5;"";n4,n5;"";n6,n5;"";n7,n5;"";n3,25;" 0 ";n4,25;" 1 ";n5,25;" ";n6,25;" " 6n1;n8,123{:n1;n7,n:16,140:n,n7 on0,n;"Next, look what happens to the NAND gate when both inputs are the same.":pk:sd/15,30 Yn3,n;"0";n4,n7;"0";n7,n7;"1";n3,15;"1";n7,15;"1";n3,30;" 1":pk osd/15,30:n3,n;"1";n4,n7;"1";n7,n7;"0";n3,15;"0";n7,15;"0";n4,30;" 0":pk 14,n;"Do you recognise the pattern of the truth table?";:502:" The output is"'"equivalent to the output from a NOT gate. So we can make NOT gates from NAND gates - and alsowe can make AND gates (NAND thena NOT gate).":17,n:pk cls:"In part 1, we said all gates canbe made from a combination of NAND gates. We shall now see howwe can make an OR gate." on8,n6;"";n9,n6;"";11 ,n6;"";12 ,n6;"";n9,11 ;"";n0,11 ;"":n8,107k:39',0:32 ,107k:n,-n8:15,n:8,84T:39',n:32 ,84T:n,-n8:15,n:64@,104h:12 ,n:n,-5:11 ,n:64@,80P:12 ,n:n,n0:11 ,n:104h,96`:n8,n <n7+n7,n;"Watch what happens with various sets of inputs." ދn8,n5*n5;"in out";n1;n8,n5*n5;"_______";n9,n5*n5;"0 0";n0,n5*n5;"0 1";n0+n1,n5*n5;"1 0";n6*n2,n5*n5;"1 1":227,"H":n,"%" xpk:sd/15,n3*n0:n8,n;"0";n0+n1,n;"0";n9,n8;"1";n6*n2,n8;"1";n9,n3*n5;"0";n9,n5*n5;"0 0";n9,n3*n0;"0":pk dsd/15,n3*n0:n8,n;"1";n0+n1,n;"0";n9,n8;"0";n6*n2,n8;"1";n9,n3*n5;"1";n0,n3*n0;"1":pk gsd/15,n3*n0:n8,n;"0";n0+n1,n;"1";n9,n8;"1";n6*n2,n8;"0";n9,n0+n5;"1";n0+n1,n3*n0;"1":pk gsd/15,n3*n0:n8,n;"1";n0+n1,n;"1";n9,n8;"0";n6*n2,n8;"0";n9,n0+n5;"1";n6*n2,n3*n0;"1":pk qn0+n7,n;"Do you recognise the output pattern? This circuit is how anOR gate is made up of NAND gates":pk cls:"We are now going to find out about FEEDBACK."''"Feedback is a means of modifyingthe input to one gate as a result of a previous output fromanother gate,each gate being setduring a time cycle." '"To explain this, think of addingtwo numbers.":pk:15,n8;"5";16,n7;"+3";16,n7;1;"__";17,n7;"__":150:sd/15,30:17,n;n1;"Answer 8" wt:14,n0;"That was fairly easy.";15,n0;"Now we shall try to";16,n0;"add bigger numbers...":pk:15,n7;n;"15";16,n7;"+8";17,n7;" ";16,n7;1;"__";17,n7;"__";n;14,n0;" ";n;15,n0;" ";n;16,n0;" ";n (502:wt:wt:wt:sd/15,30:15,n0;" 5 plus 8 is 3 carry 1";17,8;1;"3";18,n;"carry 1":wt:n1:150:sd/15,30:16,n0;" 1 plus 1 (carry) is 2";17,n0;" with no carry.";17,n7;1;"2";18,6;"0"  .wt:wt:150:i=1520:i,n0;" ";n:i:14,11 ;"In each cycle of our";15,11 ;"'add machine', we add";16,11 ;"two values and the";17,11 ;"carry, which is a";18,11 ;"FEEDBACK from the";19,11 ;"previous cycle." "7pk:i=n020:i,n;" ";n:i:10 ,0; $''"Another example of a circuit with feedback is a BISTABLE. These can be used for registers and store in computers. They canhold, for another cycle, the previous output of a gate.":pk:cls .n3,n4;"";n4,n4;"";n5,n9;"";n6,n9;"":n8,140:23,n:n8,124|:63?,n:480,144:12 ,n:n,-13 :12 ,n:88X,128:23,n:89Y,128:n,28:-64@,n:n,-n8:n8,n 8n4,n;"S"''"R";n6,13 ;"Q";n2,1;"P";n3,16;"This circuit ";n4,16;"is a SET/RESET";n5,16;"bistable." Bon9,n;"When input S is set, the output Q is set on, and is fed back as signal P for the next cycle. Further cycles will leave Q on until the input R is set, at which time Q is reset to zero (and fed back as P). This will continue until S is set again. Sand R can't both be set together- but assume in the truth table that such situations set Q to zero." Lpk:i=9 20:i,n;" ";n:i:n9,n;" S R P Q";1;n9,n;" ________":557,32 :n,72H:1;n0,n;" 0 0 0"'" 0 1 0"'" 1 0 0"'" 1 1 0 0"'" 0 0 1"'" 0 1 1"'" 1 0 1"'" 1 1 1 0" QO15,14;"Now let's complete";16,14;"the truth table." Vpk:sd/15,30:n2,n2;"0":502:sd/20,35#:n5,n3;"0";n7,n8;"0":502:sd/20,36$:n4,n8;"1":502:sd/20,37%:n5,13 ;"0";n0,n8;"0" [Bpk:n2,n2;" ";n5,n3;" ";n7,n8;" ";n4,n8;" ";n5,13 ;" " `sd/15,30:n2,n2;"0":502:sd/20,35#:n5,n3;"0";n7,n8;"1":502:sd/20,36$:n4,n8;"1":502:sd/20,37%:n5,13 ;"0";11 ,n8;"0" eBpk:n2,n2;" ";n5,n3;" ";n7,n8;" ";n4,n8;" ";n5,13 ;" " jsd/15,30:n2,n2;"0":502:sd/20,35#:n5,n3;"1";n7,n8;"0":502:sd/20,36$:n4,n8;"0":502:sd/20,37%:n5,13 ;"1";12 ,n8;"1" oBpk:n2,n2;" ";n5,n3;" ";n7,n8;" ";n4,n8;" ";n5,13 ;" " tsd/15,30:n2,n2;"1":502:sd/20,35#:n5,n3;"0";n7,n8;"0":502:sd/20,36$:n4,n8;"0":502:sd/20,37%:n5,13 ;"1";14,n8;"1" yBpk:n2,n2;" ";n5,n3;" ";n7,n8;" ";n4,n8;" ";n5,13 ;" " ~sd/15,30:n2,n2;"1":502:sd/20,35#:n5,n3;"0";n7,n8;"1":502:sd/20,36$:n4,n8;"0":502:sd/20,37%:n5,13 ;"0";15,n8;"0" Bpk:n2,n2;" ";n5,n3;" ";n7,n8;" ";n4,n8;" ";n5,13 ;" " sd/15,30:n2,n2;"1":502:sd/20,35#:n5,n3;"1";n7,n8;"0":502:sd/20,36$:n4,n8;"0":502:sd/20,37%:n5,13 ;"1";16,n8;"1" Epk:cls:"In this section we have seen howto make a circuit from gates. Inreality you would do this with transistors, chips, bits of wireand solder."''"We have also seen how all the gates can be constructed by combining just one type of gate."''"Lastly we have looked at how we can make storage by using feed- back."  Ďcls:''"Do you want to continue with your old circuit or to start a new design?"''"Type O for your old circuit or N for a new circuit." ,"O or N :";a$:a$n1sd/n0,n:7630 |a$="N"OLD=N1:9000(#::i=sc+bt:n:n,n0+n1;"MAKE A CHIP";n1,n;5;"in <-----gates----> out": a$"O"sd/n0,n:7630 F(N0+N2,N3)::i=sc+bt:n:n,n0+n1;"MAKE A CHIP";n1,n;n5;"in <-----gates----> out":n:17,n;"Please wait while I remember anddraw your circuit." \j=n1n3:k=n1n4:g=m(j,k,n1):cx=j+1:cy=k:1350F:x=x1:y=y1:g=n7710  Q6520x:p1,cx:p2,cy:t=fnz:s=m(j,k,n2):pt=n2+(n2gn3):SN5000 ,gn3s=m(j,k,n3):pt=-n4:SN5000 Ck:j:o=n1n4:o(o,n1)nt=o+n4*n4:s=o(o,n1):pt=n2:5000 ( o:ct: 2 ct:"You already have a gate here! You can only change the gate to one with the SAME number of inputs.":sd/n0,n:pk:edit <n2,n;" ";n7,n;" ";n0,n;" ";15,n;" ";n2,30;" ";N3,30;" ";n7,31;" ";N8,30;" ";n0,31;" ";11 ,30;" ";15,31;" ";16,30;" " FVTEMP1=X:TEMP2=Y:X=13:Y=14:m(X,Y,1)=n7780d Psout=m(x,y,n5):cx=X+n1:cy=Y:1350F:p=n8*x1:q=175-n8*y1:out=n1n1;p+n6,q-n7:n1;n2,n2:n1;n,-n5 Zout=nn1;p+n8,q-n7,n2 dY:X:X=TEMP1:Y=TEMP2: @N7:N7:N1:::n,11 ;"MAKE A CHIP"''"Computer hardware is essentiallyquite simple,and can be thought of as five connecting elements." J''"These elements can be made from just one type of electronic circuit.The complex part of the computer being how these circuits are joined together." TX''"The next page shows a picture ofthe way a computer is made up ofthe five elements." ^pk:cls:n3,n0+n1;" MEMORY ";n4,n4+n0;"| |";n5,n2;" INPUT -> CONTROL -> OUTPUT ";n6,n0+n4;"| |";n7,n0;" PROCESS " h''"Process is a way of saying 'work'. The computer will work with the information held in itsmemory or the information that you have 'input'. There must bean 'output' so the computer can tell you what it has worked out.The control looks after what the computer is doing." rpk:cls:"Information is represented in a computer as a list of 1's and 0's. This type of representationis called binary. Binary is used a lot in computing because electronic circuits can only be ON or OFF." |''"The electric signals in the computer are either HIGH or LOW.A signal high represents 1, and low represents 0." _''"A binary digit is called a bit, and eight bits are referred to as a byte.":pk:cls "Electronic circuits contain"'"transistors. Common arrangementsof transistors are represented"'"symbolically by logic elements or gates in circuit diagrams." Z'"There are three basic logic"'"elements. They are called AND, OR and NOT."  '"Consider a car with a reversing light. For the reversing light to be on, the reversing light switch must be on whilst the ignition is on.In logic circuitswe can say the light will be ON when the ignition is ON AND the reversing light switch is ON.":r }an:n3,n;"ignition";n4,n;"switch";n6,15;"reversing";n7,16;"light";n0,n;"reversing";n0+n1,n;"light switch" `16,124|:32 ,n:16,107k:32 ,n:90Z,115s:16,n 13 ,n;"The symbol on the screen is called an AND gate, and is how we represent a logic AND in circuit drawings. The circuit will put the light (or output) ON if both inputs are set to ON." ̻pk:6050:n6,n2;l$;n8,n2;l$;n7,13 ;l$;13 ,n;"We will put a light at each of the inputs and outputs to see what happens when different logic values are input." n'"We will record the input and output combinations in a truth table, as shown next.":pk:6050 13 ,n;"ignition AND switch | light";13 ,n;n1;"_____________________________";n;n3;"OFF";15;"OFF | OFF"'n3;"OFF";15;"ON | OFF"'n3;"ON";15;"OFF | OFF"'n3;"ON";15;"ON | ON" ='"A truth table usually has 1 and 0 instead of ON and OFF." pk:6050:13 ,n;" means the light is on"''" means the light is off"''" means the light is waiting to be set.":pk:6050 13 ,n;"Set the inputs to the AND gate to see what values turn the reversing light ON."''"The computer will fill in a row in the truth table for each set of inputs you try.":pk:tr:e$="0000" 8ip2:i=in1in2:c,(lni=on)+(lfi=off):n7,14;i Lin1=onin2=one$(n4)="0"e$(n4)="1":n9,25;"1 1";n9,30;"1" Nin1=offin2=offe$(n1)="0"e$(n1)="1":n6,25;"0 0";n6,30;"0" &Min1=offin2=one$(n2)="0"e$(n2)="1":n7,25;"0 1";n7,30;"0" 0Min1=onin2=offe$(n3)="0"e$(n3)="1":n8,25;"1 0";n8,30;"0" :e$"1111"ip1:8200 Dr NE13 ,n;"Another type of gate is called an OR gate.":or X16,124|:37%,n:16,107k:37%,n:95_,115s:11 ,n:n4,n;"switch1";n7,13 ;" light";n0,n;"switch2" b16,0;"We could use an OR gate for a light which has two switches. The light would be on if EITHER switch 1 OR switch 2 is on." llpk:6050:13 ,n;"Now set the inputs and see what happens to the output and to thetruth table." v$n6,n2;l$;n8,n2;l$:tr:e$="0000" 8ip2:i=in1in2:c,(lni=on)+(lfi=off):n7,14;i Lin1=onin2=one$(n4)="0"e$(n4)="1":n9,25;"1 1";n9,30;"1" Nin1=offin2=offe$(n1)="0"e$(n1)="1":n6,25;"0 0";n6,30;"0" Min1=offin2=one$(n2)="0"e$(n2)="1":n7,25;"0 1";n7,30;"1" Min1=onin2=offe$(n3)="0"e$(n3)="1":n8,25;"1 0";n8,30;"1" e$"1111"ip1:8320 r Ɩ13 ,n;"We shall now look at a gate withonly one input. The output is always the opposite of the input. We call this a NOT gate." cwt:nt:84T,115s:21,n:16,116t:32 ,n:n7,n2;l$;n7,13 ;l$ d=22754X:tr:e$="00" gd,set:ib:in=ip:d,(lnin=on)+(lfin=off):n7,n1;in:wt:c,(lnin=off)+(lfin=on):n7,14;in Cin=on e$(n1)="0"e$(n1)="1":n8,26;"1";n8,30;"0" Din=off e$(n2)="0"e$(n2)="1":n7,26;"0";n7,30;"1" !Ne$"11"wt:n0:pk:wt:c,568:n7,n1;" ";n7,14;" ":8420 ! r !"Sometimes we wish to use a NOT gate just after an AND or an OR gate. To do this we just draw the small circle from the NOT gate where we wish the NOT gate to go." ! ''"When the NOT gate is immediatelyafter the AND gate we call it a NAND. When the NOT is after the OR gate we call it a NOR gate." !*l''"NAND and NOR gates are very easyto construct and all other gatescan be made by combining NAND gates." !4rpk:cls:na:13 ,n;"This is how a NAND gate is drawnNow try and complete the truth table.":tr:e$="0000" !>16,124|:32 ,n:16,107k:32 ,n:94^,115s:n9,n:n6,n2;l$;n8,n2;l$;n7,13 ;l$ !H;ip2:i=(in1in2):c,(lni=on)+(lfi=off):n7,14;i !RLin1=onin2=one$(n4)="0"e$(n4)="1":n9,25;"1 1";n9,30;"0" !\Nin1=offin2=offe$(n1)="0"e$(n1)="1":n6,25;"0 0";n6,30;"1" !fMin1=offin2=one$(n2)="0"e$(n2)="1":n7,25;"0 1";n7,30;"1" !pMin1=onin2=offe$(n3)="0"e$(n3)="1":n8,25;"1 0";n8,30;"1" !ze$"1111"ip1:8520H! !r !13 ,n;"The last gate we shall look at is called NOR. This is an OR gate followed by a NOT gate."''"Try and complete the truth tableby setting the inputs to the gate." !nr:wt:16,124|:35#,n:16,107k:35#,n:99c,115s:n4,n:n6,n2;l$;n8,n2;l$;n7,13 ;l$:tr:e$="0000" !;ip2:i=(in1in2):c,(lni=on)+(lfi=off):n7,14;i !Lin1=onin2=one$(n4)="0"e$(n4)="1":n9,25;"1 1";n9,30;"0" !Nin1=offin2=offe$(n1)="0"e$(n1)="1":n6,25;"0 0";n6,30;"1" !Min1=offin2=one$(n2)="0"e$(n2)="1":n7,25;"0 1";n7,30;"0" !Min1=onin2=offe$(n3)="0"e$(n3)="1":n8,25;"1 0";n8,30;"0" !e$"1111"ip1:8610! !r #(c(N7*N2):c(n1)=n1:c(n2)=n9:c(n3)=n0+n7:c(n4)=n5*n5:c(n5)="!":c(n6)=")":c(n7)=n1:c(n8)=n5:c(n9)="9":c(n0)="=":c(n0+n1)="A":c(n6+n6)="I":c(n6+n7)="Q":c(n7*n2)="Y" #2rd=n0:old=n:p1=23762\:p2=p1+n1:bt=p2+n1:fnx=bt+n3:fny=fnx+n3:fnz=fny+n3:fnc=fnz+n3:p3=fnc+n3:fn=p3+n1:sc=fn+n3 #<5m(n3,n4,n5):o(n4,n2):i(n4):l(n0+n6):f(n0+n2,n3) #F@23658j\,n8:b("\"):ffb=n5*n5:fbb=n1:fob=n1:fib="A" #Zs$(n9,n4):s$(n1)="AND":s$(n2)="OR":s$(n3)="NOT":s$(n4)="NAND":s$(n5)="NOR":s$(n6)="STOP":s$(n7)="OUT":S$(N8)="COPY":S$(N9)="NEW" #d,B$(N4*N4,N3):I=N1N4*N4:B$(I)="000":I: 't0:a=0:b=16:b,a;:"""a",168:b,a;:b,a;:""g():b,a;:""t():B=20:1 ' :a=0:b=20:b,A;"SAVING - do not turn tape off ":"PART 2"9980&:"PART 3""a",168:"PART 4"g():"PART 5"t() ' .5,10 'b(n0*((23641Y\+256*23642Z\)-(23635S\+256*23636T\))/n2^n0)/n0;"K" n l\\\n\n\n\n\\\\fbo1iAfe<:abcXdi}\~\g|pzprpl.@N n!!nndXFFgtsf58YE1111G22!2)hn5p@qwv@dbcAsuempempASI pX0PpPXP0PpX0pX0pX0\}}}=EKAGCI?=EKAGCI?=EKAGCI?]TZW5,#2) /&ulcri`ofI !)159=AIQY3-S \) AND OR NOT NANDNOR STOPOUT COPYNEW 5000000000000000000000000000000000000000000000000LN1.PART 3 X_ת||((FA ` AF`00  00FA ` AF`PART 4 X_pX0PpPXP0PpX0pX0pX0kPART 5 X_\}}}=EKAGCI?=EKAGCI?=EKAGCI?]TZW5,#2) /&ulcri`of