mmruzek
Experienced Member
Hi, I am building a TTL computer using the 74F181 ALU. I am fairly far along in the project and I am coding now in machine code. One of the things that has come up as an issue pretty quickly is that there is no right hand bit shift available. The ALU has the usual ADD, Subtract, Increment, Decrement and many other logic functions, such as AND, NAND, OR, XOR, NOR, XNOR, NOT, etc.
My system data bus is 12 bits, so what would be especially useful is moving nibbles around. For example, moving the top nibble (the tribble?) to the bottom. Here is an example:
1011 0000 0000 becomes 0000 0000 1011
I could add some more hardware to do this, but my boards are already pretty jam-packed. The only way I have thought to do this in code is by doing a 16 case comparison. (4 bits = 16 cases).
Does anyone know any tricks using the math and logic functions to shift to the right? I'm not finding much with the search engines. Thanks! Michael
Here is a link to my project.
http://www.mtmscientific.com/stack.html
My system data bus is 12 bits, so what would be especially useful is moving nibbles around. For example, moving the top nibble (the tribble?) to the bottom. Here is an example:
1011 0000 0000 becomes 0000 0000 1011
I could add some more hardware to do this, but my boards are already pretty jam-packed. The only way I have thought to do this in code is by doing a 16 case comparison. (4 bits = 16 cases).
Does anyone know any tricks using the math and logic functions to shift to the right? I'm not finding much with the search engines. Thanks! Michael
Here is a link to my project.
http://www.mtmscientific.com/stack.html