Result

WA

Code [DL]

`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

stdin

00000110
00101111
11001011
10001000
00100111
11110010
10101011
11010011
11011110
00010101
11010010
10001001
01001110
00000011
10110010
00101010
10100100
01110010
00101101
00000001
11001010
10111110
01111100
01000010
00000110
11111101
00101001
00000000
01111000
01011001
11111100
11101100
01101101
01001000
11011100
00100100
10111100
00110111
01110111
01101001
00001010
01111011
00001111
01110110
01011011
00000110
00011100
11100111
10011001
00110000

stdout

         96
        244
        211
         17
        228
         79
        213
        203
        123
        168
         75
        145
        114
        192
         77
         84
         37
         78
        180
        128
         83
        125
         62
         66
         96
        191
        148
          0
         30
        154
         63
         55
        182
         18
         59
         36
         61
        236
        238
        150
         80
        222
        240
        110
        218
         96
         56
        231
        153
         12

stderr

strace