A comparator to be used in a content-addressable memory, CAM, which comprises at least one memory cell configured to store data, comprising: at least one validity indicator indicative of the validity of data; at least one static-based comparator configured to selectively switch at least one comparator output coupled to a match line in response to (i) a comparison of the data with compare data and (ii) the at least one validity indicator, wherein the at least one static-based comparator is comprised of: a first pass-gate adapted to receive a first signal based on the data as input; and a second pass-gate adapted to receive a second signal dependent on the first signal as input, wherein the first pass-gate and the second pass-gate are configured to drive the at least one comparator output, wherein the second pass-gate is adapted to receive the second signal having the logical value of the data and the first pass-gate is adapted to receive the first signal having the logical value of the data in response to the at least one validity indicator indicating invalid data and wherein the first pass-gate is adapted to receive the first signal having the logical value of the data and the second pass-gate is adapted to receive the second signal with a complement of the logical value of the data in response to the at least one validity indicator indicating valid data. at least one validity indicator indicative of the validity of data; at least one static-based comparator configured to selectively switch at least one comparator output coupled to a match line in response to (i) a comparison of the data with compare data and (ii) the at least one validity indicator, wherein the at least one static-based comparator is comprised of: a first pass-gate adapted to receive a first signal based on the data as input; and a second pass-gate adapted to receive a second signal dependent on the first signal as input, wherein the first pass-gate and the second pass-gate are configured to drive the at least one comparator output, wherein the second pass-gate is adapted to receive the second signal having the logical value of the data and the first pass-gate is adapted to receive the first signal having the logical value of the data in response to the at least one validity indicator indicating invalid data and wherein the first pass-gate is adapted to receive the first signal having the logical value of the data and the second pass-gate is adapted to receive the second signal with a complement of the logical value of the data in response to the at least one validity indicator indicating valid data. a first pass-gate adapted to receive a first signal based on the data as input; and a second pass-gate adapted to receive a second signal dependent on the first signal as input, wherein the first pass-gate and the second pass-gate are configured to drive the at least one comparator output, wherein the second pass-gate is adapted to receive the second signal having the logical value of the data and the first pass-gate is adapted to receive the first signal having the logical value of the data in response to the at least one validity indicator indicating invalid data and wherein the first pass-gate is adapted to receive the first signal having the logical value of the data and the second pass-gate is adapted to receive the second signal with a complement of the logical value of the data in response to the at least one validity indicator indicating valid data.