8 ms·
I love this answer. For some reason, I've been dreaming about negative numbers lately. I think they deserve their own number set notation.
by godmodus 10y ago
I love this answer.
For some reason, I've been dreaming about negative numbers lately. I think they deserve their own number set notation.
- dnautics 10y agothe standard IEEE floating point uses a 'sign and magnitude' system. Negative numbers are basically made by flipping a single bit. I've been playing around with a number system that expresses real numbers as two's complement (like how integers work) - xor all your bits and then add one. In this system, 0 is -0 and the number that is weird for signed integers: 0b100000...0000 is infinity. Now, there's an exponent and a fraction, too. I've been playing around with how to do these numbers with logic gates (and verilog!) and you can either two's complement the whole thing and work with absolute values, or you can keep the fraction part as a two's complement... So I just redid multiplication using two's complemented fractions! And addition/subtraction too, which for floating points in general is significantly harder than multiplication. The nice thing about two's complemented floating points is you don't need separate algorithms for addition and subtraction; you can just do everything with one algorithm.
- espeed 10y agoHave you seen "Stanford Seminar: Beyond Floating Point: Next Generation Computer Arithmetic"? https://www.youtube.com/watch?v=aP0Y1uAA-2Y https://www.youtube.com/watch?v=aP0Y1uAA-2Y
- dnautics 10y agoWell, I'm the guy in the black shirt who did the demo. If you liked that lecture, I'm already starting on some verilog implementations. This is an example multiplication 8 bit * 8 bit -> 16 bit unpacked (20 bits). It differs from standard floating point in that the fractions are stored as two's complement. It takes a little bit of wrapping your head around, but the hidden bit for negative numbers is actually -2 ! Moment of zen. https://github.com/interplanetary-robot/mullinengine/blob/master/multiplier/posit_mult.v https://github.com/interplanetary-robot/mullinengine/blob/ma...
- AndrewOMartin 10y ago@espeed didn't ask if you contributed significantly to the lecture, they asked if you'd seen it. Please stick to the question!
- nitrogen 10y agoIf you are unsure why you were downvoted, I strongly suspect it's because politely giving and receiving due credit are important, knowing that one's interlocutor was involved in specific research is very useful information (to know what questions to ask), and it's probably kind of rude to call someone to account in this manner. Hope this helps :)
- AndrewOMartin 10y agoI was being sarcastic on a whim, fully aware that it would attract downvotes.
- espeed 10y agoWay cool -- I realized that when I checked out your profile just after posting the comment -- what timing -- I discovered the video a few days ago when looking for precise/compact interval representations. Interesting work indeed. Has there been much traction for getting major chip manufacturers to implement this? I know they're all looking for the next big thing and Intel is working on specialized neuromorphic chips. A general "drop-in" replacement for floating point seems like an opportunity for a general-purpose win from low-hanging fruit: Intel Gets Serious About Neuromorphic, Cognitive Computing Future https://news.ycombinator.com/item?id=13623846 https://news.ycombinator.com/item?id=13623846
- dnautics 10y agowell seeing as how John invented these numbers literally two months ago, I haven't seen any traction yet! But I am persuing fundraising opportunities. In the demo I showed how you can effectively reduce the bitwidth to 8 bits and still train in a very trivial machine learning exercise. I'm currently enrolled in the udacity machine learning class and implementing everything in parallel in julia so that I can try more complicated architectures using posits. I do have a hardware architecture in mind for how to very effectively and efficiently execute machine learning calculations using posits.
- jacobolus 10y agoWhat do you mean by “number set notation”?
- k__ 10y agoSpeaking of number sets. I never understood why complex numbers are considered one. I mean, yes they "are" a set, but besides that they are completely different. All number sets I learned about did fill some gaps in one dimension, but complex numbers somehow added a new dimension. Like real numbers stood in an entirely different context to rational numbers than complex numbers stood to real numbers.
- deleted 10y ago[deleted]
- mr_pink 10y agoC (complex numbers) is a field, just like R (real numbers). It's an algebraically closed field, unlike R, so in some sense it's actually the most natural set to call "numbers". https://en.wikipedia.org/wiki/Algebraically_closed_field https://en.wikipedia.org/wiki/Algebraically_closed_field
- k__ 10y agoI'm not trying to argue for R being more a set than C. In my head a one dimensional thing like R is fundamentally different from a multidimensional thing like C.
- mr_pink 10y agoWell I was answering the question about why is C considered numbers - it's a field, hence elements of C behave exactly like numbers. Moreover, it's an 'algebraic closure' of R, hence a more natural choice for "all numbers", and it's a maximal one at that (i.e. quaternions and such are no longer fields and don't really behave like numbers, while C still does). Edit: FWIW, I consider the terminology of 'real' vs 'imaginary' completely stupid and misleading. This terminology didn't really make it to other languages, e.g. in Russian it's 'material' vs 'complex' numbers, but they don't use the term 'imaginary'.
- cousin_it 10y ago