This circuit was found in the Linear Applications Handbook by National Semiconductor. It uses common comparators to provide 3-bit TTL output.