const n=15;
type t_kod=array[1..n] of 0..1;
procedure convertor(var a:t_kod; y:longint );
var t:longint;
x,q: longint;
begin
t:=n;
x:=y;
if x<0 then a[1]:= 1;
x:=abs(x);
repeat
q:=x mod 2;
a[t]:=q;
x:= x div 2;
t:=t-1;
until (x=0) or (t = 1);
end;
Тегами пользуйся...