Вы находитесь на странице: 1из 93

:

. : -- :
, 2011.

30 , .
Pascal, ,
.
: ,
, . ,
,
.
" " ,
: ,
, . ,
, --
- , ,
,
, - ,
". ,

.
, .

,
.
:
, ,
, ,
,
, , ,

. ,
,
, .

1. ,
.

2.
.

3.
,
.

4.
.

5.
.

: PRESSI ( HERSON )
,

. --

.
,
.
,
(
).

, ,
. ,
,
. !
, ,
,
.

( . 3.2, 3.4 3.5).

( )
(
).

"
"
( -- ).

0.

1. . ,

( )
.
, ,
, ( ,
),
. 1). .
( ,9 )
,
.
, ;
( )
220 .
,
1 .

. 1. .

,
9 - 12 ( , 10).
, . 2:

.
(
),
.
, ,
.
,
. ,
.

. 2. .

: PRESSI ( HERSON )
, .
.
,
:

. 3. .

. 3.
.
100 (
).

2. .

?
, ,
. ,
, ,
.
,
.
.
. 4. .

. 4.

20 - 200 .

. ,
,

.
, .

1.1. ,

1.
,
, .
,

, .

. 1. .

. (

: PRESSI ( HERSON )
) .
( . 1.1)
,
$f=50$ .
,
. . 1.2 ,
.

, .

.
L,
R.

.
C,
R.
,
. -- ( . 1.3)
.
. 2. .

.2 ,

242 .
200 25 .
220 12 ;
0,16 .

2. .
+5 .

, : + U,
- U, U 5 - 15 .

: PRESSI ( HERSON )
. 3. 5 .

.
220 ,
8 - 12 .
, ,
405 . C1 C2
, 16 .
. R1
VD2 .
R1 ,
VD2
5 .

+15 , -15
.
220 ,
18 - 25 . 2 156
,
15 .
VD2 ,
, ,

.
1 ,
.

3. .

---
.
PJ7805 ( ,
) , .
4.1. :1-
,2- ,3- ( . 4.1).
10 - 12 ,
5 . ,
( R1),
.
,
0,5 - 1 .

. 4. .

. 4.2
142 12 .
:1- ,2- ,3- .
1,5 , 40
1,2 37 .
1
R2. R1
,
.

4. . ,

,
+5 , , -5 . ,
. 5. T1 ,
,
9 .

: PRESSI ( HERSON )
405 .
. C1 - C4
.

. 5. .

2. , ...

1. . ,
: 1)
, p-n-p ( - n,
); 2)
, n-p-n ( - p,

). ,
?

. p-n-p- ,
,
p-n- .
.

, .
,
,
3-5 , 0,5 - 1 .
.1 .
,
.
. 1. .

.
p-n- . p-n-p
.
n-p-n
. p-n-
, .

2. .
--- , .

.
. 2. 602
(n-p-n- )
.
-- ,
R3 , .

. 2. .

.
,
( ,
10 ). , ,
9 .

: PRESSI ( HERSON )
,
, , .

R3 (
, , 0,01 ).
R1,
.

3. .
,
.

.
, .

( ) .

. 3. .

.
3. 134, 4 .

)
100--220 .

. , ,
.
, --
0,5 - 1 .

.
,
: -
-- , --- .
,

.
,
.
, --
.
. 4.

. 4. .

S1.
1 R1.

, .
. ,
, .

3.

1. . ,
?

?
,
,

: PRESSI ( HERSON )
.
t1,
, , .
t2 ,
.

. 1. .

--12. , ,

,
. 1.1).
.
,
.

. 1.2.

,
. .
R2
,
.
) , , ,
. . 2.
. 2. .

2. . ,
100
220 .
,
.
. ,

, .
,
. ,
30 - 60 .
( , ),
.

3. . ,

-1 R2
, .

:
.

: PRESSI ( HERSON )
, ,
, .
, ,
, .
1-5 ,
R2.

4. .
: ,
.
( . 3),
.

VT1 VD2
VD1.
R2 ,
R1 VT1
.
, , .
VD2
, , .

. 3. .

R1 ,
,
VT1 .
,
VD2. .
R5 ,
1 5,6 .
103 PC817. PC817
:
50 ,
35 , 50 .

,
.
,
.
, .
,
,
, ,
R2.

C1 :

.
. 4.

. 4. .

4.

1. .

.
,

, ( ).
,
,
( ).

: PRESSI ( HERSON )
. 1. .

,
. 1.
.
,
.
R2,
.

AB, B C( --- ).
,
, A( -
-- ).
(
- ), ---
( D).

2. .
. 2.
: VT1
,
VT2 VT3.

VT1,
( ). C1 C3
,
. R1 R2
, .
,
( ).
n-p-n- ,
,
.
.
180 .

. 2. .

VT2 VT3,
B.
,
. A
, VD1 VT2 ,
VT3 , ( B)
. A ,
VT3 , VD1 ,
VT2 .
VT2, ( B) . 1
2 ,
.

3. .

( ) 544 .
, .
C1 C3 ,
. R2 R4
C2 C4
.
R2/R1 R4/R3
1000. DA2 .

: PRESSI ( HERSON )
. 3. .

5.

1. . -
--
p-n-p-n ( -- ),
.
( )
.
--- .

. 1. .

-- ( )
(
), ( . 1.1).
102 ( 11 ),
2-5 , 1 - 10 ;
20 - 100 .
, C1
R1.
( . 1.2).
, ,
.
,
. =RC,
R C ,
.
,
. ,

,
.

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. VT2
, VT2
C2 .
VT1, .
C2 R3,
VT1 . VT1,
VT2 .
.
C1, C2 R2, R3,

: PRESSI ( HERSON )
. 4. .

VT2
) VT2
( ), .
C3
.

5. .
( . 5)
, ( VT2)
( VT1)
C1. . VT1
(p-n-p- ),
.
VT2 (n-p-n- ),

. 5. .
C1 ,
R1 R2 ( ),
. VT1
, VT1 ,
-- . VT2
,
VT2 , .
, C1
R1, R2 VT2 ( ).
VT1 , VT1 ,
VT2. C1
, .

=(R1+R2)C1.
,
.
R1 1
. . 6.
VT1 25 21.

. 6. .

1.6.

: PRESSI ( HERSON )
1. .
,
.
.1. R1 R2
, U1
3 DA1.
2 U
R3. U U1,
1 .
R1 ,
3 .
U , 1
, .

. 1. .

R3,
. ,
,
.
( ),

R3.

2. .

,
, .

. ,
wi ,
, .
1.
, --- ,
--- .

. 2. .

. 2. 2 DA1
, ,
( S1).
( S2 S3)
3.
R4.
R1 R7, R2 R6, R3
R6. ( )
S1 - S3. ( .0
1) .

1.7.

1. .
1000 ?
,
220 1 .

. 1.

: PRESSI ( HERSON )
. 1. .

, ,

. 250 ,
1,4 x 250=350 .
700 .
C2, C3, C4.
C1
350 ). C5 1500 .
4
.

2. .
?-
?- .-
? , -
- ,
. ?

,
100 .
10 ,
1000 . ,
,

, 100 ).
-
, .
. 2.
-
- 110 15 .
VT1.

VD1 - VD4
3- 7, 4 .

. 2. .

.
,
,
.
1 - 33 , 1000
.
.
1-3 ,
2 .
. 3.

: PRESSI ( HERSON )
. 3. .

2.1. 155 3

1. " ".
" ", " ",
". 155 3
"2 -- "( . 1).
: ,
, -- 1, -- 2, ... ,
--- 7, --- 8, --- 9, ... ,
--- 14. : 14 +5 ,7
.

1 2, 3
200 . . 1,
+5 (x=1). ,
3 . 1 (y=1). ,
3 . 0 (y=0). .0(
), . ?
?

. 1. 155 3. .

"2 -
". 3
. 1 . 1 (x1=1), 2 --- .0
(x2=0). 3 (y)?
,
.

"2 ".
" -- " " ",
" ". .

2. RS-- . --- ,
,

. RS--
2 -- ,
( . 1.2). : S --- set
), R --- reset ( ).
.1 ,
. 0, -- . 1,
.
1 .

3. . ,
. 2,
.
,

: PRESSI ( HERSON )
R1
C1 .

. 2. .

T, f=1/T. T
=R1C1.

2.2.

1. .
,
.
, .
,
50
.
, ,
.

. 1. .
.1
-- 561 1
. ,
,
3 15 .

50 .
,
, 0,25 -19). .

2. .
D- ,
.
,
. 2.
2 -
( 561 5) D- (
155 2).
1 ,
VD1.
D- . ,
.0 S1
.
, DD2.1 . 1.

. 2. .

S1,
1 .
VD2 - VD5, -
.1.
,

: 1000 -> 0100 -> 0010 -> 0001 .

: PRESSI ( HERSON )
. n
n
2 , --- 2-n.
n
. FIFO
(First Input First Output --- , )
FILO (First Input Last Output --- ,
).

3. .
, -- ,
.
155 3 ,
( . 3).
SA1,
SA2, SA3 HL1, HL2, HL3
A2A1A0, SA4, SA5, SA6
HL4, HL5, HL6 B2B1B0
HL7, HL8, HL9, HL10
C3C2C1C0. 307 , -35- -
, L-8131D . --
4,5 .
. 3. .

( . 4).
,
, ,
101 110, ,
1.
,
, , 101 110, ,
1011.

: PRESSI ( HERSON )
. 4. .

4. 8-
.
8 .
561 2,
, .
,

1 0.
2, 3, 4 LPT- . 3
LPT-
( , 11 ).

. 5. 8 .
-1.

0, 1, 2, ..., 8.
" "
. .
9 .
0 1.

2.3.

1. .
155 5
.
2(
14, 12) 8( 1, 9, 8, 11).

VD1 - VD4. C1
S1.

: PRESSI ( HERSON )
. 1. .

S1
.
0 1,
, .
, : 0000, 0001, 0010, 0011,
0100, ... , 1110, 1111. 16
.

. 2. .

2. .
. 3) -- DD1 DD2,
DD3, DD4 HG1
HG2. x ,
( 12, 9, 8, 11) DD1
, .
DD3,

HG1.
10, .
3
2 =8 ( 11) DD2,
.
S1 DD1 DD2,
HG1 HG2 .

: ., .
.

: PRESSI ( HERSON )
. 3. .

3.1.

1. LPT- .
--- ,
.
LPT-- ,
, . LPT--
, 25 :1 --- ,
, ,
2-9 --- 8 , 1
, 10-17 ---
(
, " ", , , ,
.). 18-25
( ).

1
10-17 LPT-- ,

37916=88910. 1

37816=88810. 2-9
.0 1.

, ,
Borland Pascal 7.0
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
LPT ( 11 25) 1
. 1.1). ,
1,
37916 11111111 (255).
LPT ,
0. 37916
01111111 (127),
x=INP(&H379). -- .
LPT-- :

WHILE INKEY = "": PRINT INP(&H379); : WEND

: PRESSI ( HERSON )
, ?
-- 1 . ,x
127, 1,
"1". ,x 127,
2, "0". ---
.

CLS : x = INP(&H379) ' - 1


WHILE INKEY$ = "" 'QBASIC
WHILE x <> 127: x = INP(&H379): PRINT "1"; : WEND '
1
WHILE x = 127: x = INP(&H379): PRINT "0"; : WEND '
2
WEND
END

.
-- 2 .
( 1), --
".
1, T0 ,
2,
". , -- T
.
T-T0,
.
, .

CLS : x = INP(&H379) ' - 2


WHILE x = 127: 'QBASIC
x = INP(&H379): PRINT " " ' 1
WEND : T0 = TIMER
WHILE x <> 127:
x = INP(&H379): PRINT " " ' 2
WEND: T = TIMER: PRINT " ", T - T0
END

-- 3 .
, 5-20 ,
, .

CLS : x = INP(&H379) ' - 3


WHILE x = 127 'QBASIC
x = INP(&H379): PRINT " ": WEND ' 1
t0 = TIMER
WHILE x <> 127
x = INP(&H379): PRINT " ": WEND ' 2
WHILE x = 127
x = INP(&H379): PRINT " ": WEND ' 3
t = TIMER: PRINT " ", t - t0
END

. 1. .

3. .
1,
3, 4
. 1.2). 2
: 1
0 .

, .
3 25 LPT.
37816 255,
.1 2-9 .

, LPT--
( . 1.2), -- 4 .
,
1 2. LPT 111111112=255,
1 "1".
LPT 011111112=127,
2, "0".
, ,
.

OUT &H378, 255 ' - 4


WHILE INKEY$ = "" : x = INP(&H379) 'QBASIC
WHILE x <> 127: ' 1
x = INP(&H379): PRINT "1";

: PRESSI ( HERSON )
WEND : t0 = TIMER
WHILE x = 127: ' 2
x = INP(&H379): PRINT "0";
WEND: t = TIMER: PRINT t - t0
WEND: END

.
-- 4, PRINT "0"
PRINT "1".
1, T0
. ,
2.
2 T .
T-T0 ,
.

, .

.
,
, T0
,

T. T-T0 .
,
,
.

3. .
,
, , ,
( . 2.1).
. 155 3,
LPT-- ( . 2.2).
,
, .
t( ,1
) ,
.
, ,
.
. 2. .

-- 5 .
; 1,
LPT-- dt.
,
. ,
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 )
-- ( ).
( . 1).
37816=88810 x 0 255,
LPT-- , ,
.0 1, x
. QBasic
OUT { }, { }( , OUT &H378, 25),
Pascal --- port[{ }]:= { }( , port[888]:=134).

-- ( . 1) ,
. 1, k+1 , 2 ,
. 1, k- .
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, --1.
LPT-- ,
.
,
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$ = "" ' - 2


OUT &H378, 255 'QBASIC
FOR i = 1 TO 100: PRINT "255": NEXT
OUT &H378, 0
FOR i = 1 TO 200: PRINT "0": NEXT
WEND

--2 ,
. ,
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; ' - 3


BEGIN 'PASCAL
Repeat
For i:=1 to 255 do
begin
port[888]:=i; write(i,' '); delay(10);
end;
until KeyPressed;
END.

--4,
. .
.

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'. ( --5),
-- :
A1, ---
A2.

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.

, s='101...11'.
--6), -- :
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 LPT-- .

. 2. .

: PRESSI ( HERSON )
. 2.
VD1, R4 C1
,
2--4 . 3
DA1, .
2
.
,
.

--7.
,
x. 1,
x 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 EC<>grOK 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 u<>127 then x:=x+1;
until (uu=127)and(u<>127); 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.

,
, 0--10 ,
$\approx$ 2--4 . ,
.
500
, 10--100
.
, ,
.
2. - .

( ),
,
.
,
.

. 3. - .

,
LM393N, . 3.
U 2 DA1.
3
C1, R3.
3 2, 1
.0 . 1.
VT1 VT2, C1
VT2. C2 C3
, ,
C1 . 1 DA1 .
0 C1
R3. 1 DA1
,

U . LPT-
VT3.
. 4.

: PRESSI ( HERSON )
. 4. - .

0,2 9
500 33 ;
. ,

,
.
:

1) k=10 . :
,
.

2) k ,
t. :
, , t
.

3) k t,
,
k+1 ,
t. ,
-- 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);}
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 000011112. 2, 3, 4, 5 LPT--
.1, --- .0.

. 1. LPT- .

, 8
. 29.1). 37816 110=
000000012 ,
6410=010000002, .
1510=000011112, .

QBasic.
-- 1 .
, , ---
.
.

WHILE INKEY$ = "" ' - 1


x = 0 : OUT &H378, x: GOSUB 10 'QBASIC
x = 1 : OUT &H378, x: GOSUB 10
x = 2 : OUT &H378, x: GOSUB 10
x = 4 : OUT &H378, x: GOSUB 10
x = 8 : OUT &H378, x: GOSUB 10
x = 16: OUT &H378, x: GOSUB 10
x = 32: OUT &H378, x: GOSUB 10
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(r1<>127) then k:=k+1;
until (t>100000)and(r=127)and(r1<>127);
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.

,
. k,
, , t
0 100000. osv=t/k
.

s
. s
osv
) porog: s=|osv-porog|/10.

osv1 osv2.
.

porog 200 500.


,
(
).
,
.
IBM PC 486D2X.

.2
.
,
.
.
.

. 2. .

4 ,

: PRESSI ( HERSON )
. :
, ,
( ).
,
. :
,
.

2.
.

. ,
, ,
.
, ,
. ,
( )
.

. 3. ,
.

( . 3).

uses crt, dos,graph;


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(r1<>127) then k:=k+1;
until (t>2000)and((r=127)and(r1<>127));
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 )
. LPT--
2,
3 ,
7, 6 3
.1.1). ,
, . 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.

, LPT-

.
16 ,
,
.
,
.
, Borland Pascal 7.0.

: PRESSI ( HERSON )
, T,

).
0

T.
( . 2).

( . 2.1, 2.2).

, , 0
T.

, 0.
. 2. .

: PRESSI ( HERSON )
. 2.1
.
,
, ,
T t.

, ( . 2.2). ,

,
.

. . 2.3 (t) T(t)


, t1, t2, t3,
0. ,
T,
02,
03 .

3. .
,

. 5
LPT- ,
,
. 3). ,
,

. 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 ( 5 )
x=x(t).
,

: PRESSI ( HERSON )
(
) 11 LPT- .
,
3 LPT- .

, .
11 LPT-
.
, ,
,
,
. ,
( ),

, .

( --3).
888 210= 000000102
3 LPT-- 1,
.
1 xx[i]
889
.
,
1,
889.
xx[i]. 2,
xx[i]
. delay(100);
100 , (
cleardevice;). Repeat ... untill
KeyPressed; ,
.

uses crt,graph; ' -3


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 EC<>grOK then Halt(1); end;
repeat {
}
port[888]:=2; delay(2); port[888]:=0; {
}
for i:=1 to 1200 do xx[i]:=port[889]; { 1}
for i:=1 to 1200 do
begin { 2}
if xx[i]<120 then xx[i]:=200 else xx[i]:=0;
{ if i/50=round(i/50) then line(i,0,i,480); }
circle(round(i/2),240-xx[i],2);
end; { 2}
delay(100); cleardevice; {
}
until keypressed; { }
CloseGraph;
End.

.
,
.
,
.
(2--5 )
.

3.6.

1% 1 -- 0,1 -- 0,01 .
,
.

1. .

( . 1.1).
1
2,
3, 4
5, .
,

: PRESSI ( HERSON )
8,
NE555 ( . 2).
1 -- 8 ,
.
.
LPT-
-1 Borland Pascal 7.0,
, ,
.

. 1. .

uses crt, graph;


{ - 1 }
var x,x1,x2,v,v1 : 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;
Repeat t:=0; k:=0;
Repeat a:=port[889]; If (a=127)and(b<>127) then inc(k);
b:=a; t:=t+1; until k>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). 4
0,5 -- 2 ,
.
,
160 .

. 3.2), , ( . 3.4).
1
6,
7 ,
. ,
( . 3.5).
. 1.2. 1
2,
3 25 . 5,
4 6,
10 .

: PRESSI ( HERSON )
. 3. ( ).

2. .

,
( . 4.1).
1, 2, 3
7. 6 4

,
5. 4
8 LPT --
9.
. 4.2. ,
,
,
).

. 4. .
, 10 .
.
. ,
,
.
.
,
:
,
( .5 6).
,
;
.
- 2.
,

. 5.2).
,
,
, .
3 5
15 280 ,
( . 5.3).

. 5. (1), (2)
(3).

. 6. ( ).

: PRESSI ( HERSON )
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(b<>127) 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((time-
1)/Mt),round(x1)); x1:=x;
If time>640*Mt then begin cleardevice; time:=0; end;
until KeyPressed; CloseGraph;
END.

3.7.

20
.

,
, ,
-- . ,

( ) .

1.
.
,
, -- --
, ,
, ( . 1). ,
, 8- ,

.
,
, ,
. 256-
,
8- .
LPT- .
IBM-
486DX2 Pentium,
MSDOS Windows98. ,

, Borland Pascal 7.0.

. 1. .

-1.
"
( . 2.1).
, ,
( . 2.2). . 2.3

.
-2.

: PRESSI ( HERSON )
. 2. : 1)
; 2) ; 3)
.

2. .

( ),
) " "

, .

-3 -4. -3

,
1, 2, 3 .,
a, b, c, d ...
1, 2, 3
... a, b, c, d ... . 3.1
. . 3.2

: PRESSI ( HERSON )
. 3.
.

3.
.

.
,
,
.
,
), " "
.

Ui=i
U, 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.

(2,4),
. ,
y=(2,4). --
y'=(3,3). y' y,
. y
r=2, (2,4),
. , ,
(2,4) (-1,5),

.
. 4. .

256
. ,
140
.

: PRESSI ( HERSON )
m=1,84. -5 ( )
( )x
y: -- (75, 225), b -- (125, 225) .

( . 5.1). ,
(x, y),
.

-6
. (y1,y2)
L
,
(y1,y2) . (y1,y2) (75, 225),
a;
(125, 225), --- .
1, 2, 3, ...,
a, b, c, ...

. 5.2).
.
. 5.
.

. .6
,
4
.

. 6. .

4.
.
( , ,
) .

,
.
,

: PRESSI ( HERSON )
. ,

,
.

.
-7.

,
, .
-8.

, ). .7
,
(L C ).
. 7.
, .

5.
. ,

100
( . 8.1). --- , 25 LPT--
1 25 LPT-- 2. -
-- , 3 LPT-- 1 11
LPT-- 2.
, ,
--- , .
QBasic Pascal.

. 8. .

-- 1,
, 0 1,
,
-- ,
LPT--
. , "1"
f1, "0" --- f2,
, --- . 0. --
2 ,

: PRESSI ( HERSON )
.
--

LPT-- 1
2 -- 3( . 8.2).
4,
5 LPT-- 6.
-- , 2
. --
1
0 1. 1 -- ,
, .
6 .
,
-- 32
0 1,
0 1 --
.

. 9. .

,
2 1( . 9),
.
3,
4.
5, LPT-
6.
,
.
:
,
,
.
3.8.

1.
. 1,

2 , --- ,
( . 1).
1,2 , 1 , 1 .
0,4 ,
1 , 4 .
, ,
,
.

. 1. .

,
.

5 10 .
555 ,
.
.

: PRESSI ( HERSON )
. 2.
,
.

. 2.
.

.
1 2 ,
3( .
3.1). 5 .
,
, .
. 3.
.

2
, , ,
1( . 3.2).
3, .

2. . ,
.
,
1 , 2 3,
( . 4.1).
.
,
. ( )
,
. .
. 4.2.

. 4. .

: PRESSI ( HERSON )
10 96
. 0,1648 5 .

,
.
.
17,1 /c 8,2 ,
13,54 8,56 .
5-7 %
.

2. .
, ,
. -1
.

.
,
.

. 5. .

a=12 ,
b=3 . : 1) v1=0,83 ,
2
v2=1,56 , g=9,34 ; 2) v1=0,70 , v2=1,58 , g=11,1
2 2
. 9,81 .

3.
.
. 5: 1
2,
3, . 2

, 4.

,
555.
LPT- ,

) .
20 , -- 1,5
-2 .

. 5. .

,
.
,
( , )
.
.

10-20 ,
.

3.9. ,
,

: PRESSI ( HERSON )
--
, ,
.

, ,
.

1. , .
,
, ,
. --
: 2
( . 1.1).
1
,

.
,
.

. 1. , .

a=6
b=4 ( . 1.2). 6 ,
. 1.3. x1, x2,
x3 : 1) 1 ,2 ,3 ; 2) 2 ,2 ,2 ;
3) 1 ,4 ,1 ; 4) 4 ,1 ,1 ; 5) 1 ,1 ,4 ; 6) 2,5
,1 , 2,5 .

-1, ,
a[i,j], i=1, 2, 3, ..., 6, --
, j=1, 2, 3 -- xj.
,
x1, x2, x3,
ttt[i]. ttt[i-2]+ttt[i-1]+ttt[i],
,
xj (j=1, 2, 3).
,
.
x1, x2, x3,
a[i,j].
L ,

2. .
6

) . ,
.

: PRESSI ( HERSON )
-2,
.

,
.
a[i,j].
.

,
.
,
(
), .
,
,
.

1. , . : --
[ ]/ . . --- . ---
1999. --- N 3. --- . 48--64.

2. , ., .
[ ]/ . , . . --- .:
, 1997 --- 167 .

3. , . : .
.-- . . . -- .[ ]/ . , .
, . . --- .: , 1986. --- 319 .

4. , . [ ]/ .
. --- : -- ,
1964. --- 324 c.

5. , ., , .
: [ ]/ . ,
. . --- : 1991. -- 53 .

6. , .
[ ]/ . . --- : , 2006. --- 64
.

7. .
[ ]/ . . --
- : , 2008. --- 2004 c

8. , . .
/ . . --- .: -- ,
2004. --- 440 .

: PRESSI ( HERSON )
9. , . : .
. 8--10 . . .[ ]/ .
. --- .: , 1987. --- 192 .

10. , . :
[ ]/ . --- .:
. ., 1986. --- 431 .

11. , . : [ ]
/ . , . , . . --- .:
, 1985. --- 391 .

12. , . 555
]/ . . -- .: , 1988. --- 263 .

13. , . :
]/ . .--- .: , 1989. --- 352 c.

14. : [ ]/ . .
. . --- .: . , 1991. --- 688 .

15. . 2-- .[ ] // . .
. . --- : . .
, 1974. --- .1. -- 607 c. .2. -- 620 c.

Вам также может понравиться