首页>
外国专利>
Bit searching through 8, 16, or 32 bit operands using a 32 bit data path
Bit searching through 8, 16, or 32 bit operands using a 32 bit data path
展开▼
机译:使用32位数据路径通过8、16或32位操作数进行位搜索
展开▼
页面导航
摘要
著录项
相似文献
摘要
A bit searching method shifts an operand and counts the number of shifts it takes to shift out the value one, thereby identifying the bit position in operand containing the value one. The operand is first compared to zero. If the operand is zero, the zero flag is set, otherwise, a register is initialized by being cleared for a bit search forward instruction or, for a bit search reverse instruction, being initialized to 15 for a 16-bit data length or 31 for a 32-bit data length For a bit search forward instruction, the operand is then shifted right one bit and the register is incremented, while for a bit search reverse instruction, the operand is shifted left one bit and the register is decremented. The operand is then examined to see if a 1 has been shifted out. If so, the register is read and decremented by 1 to yield the bit position of the operand where the first 1 was found. If not, then another shift and increment (decrement) step is performed.
展开▼