This invention relates to communications and computer systems, and in particular routers and packet switching systems; and more particularly, the invention relates to using ternary and binary content-addressable memory stages to classify information such as packets.