Skip to main content

Timeline for Addition modulo 26 in Digital Logic

Current License: CC BY-SA 3.0

12 events
when toggle format what by license comment
Apr 12, 2013 at 22:58 vote accept captncraig
Apr 11, 2013 at 21:51 comment added supercat @Andyaka: The question is how to reduce a 6-bit number which is known to be in the range 0-50 modulo 26. It's worthwhile to note that what is required here is much like BCD arithmetic (except modulo 26 rather than modulo 10), and processors with BCD support generally behave oddly when adding two digits whose sum (including carry in) is greater than 19.
Apr 11, 2013 at 21:45 answer added fgrieu timeline score: 1
Apr 11, 2013 at 21:26 answer added Dave Tweed timeline score: 6
Apr 11, 2013 at 21:18 comment added Andy aka The S+(32-26)+32 is a cool idea @supercat. In above comment I meant test for =>26
Apr 11, 2013 at 21:15 comment added Andy aka Getting the remainder after subtracting 26 seems a good approach but... you need to test if the number is greater than 26 first. I believe this can be done with two ANDs and two ORs. Then you'll need to test the remainder in (in case it was 52 or greater originally) and possibly subtract 26 once more? OK just seen that the original numbers were<26
Apr 11, 2013 at 20:39 comment added Tim There's not many 'tricks' you can do for modulo in digital logic (assuming you're not doing mod power of two). It's essentially a messy division operation or looping and subtracting. I would expect any solution to this to feel a bit 'clunky'.
Apr 11, 2013 at 20:36 comment added captncraig @Andy, yes. That is what I need.
Apr 11, 2013 at 20:32 comment added Andy aka Is this your question in a nutshell... How do I convert a 6 bit number to mod 26?
Apr 11, 2013 at 20:21 comment added supercat Could the result of computing S-26 be used somehow to determine whether S is greater than 25? Also, since S-26 is the same as S+(32-26)-32, might it be conceptually easier to think in terms of computing (S+6) and dropping the high bit?
Apr 11, 2013 at 19:49 comment added Brian Carlton Why would you want to do this? Is this homework?
Apr 11, 2013 at 19:45 history asked captncraig CC BY-SA 3.0