-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding negative trit values to bytes #9
Comments
I'm not sure, but I have a feeling that we are trying to tackle more that one obstacle with the same recipe. But I don't think we have one-solution-fits-all-problems here. First of all, I don't think we should leave anything up to the OS/architecture. (Unless, ........, see exception below.) But, let's agree separate the issues:
A) numbers B) - Streams I haven't had time to do the maths here. But I believe in such a solution, the last trit transferred, will influence all the bits in the transaction. Meaning we cannot start converting before we have received all trits. Pro: We only waste at the maximum 7 bits (if converting to bytes), A compromise is to block ting off in smaller batches. That will waste more bits/trits, but the whole process is more manageable. C) IOTA tryte characters A huge benefit of this, is that having the IOTA tryte character, we have abstracted the whole trit question. We don't need to know anymore. The trit implementation is completely hidden away. And all we need to care about is the values 0-26 (as in asciiToTrytes.js) I think this is a great. Trits can be implemented by the hardware in the way they want. As long as it gets converted to 9A-Z, the application layer does not even need to know if it is balanced or unbalanced trits. This is the exception for the comment at the top. OS/Architecture should not dictate the application level. With the IOTA character abstraction layer, the to worlds can live separate. D) Conversions are "one-way" But when converting from, e.g. trits: even using B) you end up with only a subset of the possible bits after the conversion. You can convert back to the original. But you cannot use the same function to convert any of the superset's combinations. SummaryI feel like what I'm writing is not open for other ideas, and only arguing for my own view here. I don't mean to. I also feel that you are focused on a topic I regard as already solved in the lower level. I focus more in the application level. Maybe I don't see the same issues since I don't have the same knowledge as you. Do you agree with some of the bullet points above? |
How does the process of encoding trits into bytes work when the trits represent a negative value?
For example, consider the following sequence of little-endian* trits:
00++000++--+-bal3
These trits represent the value -42424210.
How do we determine the length of the resulting binary sequence? +42424210 can be represented using 19 bits (11001111001001100102):
signed long
)?* (in this context, assume little-endian trits and bits — that's a whole 'nother can of worms!)
The text was updated successfully, but these errors were encountered: