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
Post a Comment