| ??? 01/15/01 16:43 Read: times |
#8232 - RE: Volt=(165/255)*17.5 |
Free-Floating point binary.
=========================== (not IEEE floating point) I think no one pays attention to books on binary mathematics anymore because we think we've all learned everything about it before. We open a new book, see hex tables, chuckle, skip past it assuring ourselves that we are much more advanced than to read that section. That may be a mistake. You may find that if you force yourself to read through all the familiar hex tutorials etc., you'll come across the binary numbering system. Pay attention to the power series as it works for both sides of the ZERO. To review: Two to the power of zero we all know is commonly the first bit position in a byte. We know that it represents alone a value of either zero or one in decimal. Likewise two to the power of one is commonly the second bit (expanding leftward) and that bit takes on the value of zero or two in decimal. This we all know. Two to the power of NEGATIVE one takes on the values of zero or ONE HALF in decimal and this bit would be located one position to the RIGHT of our most familiar bit zero. We don't commonly see such a bit and our brains don't generally know where it would exist in our byte-centric world. Before I answer that, the NEGATIVE power series continues by halfs, just as the positive series contines by twos. Tow to the power of NEGATIVE two takes on the vales of zero or one fourth decimal and is two bits to the right of our common bit zero. Maybe you've read that and found it mathematically interesting but of no useful value. Unless someone tells you your microprocesser has fractional accumulators, why would you care about this abstract fact? Its not abstract. The missing key is that binary mathmatics DOESN'T CARE where the binary equivalent to the decimal point is located. We always place it at bit zero, the rightmost bit of our byte... BUT IT DOESN'T HAVE TO BE. We can take a byte and load it with a value encoded by a shifted power series (that's one way to say it) wherein the rightmost bit is instead of two to the power of zero, maybe two to the power of negative two, or even two to the power of positive five. The accumulator works just the same. You have to remember one thing you mathematics teacher once taught you when multiplying decimals by decimals... the decimal point of the result shifts based upon the numbers used. Think of it this way. When you learned to multiply and add as a child... did you have to learn a new system to handle decimal points? No... you only had to learn the modified rules for how decimals are treated in the addition or multiplication tables we already learned. The same is true in binary. Is 00100011B representing thirty five in decimal or is it representing seventeen point five? ANSWER: Either. Its whatever you treat it as. EXAMPLE: What is 17.5 x 3.25? 0010001.1B = 17.5 x 000011.01B = 3.25 = 000111000.111B = 56.875 Dropping the binary point (decimal point) we could calculate this in the 8051 as: 00100011B = 23H x 00001101B = 0DH = 000111000111B = 01C7H So does 01C7H represent 56.875 or does it represent 455 decimal? ANSWER: EITHER... Its whatever you treat it as. Pay attention to where the binary point MOVES under different operations (add, subtract, multiply, divide) when the numbers used have varying fractional component lengths. This is why I term it FREE-FLOATING POINT. You can CHOOSE when to chop or round off binary fractional components. This is the point where you begin to lose calculated precision. aka j |
| Topic | Author | Date |
| Volt=(165/255)*17.5 | 01/01/70 00:00 | |
| RE: Volt=(165/255)*17.5 | 01/01/70 00:00 | |
| RE: Volt=(165/255)*17.5 | 01/01/70 00:00 | |
| RE: Volt=(165/255)*17.5 | 01/01/70 00:00 | |
| RE: Volt=(165/255)*17.5 | 01/01/70 00:00 | |
| RE: Volt=(165/255)*17.5 | 01/01/70 00:00 | |
| RE: Volt=(165/255)*17.5 | 01/01/70 00:00 | |
RE: Volt=(165/255)*17.5 | 01/01/70 00:00 |



