Go Down

Topic: Convert ring counter to binary (Read 1 time) previous topic - next topic

MichaelMeissner


Stupid me!  :smiley-red:
I forgot to say that I'm looking for a hardware solution. Best without any clock cycles.

... and thanks for the help so far! :)

My sense is for a lot of the computers that have a count leading zeros instruction, internally the processor does a combination of if and loop type operations.  You can throw more logic at the problem, depending on the usual cost/benefit analysis.  On the server powerpc's that I deal with for work, the CNTLZ instruction is a 2 cycle instruction, while the normal integer operations are 1 cycle.

Grumpy_Mike

Quote
My sense is for a lot of the computers that have a count leading zeros instruction

No they don't, the instruction you referanced is an increment or decrement with a branch if the result is less than zero.
I know of no instructions that count zeros in a word.

Grumpy_Mike

If all you have is the 16 ring counter inputs, you can use a pair of 74LS348 priority Encoders.

privateRob


If all you have is the 16 ring counter inputs, you can use a pair of 74LS348 priority Encoders.


Yes, yes, YES! Thank you very much! :)

Gorgus


Go Up