View Single Post
  #64   Report Post  
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
Jasen Betts[_2_] Jasen Betts[_2_] is offline
external usenet poster
 
Posts: 331
Default "Random" Circuit Needed.

On 2015-04-18, rickman wrote:
On 4/17/2015 10:56 PM, Jasen Betts wrote:
On 2015-04-17, rickman wrote:
On 4/17/2015 7:51 AM, Jasen Betts wrote:

one 16 bit - 7 bit subtract
one 16 bit + 0 bit add with carry.

I'm not following. Are you saying a modulo 65537 operation can be done
with two adders?


yes.


I appreciate the effort in the drawing, but that isn't needed. Knowing
that you use adders doesn't help me understand how the arithmetic works.
Is there a simple explanation? BTW, what do you do with bit 16 on the
input? Is that a typo? Does it go with the lsbs or the msbs?


It's a typo (or a fence-post error).

this is the arithmetic in c:

// a=a % 65537 in c:

a = a & 0xffff - ( a & ~ 0xffff ) 16;
a = a0 ? a & 0xffff + 1 : a ;

--
umop apisdn