1 2 32 4 512 by carl

use std.textio.all;entity test is end;architecture b of test is
begin process variable x,q,l,p:integer:=0;variable s:string(1 to 84);begin
for i in 1 to 100 loop
s:="000000000000000000000000000000000000000000000000000000000000000000000000000000000001";p:=integer'image(i)'length-1;l:= 84;while true loop
if l+p<=84 and integer'value(s(l to l+p))=i then
write(output,s(l to 84));exit;end if;x:=0;for j in 84 downto 1 loop
q:=character'pos(s(j))-48;if q+x>0 then l:=j;end if;q:=x/10+q*2;x:=(q-q mod 10);q:=q-x;s(j):=character'val(48+q);end loop;end loop;end loop;wait;end process;end;

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page