Subject:
|
Re: Rotating through a four-bit nibble
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 29 Sep 2005 20:07:55 GMT
|
Viewed:
|
1708 times
|
| |
| |
In lugnet.robotics, Kevin L. Clague wrote:
|
In lugnet.robotics, Jordan Bradford wrote:
|
In lugnet.robotics, Geoffrey Hyde wrote:
|
Jordan Bradford bradfj23REMOVE_THIS_SPAM_THINGY@uwosh.edu wrote in
message news:In7A20.1sK1@lugnet.com...
|
In lugnet.robotics, Kevin L. Clague wrote:
Why in the world wouldnt the firmware support shifting? The hardware
certainly does.
Heh, using multiply and divide to simulate shifting is kind of backwards.
|
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 principle explained, partway down the page:
http://www.evergreen.edu/biophysics/technotes/misc/binmath.htm
A link to binary addition and subtraction, from HowStuffWorks article on
binary (its actually a framed link to a different site, may have to cut
out the frame addition if it doesnt work properly), note how it
essentially works the same as decimal multiplication/division - also
partway down the page.
http://computer.howstuffworks.com/framed.htm?parent=bytes.htm&url=http://www.math.grin.edu/~rebelsky/Courses/152/97F/Readings/student-binary.html
Hope this helps you understand it better! :)
|
|
Kev
|
Understand what better? Binary math? No problems with that!
|
Nice to hear from another bit twiddler....
|
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 doesnt use the H8/300s shift instructions for whatever
reason, people are now trying to write software simulations of a trivial
hardware operation.
|
I do find it ironic that the firmware suports bitwise AND and OR, but not
XOR, and also not shifts. Gack!
Well, at least were not having to use loops to add things to themselves to
simulate multiplying by a power of two!
|
With that limitation wed 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.
Im thinking the LEGO firmware doesnt support these other instructions because
the RCX language (and ROBOLAB ?, which Ive never used) isnt likely to need
them, so they saved space by not including them.
|
|
Message is in Reply To:
| | Re: Rotating through a four-bit nibble
|
| (...) 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)
|
13 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|