function inttobin(n:integer):string
var t:integer;
begin
t := abs;
result := '';
while t <> 0 do
begin
result := inttostr(t mod 2) + Result;
t := t div 2;
end;
end;
function IntToBin(Value: LongInt;Size: Integer): String;
var
i: Integer;
begin
Result:='';
for i:=Size downto 0 do
begin
if Value and (1 shl i)<>0 then
Result:=Result+'1';
else
Result:=Result+'0';
end;
end;