:
. , 2011.
:
--
:
.
30
,
,
Pascal, . :
. , .
,
.
,
,
"
"
:
, -
,
,
.
,
,
, ,
-
,
".
,
, -...
14 downloads
227 Views
6MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
:
. , 2011.
:
--
:
.
30
,
,
Pascal, . :
. , .
,
.
,
,
"
"
:
, -
,
,
.
,
,
, ,
-
,
".
,
, --
,
. ,
. ,
,
,
. : ,
,
,
,
.
,
, ,
,
. :
1.
,
.
2.
.
3.
, .
4. . 5. .
: PRESSI ( HERSON )
,
, .
--
.
,
.
,
( ). ,
.
. ,
,
,
!
,
, .
. (
. 3.2, 3.4
3.5).
. (
)
(
).
(
"
"
--
).
0. 1.
. (
,
, )
. ,
,
,
(
),
. 1).
(
220
,
,
, (
. )
,9 , .
;
)
.
1
.
. 1.
. 9 - 12 ( . 2:
,
,
10).
. ),
( . ,
.
, .
,
,
.
. 2.
: PRESSI ( HERSON )
.
,
,
.
.
, : .
. 3.
.
100
). 2.
. 3. .
(
. ?
, .
,
.
, .
.
,
, ,
. 4.
. . 4. 20 - 200
. .
, ,
. ,
. .
1.1.
,
1. ,
,
.
, ,
.
. 1.
.
.
(
: PRESSI ( HERSON )
) , $f=50$ .
. 1.2
. . 1.1)
( . ,
.
,
.
R.
. L,
C,
R. .
--
,
.
(
. 1.3)
.
,
. 2.
.
.2
, 242 . 200
0,16
25
.
2.
. 220
12 .
,
- U,
U
5 - 15
.
: PRESSI ( HERSON )
.
;
+5 : + U,
.
. 3.
220
5 .
, ,
8 - 12
,
405 .
C1
,
. .
VD2 R1
VD2
+15
5
,
VD2
,
C2 16 . R1
, .
-15 220
1
.
18 - 25
.
15
.
.
,
2 156
, ,
,
,
. .
3.
. ---
. PJ7805 ( )
,
,
.
.
4.1.
:1,2-
5
,310 - 12 ,
.
(
. 4.1). , (
0,5 - 1
R1),
.
. 4. . 4.2
. 142
:1-
. ,
12 .
1,5
,2-
,
,31,2
R2.
37 R1
. .
40
1
,
. 4.
.
,
, +5
, 9
. 5.
, -5
.
: PRESSI ( HERSON )
. ,
T1
,
,
405 . . .
C1 - C4
. 5.
.
2.
,
...
1.
. ,
p-n-p ( ,
: 1)
-
,
n,
n-p-n (
-
).
); 2)
p,
, ? .
p-n-p-
p-n,
.
, , . .
, , 3-5
.1 .
,
0,5 - 1 .
. ,
. 1.
p-n-
. . p-n-p
.
n-p-n
.
. p-n-
,
2. ---
.
.
,
.
. (n-p-nR3
)
. 2.
602 .
--
,
,
. 2.
.
. .
10
,
(
). 9
: PRESSI ( HERSON )
, .
,
,
, ,
,
.
R3 ,
R1,
. 3.
( ,
0,01
).
.
,
. .
, (
. )
.
. 3.
.
3.
. 4 .
134, ) 100--220 . . 0,5 - 1
.
,
, , --
. .
,
--
: ---
,
.
,
. . ,
.
, --
. 4.
.
. 4.
. S1. R1.
1
,
,
.
.
,
.
3. 1.
.
,
?
,
: PRESSI ( HERSON )
,
?
. ,
t1,
,
.
t2
.
. 1.
,
. --12.
,
,
,
. 1.1).
. ,
.
. 1.2. , . ,
.
. )
, .
,
R2
, . 2.
. 2. 2.
.
.
, 220
,
100
.
. .
,
,
.
,
. 30 - 60
. (
3.
.
,
.
),
, -1
,
,
:
. .
: PRESSI ( HERSON )
R2
,
,
,
.
,
, 1-5 ,
. R2.
4.
.
:
. (
.
VT1
VD2 VD1. R2 R1
. VD2
,
,
,
VT1
,
. .
. 3.
. R1
,
VT1
VD2.
R5 1
,
. 3),
,
,
103
, . ,
,
5,6 . PC817.
PC817
.
: 50 35 ,
,
50 ,
. ,
.
.
, .
, ,
,
, R2.
C1
:
.
. 4.
. 4.
.
4. 1.
. , ,
. (
, (
: PRESSI ( HERSON )
). ,
).
. 1.
. ,
. 1. .
,
. R2, . AB, B
C(
---
,
--
(
A(
),
:
---
VT2 (
( n-p-n.
.
. 2. VT1
,
R1
-
(
2.
.
,
).
D).
,
).
VT1, C1
).
R2
, , ,
C3 .
,
).
VT3.
. 180
.
. 2.
. VD1
,
VT2, 2
VT2
B.
, VT3
.
. VT3
A
VT2
,
A VD1
, VT2
.
(
,
(
B)
VT3,
, B) , ,
.
1
. 3.
. , C1
(
C3
)
544 . . R2/R1
1000.
DA2
: PRESSI ( HERSON )
. ,
. R2 R4 C2 C4
R4/R3 .
. 3.
.
5. 1. -p-n-p-n (
. --
.
(
-
), )
.
---
.
. 1.
. --
), 2-5 ,
, 20 - 100 C1 R1.
( (
102
( ( . 1.1). 1 - 10
. (
. 1.2).
)
;
11
),
,
, . . R
C
,
=RC, ,
.
, .
, ,
. 2.
,
.
, .
. 2.
,
.
,
.
.
,
,
.2
.
, . 3. RC--
,
, . ( RC-
: PRESSI ( HERSON )
).
, ,
60 .
, .
180
.
,
. 3.
RC-
. ,
,
. .
50 - 200 ,
.
--
,
, , (
. 3).
, .
;
. 3. 4.
.
(
.
. 4)
,
.
=3,14,
, ,
,
2 .
. , .
. 4. (
. 4) (
. p-n-p),
. VT1
C1
R2. ,
VT1
C2
,
C2 VT1, R3,
. VT2
C1, C2 .
: PRESSI ( HERSON )
.
.
,
VT2 VT2
. . VT1,
R2, R3,
. 4.
. VT2 VT2
) ( .
),
C3
.
5.
. (
,
. 5)
(
(
C1.
(p-n-pVT2
),
VT2)
VT1) .
VT1 .
(n-p-n-
),
.
. 5.
.
C1 R1 . , --
R2 ( VT1 .
VT2 VT1
, ),
VT1
, VT2
,
. ,
R1, R2 , ,
VT2 ( VT1 VT2. .
=(R1+R2)C1. .
R1 .
C1
). ,
C1
, 1
VT1
. 6.
,
25
. 6. 21.
.
1.6.
: PRESSI ( HERSON )
1.
. . R1
.1. ,
U1 3
2 1
, R2 DA1.
R3.
U
U 3
U ,
.
U1,
.
R1
, 1
,
.
. 1.
. R3, .
, . (
, ),
R3. 2.
. , wi ,
.
,
. ,
, 1.
.
, -----
, .
. 2.
.
. 2.
2 , (
S2
DA1 (
S3)
S1).
3. R4. R6.
R1
( S1 - S3.
1)
,
) .
R7, R2 (
1.7. 1.
. 1000 220
?
,
. 1.
: PRESSI ( HERSON )
1
.
R6, R3 .0
. 1.
. ,
,
1,4 x 250=350
.
.
250
,
700 . C2, C3, C4.
C1 350 ).
C5
1500
4
.
. 2.
. ?-
-
?
,
.-
,
.
?-
? ,
100
.
10
, 1000
.
, ,
, 100
). ,
.
-
. 2. - 110
15
-
. VT1. .
3- 7,
VD1 - VD4 .
4
. 2.
.
. ,
. .
,
1 - 33
.
1-3 2
.
: PRESSI ( HERSON )
,
1000 , . 3.
. 3.
.
2.1.
155
1.
" ". :
"2 -,
--- 14. 1
3
". " ", "
155 3 "( . 1).
--- 7,
2,
. 200
3 . 1 (y=1). . 0 (y=0).
3
, -- 1, --- 8, : 14
. +5
",
-- 2, ... , --- 9, ... , +5 3
,7
. 1,
(x=1). .0(
,
,
),
.
?
?
. 1. ".
155
. 1 (x1=1), 3 (y)? ,
(x2=0). . " -2.
"
RS--
.
,
. ,
, RS-: S --- set
). . 0,
--
. 1,
,
.
. .
. 2, .
: PRESSI ( HERSON )
.0
.
---
2 --
1 3.
2 ---
"2 ". " ",
" ".
( . 1.2). ), R --- reset ( .1
. "2 -
3 1
.
3.
, ,
C1
R1
.
. 2.
.
T,
f=1/T.
T
=R1C1.
2.2. 1.
. ,
. ,
.
,
.
,
.
. 1.
50
,
.
.1 --
.
561
1
,
, 3
15
50 . , , 0,25
.
-19).
.
2.
.
D-
, .
,
. 2. (
561 5) 155 2). VD1.
D1
2
(
-
,
D.0
,
.
, S1
. DD2.1
. 2.
. 1.
. S1,
1
.
VD2 - VD5, -
.1.
, : 1000 -> 0100 -> 0010 -> 0001
: PRESSI ( HERSON )
.
.
n
2 ,
n
---
n
2-n.
. (First Input First Output --, FILO (First Input Last Output --). 3. 155
C3C2C1C0. , L-8131D 4,5 .
,
. , --
SA2, SA3
)
FIFO
3
, ,
(
. . 3).
HL1, HL2, HL3 A2A1A0, SA4, SA5, SA6 HL4, HL5, HL6 B2B1B0 HL7, HL8, HL9, HL10 307 , . --
SA1,
-35- -
. 3.
. ,
101
110,
. 4). ,
, ,
(
,
1. , 101 1011.
,
110,
, .
: PRESSI ( HERSON )
. 4.
.
4.
88
.
.
561
,
2,
. ,
1
0. 2, 3, 4 LPT-
(
. 5.
, 11
).
8
.
3
LPT-
.
-1. 0, 1, 2, ..., 8. .
9
"
"
.
.
0
1.
2.3. 1.
. .
14,
12)
8(
VD1 - VD4.
: PRESSI ( HERSON )
C1
155
5
2( 9, 8, 11).
1, S1.
. 1.
. S1 0
,
1,
, 0100, ... , 1110, 1111. .
. 2. 2.
. 3)
HG2.
. DD3, DD4
. . : 0000, 0001, 0010, 0011, 16
. --
DD1 x
DD2, HG1 ,
(
12, 9, 8, 11) ,
2 =8 (
DD3, HG1.
11) .
S1 HG1
.
10,
3
DD1
. DD2,
DD1
HG2
DD2,
. :
: PRESSI ( HERSON )
., .
.
. 3.
.
3.1. 1.
LPT-
.
---
, LPT--
,
.
,
. LPT--
,
25
2-9
--- 8
:1
,
---
"
",
(
10-17
10-17 ---
(
, 18-25
.). ).
1
, 1
, ,
,
,
,
LPT--
,
37916=88910. 37816=88810.
Borland Pascal 7.0
,
1
.0
2-9
1.
,
,
MS--DOS QBasic 1.0. QBasic 37916=88910 x=INP(&H379) x=INP(889). OUT &H378, 123 OUT 888, 63. Pascal : Port[888]:=212; Port[378]:=12; --212 12 88810; x:=Port[889]; x:=Port[379]; --88910 x. 2.
. 2
-. 1.1).
LPT (
11
25)
1,
37916 01111111 (127), x=INP(&H379). LPT--
11111111 (255). LPT 0.
, ,
37916
--
WHILE INKEY = "": PRINT INP(&H379); : WEND
: PRESSI ( HERSON )
1
. :
127,
"1".
, -- 1
? .
2, CLS : WHILE WHILE 1 WHILE 2 WEND END
,x "0".
.
1, 127,
---
x = INP(&H379) ' - 1 INKEY$ = "" 'QBASIC x 127: x = INP(&H379): PRINT "1"; : WEND ' x = 127: x = INP(&H379): PRINT "0"; : WEND
-- 2 ".
1,
,x
. (
'
.
1),
--
T0
, 2,
".
, --
T
.
T-T0,
.
,
.
CLS : x = INP(&H379) WHILE x = 127: x = INP(&H379): PRINT " WEND : T0 = TIMER WHILE x 127: x = INP(&H379): PRINT " WEND: T = TIMER: PRINT " END
,
' - 2 'QBASIC ' 1
"
" ", T - T0
-- 3 ,
'
2
. 5-20 , .
. CLS : x = INP(&H379) WHILE x = 127
' - 3 'QBASIC
x = INP(&H379): PRINT " ": WEND t0 = TIMER WHILE x 127 x = INP(&H379): PRINT " ": WEND WHILE x = 127 x = INP(&H379): PRINT " ": WEND t = TIMER: PRINT " ", t - t0 END
'
1
'
2
'
3
. 1.
.
3.
.
1, 3, . 1.2).
:
0
1
4
2
. ,
37816 .1
3 2-9
25
. LPT.
255,
. ,
( 1
2.
. 1.2),
,
LPT LPT
2, ,
.
-- 4 111111112=255,
1 011111112=127, "0". ,
OUT &H378, 255 WHILE INKEY$ = "" : x = INP(&H379) WHILE x 127: x = INP(&H379): PRINT "1";
: PRESSI ( HERSON )
LPT-. "1".
' - 4 'QBASIC ' 1
WEND : t0 = TIMER WHILE x = 127: x = INP(&H379): PRINT "0"; WEND: t = TIMER: PRINT t - t0 WEND: END
'
2
. -- 4,
PRINT "1". 2.
2
PRINT "0"
1,
T0
.
, T
.
T-T0
, .
,
,
. .
,
T0 ,
T.
T-T0
.
,
,
. 3.
.
, (
. 2.1).
. ,
LPT--
, (
, 155 3, . 2.2).
, )
t(
, . .
,
,
,
. ,1
. 2.
.
-- 5 ; LPT-dt
.
1, dt.
, .
,
M. dt
,
. SCREEN 2 ' - 5 LINE (10,180)-(640,180): LINE (10,0)-(10,480) 'QBASIC OUT (888), 255: M = .2 WHILE INKEY$ = "" n = 0: dt = 1: t0 = TIMER: t = t0 +.01 WHILE t - t0 < dt x = INP(889): 'PRINT " x= ", x; IF (y = 127) AND (x 127) THEN n = n + 1 y = x: t = TIMER WEND: n = M * (n - 80): tt = tt + dt LINE (10+tt*5, 180-n/dt)-(10+(tt-dt)*5, 180-nn/dt) nn = n: 'PRINT " ", n / dt; WEND END
3.2.
1.
. .
LPT--
: PRESSI ( HERSON )
--
. OUT { }, { Pascal --- port[{
(
37816=88810 LPT-, .0 }( }]:= {
x 1,
QBasic , OUT &H378, 25), }( , port[888]:=134).
-. 1,
0
( k+1
. 1,
(
). . 1). 255, , x
,
k-
. 1) 2
, ,
.
x. . ,
, R17
C1.
. 1.
. ,
: 0, 0,
0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255 ... x 0 255, 0, 0 255 . , MP3-QBasic, LPT--
.
. .
--1.
,
.
0, 127, 255, 0, 127, 255 .
.
,
WHILE INKEY$ = "" ' - 1 OUT &H378, 255 'QBASIC FOR i = 1 TO 500: PRINT "255": NEXT OUT &H378, 127 FOR i = 1 TO 500: PRINT "127": NEXT OUT &H378, 0 : FOR i = 1 TO 500: PRINT "0": NEXT WEND 2. .
, 0,1 - 1 c ( ,
--2).
.
. WHILE INKEY$ = "" OUT &H378, 255 FOR i = 1 TO 100: PRINT "255": NEXT OUT &H378, 0 FOR i = 1 TO 200: PRINT "0": NEXT WEND --2
' - 2 'QBASIC
,
. , 378_{16}=888_{10} 0, 1, 2, 3, ..., 255, 0, 1, 2, ... ( . --3). , 2-3 . ,
: PRESSI ( HERSON )
. ,
, C1. Borland Pascal 7.0. --3,
. .
uses crt, dos; var i: integer; BEGIN Repeat For i:=1 to 255 do begin port[888]:=i; write(i,' '); delay(10); end; until KeyPressed; END. --4,
.
' - 3 'PASCAL
.
. .
uses crt, dos; var i: integer; ' - 4 BEGIN 'PASCAL Repeat i:=i+1; port[888]:=round(127+127*sin(i/100)); until KeyPressed; END. s='101...11'. -A2.
( A1,
--5),
: ---
uses crt, dos; ' - 5 var i: integer; x,s: string; A,k: integer; 'PASCAL BEGIN clrscr; s:='101010101011001101101010011101010101001010101110011'; For i:=1 to length(s) do begin x:=copy(s,i,1); If x='1' then A:=127 else A:=30; writeln(x); k:=0; repeat inc(k); port[888]:=round(127+A*sin(k/10)); until (k>1000)or(keypressed);
end; END. --6),
,
s='101...11'. --
: ---
1,
2.
uses crt, dos; ' - 6 var i: integer; x,s: string; 'PASCAL W,k: integer; begin clrscr; s:='101011110101010110101010011101010101001010101110011'; For i:=1 to length(s) do begin x:=copy(s,i,1); If x='1' then W:=1 else W:=2; writeln(x); k:=0; repeat inc(k); port[888]:=round(127+127*sin(W*k/30)); until (k>10000)or(keypressed); end; end. 3.
. --
(
).
,
.
f
f
.
f, 11
. 2.
: PRESSI ( HERSON )
LPT--
.
.
.
. 2. VD1, 2--4
R4
,
.
C1 3
DA1,
.
2
. ,
. --7.
, x
x.
1,
1.
x ,
, .
uses crt, graph; -7 var DV, MV, EC, u, uu, x, time: integer; F: text; 'PASCAL Procedure GraphInit; begin DV:=Detect; InitGraph(DV,MV,'c:\bp\bgi'); EC:=GraphResult; if ECgrOK then Halt(1); end; BEGIN Assign(F,'c:\bp\data.txt'); Rewrite(F); GraphInit; repeat x:=0; repeat uu:=u; u:=port[889]; delay(15); if u127 then x:=x+1; until (uu=127)and(u127); time:=time+1; circle(3*time,400-x*1,1); circle(3*time,400-x*1,2); WriteLn(F, x); if 3*time>640 then begin time:=0; cleardevice; end; until Keypressed; CloseGraph;Close(F); End.
,
, $\approx$ 2--4
.
,
0--10 , .
, 500
10--100 .
,
.
,
2.
(
),
.
, .
,
.
. 3.
, . 3.
LM393N, U
.
2
DA1.
3
C1, 3 .0 VT1 VT2, ,
C1 0
2, . 1. VT2.
C2 ,
.
1
U .
VT3. . 4.
: PRESSI ( HERSON )
LPT-
1
C1 C3 1 DA1
C1
R3.
R3.
,
. DA1
. 4.
-
500
33
.
0,2
;
9
.
, , .
: 1)
k=10
,
. 2)
k ,
3)
t.
:
.
k t.
,
, --
:
,
,
k+1
.
4
).
,
uses crt, dos; var i,j,x,xx,t: longint; k: integer; begin clrscr; repeat inc(t); xx:=x; x:=port[889]; {delay(1);}
t t,
if (x=127)and(xx=63) then k:=k+1; if (t>20000)and(x=127)and(xx=63) then begin writeln('vremya ',t/k); t:=0; k:=1; end; until keypressed; end. 4.
555. 555.
. 5. 0,5
, ,
.
5
10
. 5.
.
555. 15
. 0
15
,
.
3.3.
1. LPT,
,
.0 .1 37816=88810 OUT { OUT &H378, 15
: PRESSI ( HERSON )
. . . }, {
}.
.
37816 .1,
000011112.
2, 3, 4, 5 LPT----
.0.
. 1.
LPT-
, . 29.1). 000000012 6410=010000002, 1510=000011112, -- 1
8
37816 , .
,
WHILE INKEY$ = "" x = 0 : OUT &H378, x = 1 : OUT &H378, x = 2 : OUT &H378, x = 4 : OUT &H378, x = 8 : OUT &H378, x = 16: OUT &H378, x = 32: OUT &H378,
110= .
QBasic.
. .
.
, --. x: x: x: x: x: x: x:
GOSUB GOSUB GOSUB GOSUB GOSUB GOSUB GOSUB
10 10 10 10 10 10 10
' - 1 'QBASIC
x = 64: OUT &H378, x: GOSUB 10 x =128: OUT &H378, x: GOSUB 10 WEND '======= ========= 10 FOR i = 1 TO 200: PRINT x: NEXT: RETURN ,
)
; )
,
; ) .
; ) -- 1
: )
,
,
); )
,
); ) ,
; ;
; )
, ,
.(
.( ;
,
,
.
3.4. 1. .
, ;
(
LPT-
. 1.2). .
.
. 1.
.
: PRESSI ( HERSON )
-1, (
---
),
. 1.1.
.
-,
,
.
,
uses crt, dos, graph; {Borland Pascal 7.0} var Gd,Gm,i,k,n,kx,ky,r,r1,s,porog: integer; t: longint; osv,osv1,osv2: real; BEGIN Randomize; porog:=200; Gd:=Detect; InitGraph(Gd,Gm,'c:/bp/bgi'); Repeat Repeat t:=t+1; r1:=r; r:=port[889]; If (r=127)and(r1127) then k:=k+1; until (t>100000)and(r=127)and(r1127); osv2:=osv1; osv1:=osv; osv:=t/k; t:=0; k:=1; {writeln(osv,' ',t,' ',k);} If n>640 then begin n:=0; cleardevice; end; If n>200 then porog:=500; setcolor(white); line(n,480-round(osv/2),n-1,480-round(osv1/2)); circle(n,480-round(osv/2),2); If osv<porog then setcolor(white) else setcolor(black); s:=abs(round((osv2-porog)/10)); n:=n+2; For i:=1 to s do circle(random(100),random(100),5); until KeyPressed; END. ,
. 0
100000.
,
.
, osv=t/k .
k, t
s
s
osv ) porog: s=|osv-porog|/10. osv1
osv2.
. porog
200
500.
, ).
(
,
.
IBM PC 486D2X. .2 . , .
.
.
.
. 2.
. 4
: PRESSI ( HERSON )
,
. ,
: (
, .
).
:
,
. 2.
,
. . .
,
, .
, (
,
.
, )
. .
. 3.
,
. . (
uses crt, dos,graph;
,
. 3).
var Gd,Gm,i,k,n,kx,ky,r,r1,s,porog: integer; t: longint; osv,osv1,osv2: real; BEGIN kx:=640; porog:=300; Gd:=Detect; InitGraph(Gd,Gm,'c:/bp/bgi'); Repeat t:=0; k:=1; inc(n); Repeat inc(t); r1:=r; r:=port[889]; If (r=127)and(r1127) then k:=k+1; until (t>2000)and((r=127)and(r1127)); osv1:=osv; osv:=t/k; If osv<porog then begin dec(kx); delay(1); line(kx,0,kx,100); end; If osv>porog then begin setcolor(black); repeat line(kx,0,kx,100); inc(kx); delay(1); until kx>640; setcolor(white); end; circle(round(n/10),250-round((640-kx)/5),1); line(round(n/10),470-round(osv/2), round((n-1)/10),470-round(osv1/2)); until KeyPressed; END.
3.5.
--
( .
).
, ,
(
).
.
LPT-( 1.
,
( ,
,
,
,
).
, ) .
,
: PRESSI ( HERSON )
. 7,
LPT-2,
3
6
.1.1).
,
3
,
,
. 1.2.
5
.
,
.
. 1.
.
,
, .
. LPT--
,
,
.
,
. ,
: ,
,
,
. .
, ,
--1. .
, ,
.
. , 50,
100 . 1 : CLS : OUT &H378, 4: k = 0 ' -1 WHILE k < 120: x = INP(&H379): PRINT x; 'QBASIC IF (x = 119) AND (y = 127) THEN k = k + 1 y = x: PRINT k: WEND: OUT &H378, 5 FOR i = 1000 TO 500 STEP -20 SOUND i, i / 300: NEXT k = 0: OUT &H378, 4 WHILE k < 250: x = INP(&H379): PRINT x; IF (x = 119) AND (y = 127) THEN k = k + 1 y = x: PRINT k: WEND OUT &H378, 5: SOUND 500, 10 FOR i = 1 TO 1500: PRINT " ": NEXT: GOTO 1 END , . . 2. . , .
(
) ) ,
, 0.
,
, 0.
, 16
, . .
,
LPT-
.
, ,
: PRESSI ( HERSON )
Borland Pascal 7.0.
,
T, ). 0
T. (
. 2).
, ( , ,
,
. 2.1, 2.2). 0
T. 0.
. 2.
.
: PRESSI ( HERSON )
. 2.1 ,
,
. , t.
T ,
(
. 2.2).
,
, . .
. 2.3
,
(t) t1, t2, t3, , 0.
03
T(t)
T, 02,
.
3.
.
LPT-
.
, ,
. 3).
,
, 5
,
.
. 3.
. -2 port[888]:=255; (
. 0)
1(
0)
2--9
LPT--
1
. .
. 0,05
.
. . 3)
(
x[i] (
,
sredn) .
uses crt, graph; const n=200; m=5; ' -2 var x: array [0..N] of integer; 'PASCAL s, sredn, Gd, Gm, i, z: integer; BEGIN Gd:=Detect; InitGraph(Gd,Gm, 'c:\bp\bgi'); if graphResult grOk then Halt(1); port[$226]:=1; delay(10); port[$226]:=0; Repeat {Repeat port[$22C]:=$20; until port[$22A]-127>5;} port[888]:=255; delay(15); port[888]:=0; delay(15); port[888]:=255; delay(15); port[888]:=0; s:=0; for i:=1 to n do begin port[$22C]:=$20; x[i]:=(port[$22A]-127); delay(1); s:=s+x[i]; end; sredn:=round(s/n); for i:=1 to n do begin circle(m*i,240-x[i]+sredn,2); line(m*i,240-x[i]+sredn, m*(i-1),240-z+sredn); z:=x[i]; end; delay(3000); cleardevice; until KeyPressed; END. 3.
. . ,
0,2 x=x(t). ,
: PRESSI ( HERSON )
(
5
)
( )
11
LPT-
. 3
,
,
LPT-
. .
,
11
LPT-
,
, ,
.
, (
),
,
. 888
3
.
LPT--
1,
.
1
xx[i]
889
. ,
1,
xx[i]. . 100 , cleardevice;). KeyPressed;
( --3). 210= 000000102
xx[i]
889. 2,
delay(100); ( Repeat ... untill ,
. uses crt,graph; var t,DV, MV, EC, x, y, k, time, i :integer; 'PASCAL xx : array[1..1200] of integer; Begin DV:=Detect; InitGraph(DV,MV,'c:\bp\bgi'); EC:=GraphResult; if ECgrOK then Halt(1); end; repeat { } port[888]:=2; delay(2); port[888]:=0; { }
'
-3
for i:=1 to 1200 do xx[i]:=port[889]; { 1} for i:=1 to 1200 do begin { 2} if xx[i]1000; x:=(t-20000)/8+350; v:=(x2-x)/4; inc(time); Line(round(time),round(x),round(time-1),round(x1)); Line(round(x1),round(200+v*10),round(x2),round(200+v1*10) ); x2:=x1; x1:=x; v1:=v; x1:=x; If time>640 then begin cleardevice; time:=0; end;
until KeyPressed; CloseGraph; end.
. 2.
. .
. 3.1)
(
. 3.3). .
. 3.2),
.
25
,
,
160
, 6,
3
0,5 -- 2
( 7
2, 4 10
.
: PRESSI ( HERSON )
.
. 3.4). 1
, ( . 3.5). . 1.2.
.
4
5, 6,
, 1
. 3.
(
).
2.
. , 1,
(
. 4.1).
2, 6
7.
3 4
, 5. 9. . 4.2. ,
8
LPT --
4 ,
, ).
. 4.
.
,
10
.
.
. ,
,
.
. ,
(
.5
,
6).
:
,
;
.
- 2. , . 5.2). , ,
,
. 15
280
3
5 (
. 5.
(1),
. 6.
(3).
(
: PRESSI ( HERSON )
, . 5.3).
(2)
).
Uses crt, graph; { - 2} Var Mt, Mx, x, x1 : real; { Borland Pascal 7.0 } DV, MV, EC, a, b, k, t, time : integer; BEGIN DV :=Detect; InitGraph(DV, MV ,' c:\bp\bgi '); EC :=GraphResult; Mt: =10; Mx: =2; Repeat t:=0; k:=0; Repeat a:=port[889]; t:=t+1; If (a=127)and(b127) then inc(k); b:=a; until t>1500; inc(time); x:=k/Mx; Circle(round(time/Mt),round(x),1); Line(round(time/Mt),round(x),round((time1)/Mt),round(x1)); x1:=x; If time>640*Mt then begin cleardevice; time:=0; end; until KeyPressed; CloseGraph; END.
3.7.
20
.
, ,
--
.
,
,
. (
)
1.
.
. , , ,
,
,
8,
-(
,
. 1). . ,
--
, ,
,
.
256-
,
8-
.
LPTMSDOS
.
IBM486DX2 Pentium, Windows98.
,
,
Borland Pascal 7.0.
. 1.
. -1. "
(
, ( . -2.
: PRESSI ( HERSON )
. 2.1). . 2.2).
, . 2.3
. 2.
: 1) ; 2)
.
2.
. (
)
),
"
,
. -3
a, b, c, d ...
; 3)
-4.
-3 , 1, 2, 3
.,
"
1, 2, 3 ...
a, b, c, d ... .
: PRESSI ( HERSON )
. 3.1 .
. 3.2
. 3. . 3. . .
,
, .
, ), "
U,
"
Ui=i
i=-6,-5, ... ,5,6, : (-4,4), (2,5) x1
. ,
x2. r=2
, L 2r=4 ( . 4). (0,0), (4,0), (2,4), (-2,4), (-4,0), (-2,-4), (2,-4). (0,0) (4,0) 4, (0,0) (2,4) 6. .
.
.
r=2, , (2,4)
(2,4), y=(2,4). y'=(3,3). .
--
y'
y (2,4),
(-1,5), .
, y, ,
. 4.
.
256
. 140
.
: PRESSI ( HERSON )
,
m=1,84. y:
-5 (
-- (75, 225), (
b -- (125, 225)
. 5.1). .
-6
(y1,y2)
.
.
,
(125, 225), ---
.
(
)x
.
,
(x, y),
(y1,y2)
L (y1,y2)
a; .
a, b, c, ... . 5.2).
)
1, 2, 3, ...,
(75, 225),
. 5.
. .
.6
,
4
.
. 6.
. .
4.
. (
,
) ,
: PRESSI ( HERSON )
.
.
,
,
.
,
, .
. -7. , ,
-8. , (L
, C
).
.
.7 ).
. 7. 5.
. (
--
,
.
,
. 8.1). 1
, LPT--
--LPT--
25
3 2.
,
25 2.
LPT--
1
, ,
---
11
100 LPT--
, QBasic
. Pascal.
. 8.
. -,
-LPT--
0
1,
1, ,
, f1,
. ,
2
: PRESSI ( HERSON )
, "0" ---
"1" ---
. 0.
f2, ,
--
. -. LPT--
1
2 5
0
1.
1
LPT--.
1
4,
--
3(
,
--
--
,
. -1
1, .
. 1(
, . 9), .
3, 4. 5, ,
, --
. 9. 2
LPT-
6.
.
: ,
6. 2 ,
.
6 0 0
. 8.2).
, .
32
3.8. 1. .
1,2
,
1, (
2
1
,
. 1).
--1
,
,
,
1 4
, ,
.
0,4
, ,
.
. 1.
. , 5
.
10 . 555
.
: PRESSI ( HERSON )
. ,
.
. 2.
, .
. 2.
. ,
1
.
2
3.1).
5 ,
.
, 3(
, .
.
. 3.
. 2
,
1(
3,
. 3.2).
,
, . .
2.
. 1 , .
(
, . 4.1).
,
.
, 3,
2
. .
,
(
)
. . 4.2.
. 4.
.
: PRESSI ( HERSON )
10 0,1648
.
96 5
.
, . . 13,54
17,1 .
8,56 5-7 %
/c
8,2
,
. 2.
. ,
,
.
.
-1 . ,
.
. 5.
v2=1,56 2 . 3.
3,
b=3 . , g=9,34
.
2
; 2) v1=0,70 2 9,81 . .
2,
a=12 , : 1) v1=0,83 , , v2=1,58 , g=11,1
. 5:
1 .
2 , ,
4. 555.
LPT) -2
20
, .
,
-- 1,5
.
. 5.
. : ,
.
(
.
,
,
) .
10-20
,
.
3.9.
, ,
: PRESSI ( HERSON )
-, , 1.
,
.
,
. .
,
,
,
, .
: (
--
2
. 1.1). 1
,
.
, .
. 1.
,
. a=6
b=4 x3 3) 1 ,1
(
,4 ,1 , 2,5 .
. 1.2). 6 . 1.3. x1, x2, : 1) 1 ,2 ,3 ; 2) 2 ,2 ; 4) 4 ,1 ,1 ; 5) 1 ,1 ,4
-1, , ttt[i].
a[i,j],
j=1, 2, 3 --
x1, x2, x3,
,
i=1, 2, 3, ..., 6, -,
ttt[i-2]+ttt[i-1]+ttt[i], , xj (j=1, 2, 3).
, ,2 ; ; 6) 2,5 , xj.
. x1, x2, x3, L
a[i,j].
,
.
2.
. )
.
: PRESSI ( HERSON )
6 .
,
-2, .
, .
, .
a[i,j].
.
, (
),
,
.
[
1999. --- N 3. --2.
,
]/ . 48--64.
.--
. ,
,
. .
: . ---
.
.,
.
.
.
-. ---
, . . --: 1964. --- 324 c.
,
.[ .:
:
]/
4.
5.
,
.,
. 6.
. .
.
. ---
. [
. ---
.:
, . , 1986. --- 319 .
[
]/
.
--
,
, . : : 1991. -- 53 .
. --,
--
.
[ ]/ , 1997 --- 167 . 3.
,
,
.
1.
.
]/
.
[
. ---
]/
:
.
,
, 2006. --- 64
. 7. 8.
. :
[
, 2008. --- 2004 c ,
.
/
.
2004. --- 440 .
: PRESSI ( HERSON )
. ---
.:
]/
.
--
. -.
,
9.
, . . ---
10.
: 8--10 . . .[ , 1987. --- 192 .
.: , .
. 11. / . 12.
,
.
.
, . , 1985. --- 391 .
]/
14. .
[
., 1986. --- 431 .
]/ .
13.
15.
.
,
, .
.
.
. -.--: . ---
.:
,
.:
.
:
:
. ]/
.
]/
. ---
. ---
, 1988. --- 263 .
.:
[
.:
]
555
: , 1989. --- 352 c.
.: .
[ ]/ . , 1991. --- 688 .
. 2-.[ ] // . --: . . , 1974. --- .1. -- 607 c. .2. -- 620 c.
.
. .