J
joseph2k
Close on the keyboard thing, actually sending key number closures/openingsMooseFET said:It's a matter of personal preference.
Yes but what is the basis of this preference? Did a ROM maker say
something rude to you? :> That would be a good reason.
[....]Why?
Lets try a simpler example: I want to make a box that finds the
length of the third side of a triangle when two sides and the angle
are known. This is the equation:
Z = SQRT( X*X + Y*Y - 2*X*Y*COS(Angle))
Lets imagine that we are going to use Newton's method to find a square
root.
Newton's method works like this:
INPUT Y
TryValue = SomeGuessMethod(Y)
Loop till good enough
NewValue = Y / TryValue
TryValue = (TryValue + NewValue)/2
end loop
PRINT "The squareroot is ", TryValue
One of the very nice thing about this way of finding the square root
is that the accuracy of the TryValue grows very quickly. The number
of digits it is good to doubles every time around the loop. The
problem is that you need to come up with an initial guess. Always
guessing 1.0 initially does work but it takes a large number of loops
to find the square root of a million if you start that way.
Adding a fairly simple look up table will get the answer much quicker.
Another issue pops up for the example equation that it needs the value
2.0. Since 2.0 is 1.0+1.0, the value can be generated but this costs
more time.
There is also the method for finding the cos() to consider. Most
cosine routines use a look up table to find the exact cosine of a
nearby angle and how the curve is changing in that area. In just a
few steps, you can have a quite exact cosine if you do this. There
are other ways of finding the cosine that don't need any tables. I
bet you've already guessed why those aren't used.
[....]I don't use zip, unless I really need to. So far, I've never had to.
Winzip is a pain in the @$$.
Yes it is gzip, pkzip and UncleBobsZip will do better than WinZip.
They all take time to do however.
Is the ROM built into the keyboard?
There is a ROM in the keyboard and one in the PC. Inside the keyboard
is a little micro-controller with a ROM. It keeps track of which
buttons you push etc. This information is sent to the PC. Back in
the days of DOS, it was then the ROM in the PC that assigned the keys
their ASCII codes.
It may sound funny to make it take too steps to do the assigning of
the ASCII but there is a very good reason for it. The basic keyboard
design could be used all around the world. The BIOS could be made
different from country to country to handle the differences in what
the keys mean.
(which is what the original IBM PC did) is absurdly handy to handle shift,
control, alt etc., keys and other multiple keypresses (control-alt-delete)
as well as simplifying keyboard design.