Result

ERROR

Code [DL]

`define EOF 32'hFFFF_FFFF
`define STDIN 32'h8000_0000

module cat;
	integer c,i,d;
	initial begin
		c = $fgetc(`STDIN);
		while (c != `EOF) begin
			while (! ( c == 48 || c == 49)) begin 
				c = $fgetc(`STDIN);				
			end
			d = 0;
			i = 1;
			while ( c == 48 || c == 49)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
		end
	end
endmodule

stdin

10100011
01111000
11010010
11111101
10101010
11110110
00111100
10011001
10111110
00100100
00001010
11001101
00101101
10011001
11110010
00010101
01000100
01001110
00000000
01010100
00000001
00110111
10000111
01101001
10110111
11100000
01011011
01000010
00000011
11100111
01110100
11011111
01000011
10001000
10100010
11001010
10111101
11010000
00101111
11111000
00101011
10100111
10101001
10101011
01011111
00000000
00000110
10011010
00011100
00001111

stdout

stderr

strace