A hardware circuit implemented on a DRAM foundry is provided for finding
the longest prefix key match. The hardware circuit includes the use of
prefix search engines to store prefix keys. Each prefix search engine may
advantageously include an n-dimension memory for fast efficient access.
Each prefix search engine is preassigned to store prefix keys having a
specific length. Based on the preassignment and the n-dimensional memory,
the hardware circuit matches the longest prefix key stored in the prefix
search engines by comparing all prefix search engines in parallel.