Apr
23
2009
A way to decide either one or more bits are active (VHDL)
Posted by: ben in FPGA, tags: VHDLThis solution solves the issue on, how to detect either one or more bits are active in a bit array. The technique is quite easy, just isolate one of the bits. This can be done by the same technique as known from the arbiter implementation. Calculate the two’s complement of the bit array signal and bitwise AND the result with the same array line (1).
(1) b <= a and (not a)+1;
This equation isolate the least significant bit. Since we just want to know if there are more than one bit is active, the next step is to mask out (2) the detected bit from (1) and compare the result with zero (3). If the result is zero, no other bit was active.
(2) c <= not b and a; (3) morebits <= '0' when c = 0 else '1';
Entries (RSS)