DSPRelated.com
Forums

Strange things happen with ADSP2185 and l5 register. HELP!!!

Started by Andre March 23, 2004
Jerry Avins wrote:

(snip)

> I used to keep pad and pencil in my night stand. Sometimes what I saw on > it in the morning was nonsense, sometimes it was good, but the most > frustrating were the true insights that might as well have been written > by a stranger.
> When I was a sophomore in high school, a friend a year older posed me > this puzzle, where each letter stands for a digit, and the addition is > correct: > > SEND > + MORE > ������� > MONEY > > > I struggled with it on and off through day without cracking it, and > though the answer was on my nightstand pad the next morning, I still had > no coherent method for solving it.
BEGIN { for(a=0;a<10;a++) { for(b=0;b<10;b++) { if(a==b) continue; for(c=0;c<10;c++) { if((a+b)%10 != c) continue; if(a==c || b==c) continue; for(d=0;d<10;d++) { if(a==d || b==d || c==d) continue; for(e=0;e<10;e++) { if(a==e || b==e || c==e || d==e) continue; if((10*(d+e)+a+b)%100 != 10*b+c) continue; for(f=0;f<10;f++) { if(a==f || b==f || c==f || d==f) continue; if(e==f) continue; for(g=1;g<10;g++) { if(a==g || b==g || c==g || d==g) continue; if(e==g || f==g) continue; for(h=1;h<10;h++) { if(a+b-c+10*(d+e-b)+100*(b+f-d)+1000*(g-9*h-f)!=0) continue; print g b d a "," h f e b "," h f d b c; } } } } } } } } } Says: 9567,1085,10652 in less than a second. If you have awk or gawk.
U-CDK_CHARLES\Charles wrote:

> On Thu, 25 Mar 2004 16:25:29 -0500, Jerry Avins <jya@ieee.org> wrote: > >>Jaime Andres Aranguren Cardona wrote: >> >>When I was a sophomore in high school, a friend a year older posed me >>this puzzle, where each letter stands for a digit, and the addition is >>correct: >> >> SEND >> + MORE >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >> MONEY >> >>I struggled with it on and off through day without cracking it, and >>though the answer was on my nightstand pad the next morning, I still had >>no coherent method for solving it. >> >>Jerry > > > Jerry, > > The first clue is the carry. The largest any column addition can be is > 9 + 9 + 1 (carry) or 19. Therefore M = 1. That gives you a limited > number of possibilities for S, and so on. We had to develop programs to > solve these sorts of puzzles in Algorithms as an excercise in > backtracking. > > Charles
Another clue is that s+1 = o or 0+10, and [e+o or e+o+1 = n or n+10 and n+r or n+r+1 = e or e+10] Together, they show that o=0, that n=e+1, and that d+y carries. The rest follows quickly (if one cares). Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
glen herrmannsfeldt wrote:

> Jerry Avins wrote: > > (snip) > >> I used to keep pad and pencil in my night stand. Sometimes what I saw on >> it in the morning was nonsense, sometimes it was good, but the most >> frustrating were the true insights that might as well have been written >> by a stranger. > > >> When I was a sophomore in high school, a friend a year older posed me >> this puzzle, where each letter stands for a digit, and the addition is >> correct: >> >> SEND >> + MORE >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >> MONEY >> >> >> I struggled with it on and off through day without cracking it, and >> though the answer was on my nightstand pad the next morning, I still had >> no coherent method for solving it. > > > BEGIN { > for(a=0;a<10;a++) { > for(b=0;b<10;b++) { > if(a==b) continue; > for(c=0;c<10;c++) { > if((a+b)%10 != c) continue; > if(a==c || b==c) continue; > for(d=0;d<10;d++) { > if(a==d || b==d || c==d) continue; > for(e=0;e<10;e++) { > if(a==e || b==e || c==e || d==e) continue; > if((10*(d+e)+a+b)%100 != 10*b+c) continue; > for(f=0;f<10;f++) { > if(a==f || b==f || c==f || d==f) continue; > if(e==f) continue; > for(g=1;g<10;g++) { > if(a==g || b==g || c==g || d==g) continue; > if(e==g || f==g) continue; > for(h=1;h<10;h++) { > if(a+b-c+10*(d+e-b)+100*(b+f-d)+1000*(g-9*h-f)!=0) continue; > > print g b d a "," h f e b "," h f d b c; > } > } > } > } > } > } > } > } > } > > Says: 9567,1085,10652 > > in less than a second. If you have awk or gawk.
Right answer. Nice code. I couldn't do it that way in 1947. I had to think about the problem, not about a program. I don't know which is more fun. Did you have a reason for not using s, e, n, d, m, o, r, and y as the variable names? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message
news:40636820$0$3040$61fed72c@news.rcn.com...
> glen herrmannsfeldt wrote: > > > Jerry Avins wrote: > > > > (snip) > > > >> I used to keep pad and pencil in my night stand. Sometimes what I saw
on
> >> it in the morning was nonsense, sometimes it was good, but the most > >> frustrating were the true insights that might as well have been written > >> by a stranger. > > > > > >> When I was a sophomore in high school, a friend a year older posed me > >> this puzzle, where each letter stands for a digit, and the addition is > >> correct: > >> > >> SEND > >> + MORE > >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; > >> MONEY > >> > >> > >> I struggled with it on and off through day without cracking it, and > >> though the answer was on my nightstand pad the next morning, I still
had
> >> no coherent method for solving it. > > > > > > BEGIN { > > for(a=0;a<10;a++) { > > for(b=0;b<10;b++) { > > if(a==b) continue; > > for(c=0;c<10;c++) { > > if((a+b)%10 != c) continue; > > if(a==c || b==c) continue; > > for(d=0;d<10;d++) { > > if(a==d || b==d || c==d) continue; > > for(e=0;e<10;e++) { > > if(a==e || b==e || c==e || d==e) continue; > > if((10*(d+e)+a+b)%100 != 10*b+c) continue; > > for(f=0;f<10;f++) { > > if(a==f || b==f || c==f || d==f) continue; > > if(e==f) continue; > > for(g=1;g<10;g++) { > > if(a==g || b==g || c==g || d==g) continue; > > if(e==g || f==g) continue; > > for(h=1;h<10;h++) { > > if(a+b-c+10*(d+e-b)+100*(b+f-d)+1000*(g-9*h-f)!=0)
continue;
> > > > print g b d a "," h f e b "," h f d b c; > > } > > } > > } > > } > > } > > } > > } > > } > > } > > > > Says: 9567,1085,10652 > > > > in less than a second. If you have awk or gawk. > > Right answer. Nice code. I couldn't do it that way in 1947. I had to > think about the problem, not about a program. I don't know which is more > fun. Did you have a reason for not using s, e, n, d, m, o, r, and y as > the variable names?
Jerry: My dad posed this one to me (and my brothers) when I was a teenager. I solved it. This was just before our family got its first computer (Atari 400), so I didn't have a computer, but it was a fun problem. However, in order to write a program to solve it, you already would have had to solve it by thought (get the gist of how to solve it, which was 95% of the problem). Therefore, the two methods are equally "fun", because you can't write a computer program to do it until you get the "trick" (which is something that, in general, most coders don't understand, and hence we (as a community) typical end up with way too much code to innefficiantly solve a simple problem)). As a side note, I was always amazed that the Atari failed in the personal computer market. Their "Atari 400" was much advanced compared to Apple 2, Commodore, TRS-80, and the IBM XT (which came about some time later, I think), with respect to sound and graphics (IMO). I think the mistake Atari made was that they envisioned the PC as a game machine. At the time (early 80's), PCs were only purchased/used at home by computer enthusiasts, to which games were a side note to computing, and thus Atari's lack of success (IMHO). Add to that the fact that programs were cartridge based, rather than floppy disk (which made them less, shall we say, "shareable"). But, isn't it funny that PCs have now become, to the home users at least, game machines and/or internet appliances. How many home users of PCs actually write programs for them? 10%? 5%? And copywrite laws and protection have made it difficult and illegal to copy CDs, so cartridges would be 6:1 1/2dozen:other compared to CDs. Atari was just a bit ahead of their time. Jim
On 2004-03-26, Jim Gort <jgort@comcast.net> wrote:
> As a side note, I was always amazed that the Atari failed in the personal > computer market. Their "Atari 400" was much advanced compared to Apple 2, > Commodore, TRS-80, and the IBM XT (which came about some time later, I > think), with respect to sound and graphics (IMO).
Sorry, but i can't let you diss the C64 w/r/t to the Atari 400 in a side note without at least a (friendly...) discussion of the technical merits of each of these chips. The two chips are actually very closely matched. The C64's SID had 3 voices, while the Pokey had 4. However, the C64 voices used 16-bit phase-accumulators to generate waveforms, compared to the pokey's 8-bit dividers. It was possible, though, to combine two 8-bit divider Pokey devices to make a 16-bit divider voice. The advantage of large dividers is increased frequency resolution, meaning more accurate scales. The rule (as derived in http://gweep.net/~shifty/portfolio/musicratios/index.html) is the number of accurate octaves is (N-4), where N is the number of divider bits. Therefore, an 8-bit divider is accurate for 4 octaves, where a 16-bit is accurate for 12. BTW, the accuracy calculation is equally valid for phase accumulators, which are, virtually multipliers in relation to the dividers. So, the Pokey could get an extra voices, at the expense of frequency resolution, which is more flexible than the SID, but ultimately less overall quality. Anyway, from the viewpoint of Digital Signal Processing, there's another important distinction to point out between dividers and phase accumulators. Phaseaccs are subject to pitch noise which dividers are not. This is because their phase is not reset to zero upon each accumlator overflow. So, the SID has some pitch noise which Pokey does not. Um, I just realized that I could go on about this stuff for a few more hours, and i have work to do today, so at this point, I'll cease. -- different MP3 every day! http://gweep.net/~shifty/snackmaster . . . . . . . . ... . . . . . . "Maybe if you ever picked up a goddamn keyboard | Niente and compiler, you'd know yourself." -Matthew 7:1 | shifty@gweep.net