Claims
- 1. A circuit for determining if an N-bit number is equal to a power of two comprising:a first stage of detection gates, each of said first stage detection gates capable of receiving a first data bit and a second data bit from said N-bit number and generating a first output bit and a second output bit, wherein said first and second output bits are 01 if said first and second data bits are different and are one of 00 and 11 if said first and second data bits are the same; and a second stage of detection gates coupled to said outputs of said first stage of detection gates, each of said second stage detection gates receiving three of said first stage output bits and generating a first output bit and a second output bit, wherein said first and second output bits of said second stage detection gates are 01 if only one of said three first stage output bits is equal to Logic 1 and are one of 00 and 11 otherwise.
- 2. The circuit as set forth in claim 1 wherein each of said detection gates in said first stage of detection gates comprises a first multiplexer and a second multiplexer.
- 3. The circuit as set forth in claim 2 wherein said first multiplexer has a 0 input channel coupled to said first data bit, a 1 input channel coupled to a Logic 1 signal, and a channel select input coupled to said second data bit.
- 4. The circuit as set forth in claim 3 wherein said second multiplexer has a 0 input channel coupled to a Logic 0 signal, a 1 input channel coupled to said first data bit, and a channel select input coupled to said second data bit.
- 5. The circuit as set forth in claim 1 wherein each of said detection gates in said second stage of detection gates comprises a first multiplexer and a second multiplexer.
- 6. The circuit as set forth in claim 5 wherein said first multiplexer has a 0 input channel coupled to a first output bit of said first stage, a 1 input channel coupled to a Logic 1 signal, and a channel select input coupled to a second output bit of said first stage.
- 7. The circuit as set forth in claim 6 wherein said second multiplexer has a 0 input channel coupled to a third output bit of said first stage, a 1 input channel coupled to said first output bit of said first stage, and a channel select input coupled to said second output bit of said first stage.
- 8. The circuit as set forth in claim 7 wherein each of said detection gates in said second stage of detection gates further comprises a third multiplexer and a fourth multiplexer.
- 9. The circuit as set forth in claim 8 wherein said third multiplexer has a 0 input channel coupled to an output of said first multiplexer, a 1 input channel coupled to a Logic 1 signal, and a channel select input coupled to a fourth output bit of said first stage.
- 10. The circuit as set forth in claim 9 wherein said fourth multiplexer has a 0 input channel coupled to an output of said second multiplexer, a 1 input channel coupled to said output of said first multiplexer, and a channel select input coupled to said fourth output bit of said first stage.
- 11. A data processor comprising:an instruction execution pipeline comprising N processing stages, each of said N processing stages capable of performing one of a plurality of execution steps associated with a pending instruction being executed by said instruction execution pipeline, wherein at least one of said N processing stages comprises a circuit for determining if an N-bit number is equal to a power of two, said circuit comprising: a first stage of detection gates, each of said first stage detection gates capable of receiving a first data bit and a second data bit from said N-bit number and generating a first output bit and a second output bit, wherein said first and second output bits are 01 if said first and second data bits are different and are one of 00 and 11 if said first and second data bits are the same; and a second stage of detection gates coupled to said outputs of said first stage of detection gates, each of said second stage detection gates receiving three of said first stage output bits and generating a first output bit and a second output bit, wherein said first and second output bits of said second stage detection gates are 01 if only one of said three first stage output bits is equal to Logic 1 and are one of 00 and 11 otherwise.
- 12. The data processor as set forth in claim 11 wherein each of said detection gates in said first stage of detection gates comprises a first multiplexer and a second multiplexer.
- 13. The data processor as set forth in claim 12 wherein said first multiplexer has a 0 input channel coupled to said first data bit, a 1 input channel coupled to a Logic 1 signal, and a channel select input coupled to said second data bit.
- 14. The data processor as set forth in claim 13 wherein said second multiplexer has a 0 input channel coupled to a Logic 0 signal, a 1 input channel coupled to said first data bit, and a channel select input coupled to said second data bit.
- 15. The data processor as set forth in claim 14 wherein each of said detection gates in said second stage of detection gates comprises a first multiplexer and a second multiplexer.
- 16. The data processor as set forth in claim 15 wherein said first multiplexer has a 0 input channel coupled to a first output bit of said first stage, a 1 input channel coupled to a Logic 1 signal, and a channel select input coupled to a second output bit of said first stage.
- 17. The data processor as set forth in claim 16 wherein said second multiplexer has a 0 input channel coupled to a third output bit of said first stage, a 1 input channel coupled to said first output bit of said first stage, and a channel select input coupled to said second output bit of said first stage.
- 18. The data processor as set forth in claim 17 wherein each of said detection gates in said second stage of detection gates further comprises a third multiplexer and a fourth multiplexer.
- 19. The data processor as set forth in claim 18 wherein said third multiplexer has a 0 input channel coupled to an output of said first multiplexer, a 1 input channel coupled to a Logic 1 signal, and a channel select input coupled to a fourth output bit of said first stage.
- 20. The data processor as set forth in claim 19 wherein said fourth multiplexer has a 0 input channel coupled to an output of said second multiplexer, a 1 input channel coupled to said output of said first multiplexer, and a channel select input coupled to said fourth output bit of said first stage.
CROSS-REFERENCE TO RELATED APPLICATION
The present invention is related to that disclosed in U.S. patent application Ser. No. 09/733,661 entitled “CIRCUIT FOR DETERMINING THE NUMBER OF LOGICAL ONE VALUES ON A DATA BUS” and filed Dec. 8, 2000 . The above application is commonly assigned to the assignee of the present invention. The disclosure of this related patent application is hereby incorporated by reference into the present disclosure as if fully set forth herein.
US Referenced Citations (3)