bit to bit xor with same input vector in vhdl -


i want bit bit xor same input vector like:

input(0) xor input(2) xor input(3) input(187).

the answer like:

output(0) downto output (94)

this means have xor successively. if have 10 input bits, last answer 5 bit output. difficult , not approach write whole vector.

does knows how write efficient code of in vhdl?

i have idea how it. first extract index bits, odd index bits , xor no luck please me.

it sounds need either generate statement or for loop.

concurrent statement

lots_of_xor: in 0 94 generate     output(i) <= input(2*i + 0) xor input(2*i + 1); end generate; 

sequential statement

for in 0 94 loop     output(i) <= input(2*i + 0) xor input(2*i + 1); end loop; 

notes

in either version, can replace 94 output'length well.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -