completelyuseless
Junior Member level 1
vhdl invert vector
Hi all,
i have to synthesise some VHDL code that will manipulate bits in a certain way.
in a vector of say 'n' bits, i need to find the position of the most significant '1' in the vector and and invert the 0's that are to the left of it.
eg:
lets say a i have a vector that is 9 bits long, and arbitrarily it is say 000110100
there are 3 zeros before the most significant 1 in the obove vector, so i need a clever sort of masking system that will invert those zeros, making it 111110100.
Even if the position of that most significant '1' changes, the method must be general and work for any case, (provided the vector size does not change of course)
i know this can be done with a whole lot of if's and else's but id like to know if there is some clever quick masking system that i dont know about that exists to tackle this problem.
thanks in advance
Hi all,
i have to synthesise some VHDL code that will manipulate bits in a certain way.
in a vector of say 'n' bits, i need to find the position of the most significant '1' in the vector and and invert the 0's that are to the left of it.
eg:
lets say a i have a vector that is 9 bits long, and arbitrarily it is say 000110100
there are 3 zeros before the most significant 1 in the obove vector, so i need a clever sort of masking system that will invert those zeros, making it 111110100.
Even if the position of that most significant '1' changes, the method must be general and work for any case, (provided the vector size does not change of course)
i know this can be done with a whole lot of if's and else's but id like to know if there is some clever quick masking system that i dont know about that exists to tackle this problem.
thanks in advance