| | Re: Rotating through a four-bit nibble Kevin L. Clague
|
| | (...) Well, your example has the nibble of interest in the middle of the register. Due to boundary conditions, it might be cheaper to have it in the least significant bits of the 16 bit register. In your example you are rotating by an aribtrary (...) (19 years ago, 21-Sep-05, to lugnet.robotics)
|
| | |
| | | | Re: Rotating through a four-bit nibble Kevin L. Clague
|
| | | | (...) Since I didn't really complete the assignment I'll try again. I didn't honor the x bit request. I confirmed that even SDK v2.5 does not have shifts or rotates, and that in NQC you can only do shifts based on constant amounts. The two routines (...) (19 years ago, 21-Sep-05, to lugnet.robotics)
|
| | | | |
| | | | | | Re: Rotating through a four-bit nibble Brian Davis
|
| | | | | (...) Both your 1st & 2nd solutions are very good; thanks to you and other posters to this thread for giving me a much better handle on binary manipulations, and solutions to this problem. In answer to an earlier question, speed is important (simple (...) (19 years ago, 22-Sep-05, to lugnet.robotics)
|
| | | | | |
| | | | | | | Re: Rotating through a four-bit nibble Kevin L. Clague
|
| | | | | (...) Maybe it is time to move on to BrickOS? int rotate_right( int value, // the value to be rotated int width, // the width of the rotated field int base, // bitnumber of rightmost bit in rotate field int amount) // the amount to rotate between (...) (19 years ago, 22-Sep-05, to lugnet.robotics)
|
| | | | | |
| | | | | | | Re: Rotating through a four-bit nibble Brian Davis
|
| | | | | (...) BrickOS has mocked me from the horizon for some time, but there are two things that are holding me back: (a) Judging by the posts and what I've read, the learning curve seems awfully steep - especially since I'm on a Mac. (b) Rarely have I (...) (19 years ago, 22-Sep-05, to lugnet.robotics)
|
| | | | | |
| | | | Re: Rotating through a four-bit nibble Jordan Bradford
|
| | | | (...) Why in the world wouldn't the firmware support shifting? The hardware (URL) certainly does>. Heh, using multiply and divide to simulate shifting is kind of backwards. (19 years ago, 22-Sep-05, to lugnet.robotics, FTX)
|
| | | | |
| | | | | | Re: Rotating through a four-bit nibble Geoffrey Hyde
|
| | | | "Jordan Bradford" <bradfj23REMOVE_THIS...uwosh.edu> wrote in message news:In7A20.1sK1@lugnet.com... (...) The problem is, multiplication and division to a binary CPU, as is the case here, is just a whole series of instructions. Here is the basic (...) (19 years ago, 22-Sep-05, to lugnet.robotics)
|
| | | | |
| | | | | | Re: Rotating through a four-bit nibble Jordan Bradford
|
| | | | (...) Understand what better? Binary math? No problems with that! By "backwards" I meant that multiplication and division by powers of 2 are usually changed to shift L/R by compilers. Also, I am amused that because the firmware doesn't use the (...) (19 years ago, 22-Sep-05, to lugnet.robotics, FTX)
|
| | | | |
| | | | | | Re: Rotating through a four-bit nibble Kevin L. Clague
|
| | | | (...) Kev (...) Nice to hear from another bit twiddler.... (...) I do find it ironic that the firmware suports bitwise AND and OR, but not XOR, and also not shifts. Gack! Well, at least we're not having to use loops to add things to themselves to (...) (19 years ago, 22-Sep-05, to lugnet.robotics, FTX)
|
| | | | |
| | | | | | Re: Rotating through a four-bit nibble Jordan Bradford
|
| | | | (...) With that limitation we'd be creating a register (or Turing) machine simulator, too. It would be interesting to see a real-world processor that only has increment and decrement instructions. I'm thinking the LEGO firmware doesn't support these (...) (19 years ago, 29-Sep-05, to lugnet.robotics, FTX)
|
| | | | |