To implement bitshifts/rotates in circuits: you can build registers from an array of Flip Flops which in turn you can build e.g. from NAND gates.
In order to implement bit-shifts/rotates you would wire two such registers (or feed back to the same register) by wiring the output of bit 0 to the input of bit 1 etc.
The contents are then transferred on e.g. the next clock rising edge from one array of flip-flops to the other.
您可以通过添加 a + a 来模拟左移。与/或/非/异或的结果不依赖于相邻位,因此您不能将它们用于位移位。在电路中,我希望它们是硬编码的......无论如何,您可以使用位移来实现快速硬件乘法。
You can emulate a left shift with addition a + a. The result of an and/or/not/xor do not depend upon adjacent bits, so you can't use them for bitshifts. In circuit, i'd expect they are hard-coded... You can use bit-shifting for fast hardware multiplication anyway.
发布评论
评论(2)
要在电路中实现位移/旋转:您可以从 触发器数组构建寄存器 反过来,您可以从 NAND 门构建。
为了实现位移/旋转,您可以通过将位 0 的输出连接到位 1 的输入等来连接两个这样的寄存器(或反馈到同一个寄存器)。
然后内容会在下一个时钟上升沿传输从一个触发器阵列到另一个触发器阵列的边缘。
To implement bitshifts/rotates in circuits: you can build registers from an array of Flip Flops which in turn you can build e.g. from NAND gates.
In order to implement bit-shifts/rotates you would wire two such registers (or feed back to the same register) by wiring the output of bit 0 to the input of bit 1 etc.
The contents are then transferred on e.g. the next clock rising edge from one array of flip-flops to the other.
您可以通过添加
a + a
来模拟左移。与/或/非/异或的结果不依赖于相邻位,因此您不能将它们用于位移位。在电路中,我希望它们是硬编码的......无论如何,您可以使用位移来实现快速硬件乘法。You can emulate a left shift with addition
a + a
. The result of an and/or/not/xor do not depend upon adjacent bits, so you can't use them for bitshifts. In circuit, i'd expect they are hard-coded... You can use bit-shifting for fast hardware multiplication anyway.