`define EOF 32'hFFFF_FFFF `define STDIN 32'h8000_0000 module cat; integer c,i,d; initial begin c = $fgetc(`STDIN); i = 1; d = 0; while (c != `EOF) begin while ( i < 256)begin d = d + (c - 48) * i; i = i * 2; c = $fgetc(`STDIN); end $write(%d\n, d); i = 1; while(d > 0)begin d = d - i; i = i + 1; end if ( d == 0)begin // $write("%c\n", "0"); end else begin // $write("%c\n", "1"); end c = $fgetc(`STDIN); d = 0; i = 1; end end endmodule