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: > 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[0]=='1')... if (signle[1]=='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:
1 | for i in 0 to signle'high loop/generate |
2 | if signle(i) = '1' then |
3 | ...
|
4 | end if; |
5 | end loop/generate |
I hope there is no syntax error, but the idea should be clear.
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.