hi , im trying to write a code and i need to check the first bit of a signle after that the second bit after that the third bit , on and on until i arrive to the bit num 10 , i just need to know if the bit is 1 or 0 , how should i do it?
NINA wrote: > how should i do it? with a comparison or a comparator
NINA wrote: > i need to check the first bit of a > signle after that the second bit First of all, make yourself more familar with the ideas behind VHDL. Checking a bit of a vector is absolutely basic. if (signle=='1')... if (signle=='1')...
NINA wrote: > a signle Whats that? NINA wrote: > until i arrive to the bit num 10 Starting from index 0 or from 1? Show the (type-) definition of that vector of 10 or 11 bits.
Depending on what should be done, this could be a use case for a for loop:
for i in 0 to signle'high loop/generate
if signle(i) = '1' then
I hope there is no syntax error, but the idea should be clear.