>Google 翻蚳
http://webcache.googleusercontent.com/search?q=cache:mazonka.com/st/lcss.pdf#iT0urchwkbIJ
>
> ããŒãž1
>
>
> ? Subleqã«åºã¥ãåçŽãª ry
> Subleq ããŒã¹ã®ã·ã³ãã«ãªãã«ãããã»ããµã³ã³ãã¥ãŒã¿
>
>
> Oleg MazonkaãšAlex Kolodin
> mazonkaATgmail alex.kolodinATgmail
>
> 2011幎5æïŒæ¹èš3ãèæ¡8ïŒ
>
>
>
> æœè±¡
>
>? SubleqïŒçµæã®æžç®ãšåå²ã¯0ããå°ãããçããïŒã¯ãåœä»€ã»ããã³ã³ãã¥ãŒã¿ïŒOISCïŒã®åœä»€ ry èšèªã®äž¡æ¹ã§ãã
>Subleq ( æžç® ( Subtract ) ããããŠçµæã 0 ããå°ãã ( Less than ) ãçãã ( Equal ) ãªãã°åå² ( Branch ) ) 㯠1 åœä»€ã»ããã³ã³ãã¥ãŒã¿ ( One Instruction Set Computer , OISC ) ã®ãåœä»€ã»ãããšããã°ã©ãã³ã°èšèªãšã®äž¡æ¹ã§ãã
> æã
ã¯ãäœã³ã¹ãFPGAããŒãäžã«28åã®1åœä»€Subleqããã»ããµã®ã¢ã¬ã€ãããŒããŠã§ã¢ã§å®è£
ããããšã«ã€ããŠèª¬æããŸãã
> ç§ãã¡ã®ãã¹ãçµæã¯ãSubleq OISCãã«ãããã»ããµã®èšç®èœåã¯çŸä»£ã®ããŒãœãã«ã³ã³ãã¥ãŒã¿ã®CPUã®èšç®èœåã«å¹æµããããšã瀺ããŠããŸãã
> ããã«ãCã¹ã¿ã€ã«ã®èšèªããSubleqãŸã§ãã³ã³ãã€ã©ã®å®è£
ã®è©³çŽ°ãæäŸããŸãã
>
> å
容
>
> 1. ã¯ããã« . . . . 2
> 2. Subleqã¢ã»ã³ããªèšèª . . . 3
> 3. ããŒããŠã§ã¢èšèš . . . . 6
> 3.1 æŠèŠ . . . . 6
> 3.2 ã€ã³ã¿ãã§ãŒã¹ã®èª¬æ . . 7
> 3.3 Subleqããã»ããµ . . . 7
> 4. Subleqçšã®Cã³ã³ãã€ã© . . . 8
> 4.1ã¹ã¿ã㯠. . . . 8
> 4.2 åŒ . . . . 10
> 4.3 é¢æ°åŒã³åºã . . . 11
> 4.4 ã¹ã¿ãã¯å€æ° . . . 14
> 4.5 æãç® . . . . 15
> 4.6 æ¡ä»¶ãžã£ã³ã . . . 16
> 5. çµæ . . . . . 17
> 5.1 ãã¹ãïŒ1 . . . 17
> 5.2 ãã¹ãïŒ2 . . . 18
> 6. çµè« . . . . . 19
> 7. ä»é² . . . . . 21
> ? 7.1 Cãšä¹ç® ry
> 7.1 ä¹ç®ããã® C . . . 21
> 7.2 ä¹æ³ãªãã®C . . . 21
> 7.3 Subleqã³ãŒã . . . 22
> åèæç® . . . . . 23
>
>
> ?1?
>
> ããŒãž2
>
>
> 1. ã¯ããã«
>
> ? ry ãåœä»€æ°ã1ã«æžå°ããŸãã
> OISCïŒOne Instruction Set ComputerïŒã¯ãåŸæ¥ã®CPUãæèŒãã究極ã®RISCïŒReduced Instruction Set ComputerïŒã§ãããåœä»€æ°ã1ã«çž®å°ãããŠããŸãã
> ? ry ããªãã³ãŒãã®å¿
èŠæ§ããªããªãããã ry èŠçŽ ãå¯èœã«ãªããåãæ°ã®è«ç ry ãŠã§ã¢ã§ããå€ãã®åœä»€ãå®è£
ããããšãå¯èœã«ãªãã
>å©çšå¯èœãªããã»ããµåœä»€ã1ã€ã ãã§ããäºã¯ãªãã³ãŒãã®å¿
èŠæ§ãæ¹æ¶ããããŠãããåçŽãªèšç®èŠçŽ ã蚱容ãåŸã£ãŠããå€ãã®ããããå®è£
ããäºããè«çã²ãŒããåæ°æããããŒããŠã§ã¢ã§å¯èœãšããã
> æã
ã®ç®æšã¯ãåäžã®äœã³ã¹ãããã°ã©ããã«ãããäžã«å¯èœãªéãå€ãã®ããã»ããµãåããæ©èœçãªãã«ãããã»ããµã·ã¹ãã ãæ§ç¯ããããšã ã£ãã®ã§ã
> OISCã¯èªç¶ãªéžæã§ãããæ®ãã®ã¹ãããã¯é©åãªã·ã³ã°ã«ããã»ããµåœä»€ã»ããã®éžæã§ãã£ãã
>
> çŸåšç¥ãããŠããOISCã¯å€§ãã3ã€ã®å€§ããªã«ããŽãªãŒã«åããããšãã§ããŸãã
>
> ? 1.ãã©ã³ã¹ããŒããããã¢ãŒããã¯ãã£ã®ãã·ã³ã
> 1.転éããªã¬åã¢ãŒããã¯ãã£ã®ãã·ã³ã
> ? ãããæäœæ©æ¢°; 2ã
> 2. ããããããã¥ã¬ãŒã·ã§ã³ãã·ã³ ;
> 3.ç®è¡ããŒã¹ã®ãã¥ãŒãªã³ã° - ã³ã³ããªãŒãã»ãã·ã³ã
>
> ãã©ã³ã¹ããŒãããªã¬ã¢ãŒããã¯ãã£ïŒTTAïŒã¯ãèšç®ãããŒã¿è»¢éã®å¯äœçšã§ããèšèšã§ãã
> éåžžãå
±éã¢ãã¬ã¹ç©ºéå
ã®ããã€ãã®ã¡ã¢ãªã¬ãžã¹ã¿ïŒããªã¬ããŒãïŒã¯ãåœä»€ãããããåç
§ãããšãã«å²ãåœãŠãããåäœãå®è¡ããŸãã
> äŸãã°ãåäžã¡ã¢ãªå¯Ÿã¡ã¢ãªã³ããŒåœä»€[1]ãå©çšããOISCã§ã¯ãæžã蟌ã¿æã«ç®è¡ããã³åœä»€ãã€ã³ã¿ãžã£ã³ããå®è¡ããããŒããããªã¬ããããšã«ãã£ãŠãããè¡ãããã
> é
åçãªåçŽãã«ããããããããã®ãããªOISCã«ã¯2ã€ã®å€§ããªæ¬ ç¹ããããŸãã
> 第1ã«ãCPUã¯ãããªã¬ããŒããå¶åŸ¡ããå¥åã®æ©èœãŠããããæããå¿
èŠãããã
> 第2ã«ã2ã€ã®ç°ãªãããŒããŠã§ã¢èšèšã¯2ã€ã®ç°ãªãã¢ã»ã³ããªèšèªã䜿çšããå¯èœæ§ãé«ããããèšèšã®äžè¬åã¯å°é£ã§ãã
> ? ry ããã®ã¯ã©ã¹ã®OISCã¯å®è£
ãããŠããŸããã§ããã
> ãããã®æ¬ ç¹ã®ããããã®ã¯ã©ã¹ã® OISC ãæã
ã®å®è£
ãšããŠé€å€ããŸããã
>
> Bit Manipulating Machinesã¯æãç°¡åãªã¯ã©ã¹ã§ãã
> ? ry ãåœä»€[2]ã®ãªãã©ã³ãã®1ã€ã§æå®ãããã¢ãã¬ã¹ã«ç¡æ¡ä»¶ã«å®è¡ãæž¡ããŸãã
> BitBitJumpãšåŒã°ãããããã³ããŒãã·ã³ã¯ãã¡ã¢ãªå
ã®1ããããã³ããŒããåœä»€ã®ãªãã©ã³ãã®1ã€ã§æå®ãããã¢ãã¬ã¹ã«ç¡æ¡ä»¶ã«å®è¡ãæž¡ããŸã [2] ã
> ãã®ããã»ã¹ã¯ãæ®éçãªèšç®ãå¯èœã§ããããšãå€æããŠããïŒããªãã¡ã
> ? ry ã§ããä»ã®æ®éçãªãã·ã³ã解éãã ry ã³ããŒããããšã«ãããå®è¡ãããã³ãŒããæ¡ä»¶ä»ãã§ä¿®æ£ããããšãã§ããããã§ããã
>ä»»æã®ã¢ã«ãŽãªãºã ãå®è¡ããããšãã§ãããããŠä»»æã®ä»ã®ãŠãããŒãµã«ãã·ã³ãã€ã³ã¿ããªãããããšãã§ããïŒããªããªããããããã³ããŒããããšã«ãããã³ãŒããå®è¡ã«å
ç«ã£ãŠæ¡ä»¶ä»ãã§ä¿®æ£ããããšãã§ããããã§ããã
> Togaã³ã³ãã¥ãŒã¿ãšåŒã°ããå¥ã®ãã·ã³ã¯ãããããå転ããå転ã®çµæã«å¿ããŠæ¡ä»¶ä»ãã§å®è¡ããã¹ããŸã[3]ã
> BitBitJumpã«äŒŒããããã«å¥ã®ãããæŒç®ãã·ã³ã¯ãåæã«ããã€ãã®ããããã³ããŒããŸãã
> ? ry ãèšç®äžã®æ±çšæ§ã®åé¡ã解決ããã[4]ã
> ãã®å Žåããããããå®çŸ©ããããžã£ã³ãããŒãã«ãã¡ã¢ãªã«ä¿æããããšã«ãããæ±çšçèšåé¡ã解決ããã[4]ã
> ãããæäœãã·ã³ã®åçŽãã«ãããããããå®äŸ¡ãªFPGAã§æ®éã«å©çšå¯èœãªã¡ã¢ãªãããå€ãã®ã¡ã¢ãªãå¿
èŠãšãããããæã
ã¯ããããæé€ããŸããã
> ? ãããæäœæäœã§æ©èœ ry ã
> ããããããã¥ã¬ãŒã·ã§ã³ã§æ©èœãããã«ãããã»ããµãã·ã³ãäœæããã«ã¯ãããã»ããµãããå°ãªããšã1Mbã®ã¡ã¢ãªãå¿
èŠã§ãã
> ãããã£ãŠãç§ãã¡ã¯ãããå°ãªãã¡ã¢ãªãæã€ããè€éãªããã»ããµãŒãç§ãã¡ã®ç®çã«ãšã£ãŠããè¯ãéžæã§ãããšå€æããŸããã
>
>
> ?2?
>
> Page 3
>
>
> ç®è¡ããŒã¹ã®ãã¥ãŒãªã³ã°å®çµåãã·ã³ã¯ãç®è¡æŒç®ãšæ¡ä»¶ä»ããžã£ã³ãã䜿çšããŸãã
> ? ry ã®ä»¥åã®ã¯ã©ã¹ ry ããã®ã¯ã©ã¹ã¯æ®éçãªãã®ã§ãããæœè±¡çè¡šçŸã§ã¯ãã¥ãŒãªã³ã°å®å
šã§ãã
> ãŠãããŒãµã«ã³ã³ãã¥ãŒã¿ã§ãã2ã€ã®åè¿°ã®ã¯ã©ã¹ã®æ§ã§ã¯ãªãããã®ã¯ã©ã¹ã¯ãŠãããŒãµã«ãªããããŠæœè±¡çè¡šçŸã«æŒãŠã®ããã¥ãŒãªã³ã°å®å
šã§ãã
>? ry ãã¡ã¢ãªå
ã®ã¢ãã¬ã¹ ry ã
>åœä»€ã¯ãã¡ã¢ãªå
ã¢ãã¬ã¹ã§ãã£ãŠãããæŽæ°ã§åäœããã
> ? ry ãç°ãªãç®è¡æŒç®[5]ã«åºã¥ããŠããã®ã¯ã©ã¹ ry ã®OISCãååšããã
> çŸåšãç°ãªãç®è¡æŒç®ã«åºã¥ããããã®ã¯ã©ã¹ã®ããã€ãã®æ¢ç¥ã® OISC ãååšãã [5] ã
> ? è¿œå ïŒ Addleqãæžå°ïŒ DJNãå¢åïŒ P1eqãšæžç®ïŒ Subleq ïŒçµæã®æžç®ãšåå²ã¯0ããå°ãããçããïŒã
> å ç® - Addleqããã¯ãªã¡ã³ã - DJNãã€ã³ã¯ãªã¡ã³ã - P1eq ããããŠæžç® - Subleq ( æžç®ãããŠçµæã 0 ããå°ãããçããéã«åå² ) ã
> åŸè
ã¯æãå€ããæãäžè¬çã§ãããééããªãæãå¹ççã§ãã[6] [7]ã
> ? ry .2ã€ã¯æžç®çšã2ã€ã¯æ¡ä»¶ãžã£ã³ãçšã§ãã
> Subleqåœä»€ã¯3ã€ã®ãªãã©ã³ãã§æ§æãããŠããŸã.2ã€ã¯æžç®çšã1ã€ã¯æ¡ä»¶ãžã£ã³ãçšã§ãã
>
> ? Subleqã®åšãã«ããŒããŠã§ã¢ã ry ã
> Subleq ç³»ã«ããŒããŠã§ã¢ãæ§ç¯ããããšããè©Šã¿ã¯ä»¥åããè¡ãããŠããŸããã
> äŸãã°ãDavid A Robertsã¯Subleq CPUãèšèšãããœãããŠã§ã¢Subleqã©ã€ãã©ãª[8]ãæžããã
> 圌ã®å®è£
ã¯ãããŒããŒãå
¥åã端æ«ãå¶åŸ¡ROMãããã³16Mbã®RAMãåããåäžã®CPUã§ãããç§ãã¡ããã¯ããã«è€éã§ãã
> ããŸããŸãªã€ã³ã¿ãŒããããµã€ãã§èšè¿°ãããä»ã®åæ§ã®ãã¶ã€ã³ãããã€ããããŸãããäŸãã°[9]ã
> ãããããããã®ãã¹ãŠã¯ãå®çšçãªå®è£
ããªãããŠããªãæŠå¿µå®èšŒã·ãã¥ã¬ãŒã·ã§ã³ã§ããã
>
> 以äžã®ã»ã¯ã·ã§ã³ã§ã¯ãæ§ç¯ããã·ã¹ãã ã®ã³ã³ããŒãã³ãã«ã€ããŠèª¬æããŸãã
> 第2ç¯ã§ã¯ãSubleqæœè±¡æ©æ¢°ãšãã®ã¢ã»ã³ããªèšæ³ãæŠèª¬ããã
> ã»ã¯ã·ã§ã³3ã§ã¯ããã«ãããã»ããµã³ã¢ã®ããŒããŠã§ã¢å®è£
ã«ã€ããŠèª¬æããŸãã
> ã»ã¯ã·ã§ã³4ã§ã¯ãé«æ°Žæºããã°ã©ãã³ã°èšèªãSubleqåœä»€ã³ãŒãã«å€æããããã«äœ¿çšãããææ³ã«ã€ããŠç°¡åã«èª¬æããŸãã
> ã»ã¯ã·ã§ã³5ãš6ã§ã¯ãããã€ã¹ã®ã¹ããŒããã¹ãçµæãæ¯èŒãããã£ã¹ã«ãã·ã§ã³ãšèŠçŽã瀺ããŸãã
> ä»é²ã§ã¯ãéä¹ãèšç®ããã³ãŒããCããã³Subleqã®è¡šèšæ³ã§ç€ºãããŠããŸãã
>
>
> SubleqãœãããŠã§ã¢< - USB - >ãã©ã€ããããã°ã©ãã³ã°ç°å¢
>
> å³1 FPGAããŒãã¯USBã±ãŒãã«ã§PCã«æ¥ç¶
>
>
> å³1ã¯ãUSBã±ãŒãã«ã䜿çšããŠããã€ã¹ãšã³ã³ãã¥ãŒã¿ãæ¥ç¶ããç¶æ
ã瀺ããŠããŸãã
>
> 2. Subleqã¢ã»ã³ããªèšèª
>
> Subleqæœè±¡æ©æ¢°ã¯ãåã»ã«ãæŽæ°ãä¿æããç¡éã®ã¡ã¢ãªé
åäžã§åäœããã
> ãã®æ°ã¯ãå¥ã®ã¡ã¢ãªã»ã«ã®ã¢ãã¬ã¹ãšããããšãã§ããã
> çªå·ã¯0ããå§ãŸããŸãã
> ? ããã°ã©ã ã¯ãã¢ãã¬ã¹ãŒãã§ç¬¬1ã®åœä»€ãçšããŠã¡ã¢ãªããèªã¿åºãããäžé£ã®åœä»€ãšããŠå®çŸ©ãããã
> ããã°ã©ã ã¯ã 0 çªå°ã«ããæåã®åœä»€ããã¡ã¢ãªããèªåºãããã·ãŒã±ã³ã¹ãšããŠå®çŸ©ãããã
> Subleqåœä»€ã«ã¯3ã€ã®ãªãã©ã³ãããããŸãã
>
> A B C
>
> ? 1ã€ã®åœä»€ABC ry ã
> 1 ã€ã®åœä»€ A B C ãå®è¡ãããšãBã«æ ŒçŽãããã¢ãã¬ã¹ã®ã¡ã¢ãªã»ã«ã®å
容ããAã«æ ŒçŽãããã¢ãã¬ã¹ã®ã¡ã¢ãªã»ã«ã®å€ãæžç®ããããã®çµæãBã®ã¢ãã¬ã¹ã®ã»ã«ã«æžãæ»ãããŸãã
> Bã®æžç®åŸã®å€ããŒã以äžã®å Žåãå®è¡ã¯Cã§æå®ãããã¢ãã¬ã¹ã«ãžã£ã³ãããŸãã ãããªããã°ãå®è¡ã¯æ¬¡ã®åœä»€ãããªãã¡Cã«ç¶ãã¡ã¢ãªã»ã«ã®ã¢ãã¬ã¹ã«é²ãã
>
>
> ?3?
>
> Page 4
>
>
> ã¢ã»ã³ããªèšæ³ã¯ãSubleqã§ã³ãŒããèªã¿æžãããã®ã«åœ¹ç«ã¡ãŸãã
> æ§æã¯æ¬¡ã®ãšããã§ãã
>
> ïŒ ã©ãã«;
> ïŒ çå笊;
> ïŒ çž®å°åœä»€;
> ïŒ ãã«ãåœä»€;
> ïŒ ãªãã©ã«ãšåŒã
> ïŒ ããŒã¿ã»ã¯ã·ã§ã³ã
> ïŒ ã³ã¡ã³ãã
>
> ã©ãã«ã¯ãã³ãã³ãåŸã«ç¶ãç¹å®ã®ã¢ãã¬ã¹ã®èšå·çãªååã§ãã
> 次ã®äŸã§ã¯
>
> A B C
> A:2 B:1 0
> C:B B 0
>
> åè¡ã¯3ã€ã®ãªãã©ã³ããæã€1ã€ã®åœä»€ãè¡šããŸãã
> ããã§ãAãBãCã¯æœè±¡åã§ã¯ãªããã¡ã¢ãªå
ã®ç¹å®ã®ã»ã«ã®ã©ãã«ïŒã¢ãã¬ã¹ïŒã§ãã
> ããšãã°ãã©ãã«Aã¯4çªç®ã®ã»ã«ãåç
§ããå€2ã§åæåãããŸãã
> ? æåã®åœä»€ã¯ãã»ã«Bã®å€ããã»ã«Aã®å€ãæžç®ãããã®å€ã1ãšããçµæãã»ã«Bã«æ ŒçŽããŸãããã®å€ã¯-1ã«ãªããŸãã
> æåã®åœä»€ã¯ãã»ã« A ã®å€ãã»ã« B ã®å€ããã®å€ 1 ããæžç®ããçµæãã»ã«Bã«æ ŒçŽããŸãããã㯠-1 ã«ãªããŸãã
> çµæã¯ãŒãããå°ããã®ã§ãå€Cã¯ç¬¬3è¡ã®åœä»€ã®ç¬¬1ãªãã©ã³ãã®ã¢ãã¬ã¹ã§ããããã次ã«å®è¡ãããåœä»€ã¯ç¬¬3è¡ã§ããã
> ããã¯BããBãæžç®ããŠãŒãã«ããã®ã§ãå®è¡ã¯ã¢ãã¬ã¹0ã«æž¡ãããŸãã
> ãããã®3è¡ãããã°ã©ã å
šäœã§ããå Žåãæåã®åœä»€ã®ç¬¬1ãªãã©ã³ãã¯ã¢ãã¬ã¹0ãæããã
> ãã®å Žåãå®è¡ã¯B -2ãšãªãæåã®åœä»€ã«æ»ãããã
> ãã®ããã»ã¹ã¯æ°žé ã«ç¶ãã
> å®è¡ãããåœä»€ã¯1è¡ç®ãš3è¡ç®ã®ã¿ã§ãããã»ã«Bã®å€ã¯1ã-1ã0ã-2ã0ã-2ã0ãªã©ã®ããã«å€åããŸãã
>
> çå笊ã¯ã¡ã¢ãªå
ã®æ¬¡ã®ã»ã«ã®ã¢ãã¬ã¹ãšããŠå®çŸ©ãããŸãã
>
> A B ?
> B B 0
>
> ? ?ãšåãã§ã
> ã¯ä»¥äžãšåãã§ã
>
> A B C
> C:B B 0
>
> ? åœä»€ãã©ãŒãããã®çž®å°ã¯äŸ¿å© ry ãã€ãŸãïŒ
> çž®å°åœä»€ãã©ãŒãããã¯äŸ¿å©ãªã·ã§ãŒãã«ããã§ãïŒ3ã€ã§ã¯ãªã2ã€ã®ãªãã©ã³ãã次ã®åœä»€ã®ã¢ãã¬ã¹ãã€ãŸã ; ? ã
> ? 1ã€ã®ãªãã©ã³ãã ãã第2ã®ãã®ã第1ã®ãã®ãšåãã§ãããšã¿ãªãã®ã§ã
> ãããŠãªãã©ã³ã 1 ã€ã ãã ãšç¬¬ 2 ã®ãã®ã第 1 ã®ãã®ãšåãã§ãããšã¿ãªãã®ã§ã
>
> A
>
> ? ?ãšåãã§ã
> ã¯ä»¥äžãšåãã§ã
>
> A A
>
>
> ?4?
>
> Page 5
>
>
> ? ?ãšåãã§ã
> ãããŠä»¥äžãšåãã§ã
>
> A A ?
>
> åãè¡ã«è€æ°ã®åœä»€ã眮ãããŠããå Žåã¯ãæåŸã®åœä»€ã«ã»ãã³ãã³ãç¶ãå¿
èŠããããŸãã
> ? 次ã®ã³ãŒãã¯ã
> 次ã®ã³ãŒãã¯å€ãA ãã B ãžã³ããŒããŸãïŒ
>
> ? AããBïŒZ; B; AZ; ZB
> Z; B; A Z; Z B
>
> AïŒ72ã®ãããªæŽæ°ã¯ã³ãŒãå
ã®å®æ°ãšããŠäœ¿çšãããŸãã
> ãªãã©ã«ã¯ãASCIIå€ãä»®å®ããŠæŽæ°ã®ä»£ããã«äœ¿çšã§ããŸãã
> ããšãã°ãAïŒ 'H'ã¯AïŒ72ãšåãã§ãã AïŒ "Hi"ã¯AïŒ 'H' 'i'ãšåãã§ãã
> å ç®ãæžç®ãæ¬åŒ§ãããã³åé
ãã€ãã¹ãåŒã§äœ¿çšã§ããŸãã
> ? ZZâ+3 ABCDEF
> ã³ãŒã
>
> Z Z ?+3
> A B C
> D E F
>
> ã¯ãZããŒãã«èšå®ãã第3ã®åœä»€DE Fã«ãžã£ã³ãããã
>
> ? åœä»€ãæžããããšãã§ãããããã¢ã»ã³ãã©ã¯3ã€ã®ãªãã©ã³ãã§å®å
šãªåœä»€ãçæããã¿ã€ãã³ã°ãç¥ãå¿
èŠããããŸãã
> åœä»€ãçž®å°ã§ããçºãã¢ã»ã³ãã©ã¯ 3 ãªãã©ã³ããªå®å
šãªåœä»€ããã€çæããããç¥ãå¿
èŠããããŸãã
> ãã®ãããªçæãé¿ããããã«ãè¡é ã®ããªãªãã䜿çšãããŸãã
> ãããã£ãŠãããã°ã©ã ããŒã¿ã¯ãã®ãããªè¡ã«çœ®ãããšãã§ããŸãã
> ã³ãŒã
>
> A A ?+1
> . U:-1
> U A
>
> ? Aã«1ã ry ã
> 㯠A ã« 1 ãèšå®ããŸãã
> 2è¡ç®ã«ããªãªãããªããšãã³ãŒãã¯æ¬¡ã®ããã«è§£éãããŸãã
>
> A A ?+1
> U:-1 (-1) ?
> U A
>
> ã³ã¡ã³ãã¯ããã·ã¥èšå·ïŒã§åºåãããŠããŸããïŒããè¡æ«ãŸã§ã¯ãã¹ãŠã³ã¡ã³ãã§ãã
> è² ã®ã¢ãã¬ã¹ã«ãžã£ã³ããããšãããã°ã©ã ãåæ¢ããŸãã
> 第3ãªãã©ã³ããšããŠéåžžã¯ïŒ-1ïŒã䜿çšããŠããã°ã©ã ãåæ¢ããŸããããšãã°ã次ã®ããã«ãªããŸãã
>
> ïŒåæ¢
> Z Z (-1)
>
> 3çªç®ã®ãªãã©ã³ãã§ããããšã瀺ãããã«ã¯ãïŒ-1ïŒã®ååŸã®ãã£ããå¿
èŠã§ãããããã£ãŠãåœä»€ã¯æ¬¡ã®ããã«è§£éãããŸããã
>
> Z Z-1 ?
>
> ? ããã°ã©ã ry ã
> Subleq ããã°ã©ã ãã€ã³ã¿ã©ã¯ãã£ãã«ããïŒããŒã¿ãèŠæ±ããŠäœæ¥äžã«ãŠãŒã¶ã«å¿çããïŒããã«ãå
¥åããã³åºååäœã¯ãååšããªãã¡ã¢ãªã»ã«ã«å¯ŸããåäœãšããŠå®çŸ©ããããšãã§ããã
> ããã«ã¯åãïŒ-1ïŒã¢ãã¬ã¹ã䜿çšã§ããŸãã
> 第2ãªãã©ã³ããïŒ-1ïŒã®å Žåã第1ãªãã©ã³ãã®å€ãåºåã«ãªããŸãã
> 第1ãªãã©ã³ããïŒ-1ïŒã®å Žåã第2ãªãã©ã³ãã¯å
¥åã¹ããªãŒã ããå€ãååŸããŸãã
> å
¥åºåæäœã¯ãã€ãåäœã§ASCIIã³ãŒãã§å®çŸ©ãããŠããŸãã
> ããã°ã©ã ã255ãã倧ããå€ãåºåããããšãããšããã®åäœã¯æªå®çŸ©ã§ãã
>
> ? ry [10]ã®ãHello ry ã
> 以äžã¯Lawrence Woodman helloworld.sq [10] ããé©å¿ããããHello worldãããã°ã©ã ã§ãã
>
>
> ?5?
>
> Page 6
>
>
> ããã¯éåžžã«ç°¡æœã§ãããSubleqå¹çã®è¯ãäŸã§ãã
>
> L:H (-1); U L; U ?+2; Z H (-1); Z Z L
> U:-1 H:"hello, worldÂ¥n" Z:0 ããã«ã¡ã¯ãäžçÂ¥ n
>
> Subleqã§ã¯ãZãšåŒã°ããç¹å¥ãªå€æ°ãéåžžã«å°ããªç¯å²å
ã§äžéã®äžæå€æ°ãšããŠäœ¿çšãããããšããããããŸãã
> ? ry ã䜿çšããšã«0 ry ã
> éåžžããã®å€æ°ã¯ãŒãã§åæåãããæ¯äœ¿çšåŸã« 0 ã«ãªã£ãŠãããšä»®å®ããŸãã
>
> äžèšã®ããã°ã©ã ã¯5ã€ã®åœä»€ã§æ§æãããŠããŸãã
> ? The first instruction prints the character pointed by its first operand (the first pointer) which is initialised to the beginning of the data string ? the letter 'h'.
> ? ry ãæãæåãåºåããŸããæå 'h'ã
> æåã®åœä»€ã¯ãããŒã¿æååã®å
é ã«åæåãããæåã®ãªãã©ã³ãïŒæåã®ãã€ã³ã¿ïŒãæãæå - 'h' ãåºåããŸãã
> ? The second instruction increments that pointer ? the first operand of the first instruction.
> ? ry ãã€ã³ã¿ãã€ã³ã¯ãªã¡ã³ãããŸããïŒ æåã®åœä»€ã®æåã®ãªãã©ã³ãã
> 2çªç®ã®åœä»€ã¯ãã®ãã€ã³ã¿ -æåã®åœä»€ã®æåã®ãªãã©ã³ã- ãã€ã³ã¯ãªã¡ã³ãããŸãã
> 第3ã®åœä»€ã¯ã第4ã®åœä»€ã®ç¬¬2ã®ãªãã©ã³ãã§ãã第2ã®ãã€ã³ã¿ãã€ã³ã¯ãªã¡ã³ãããã
> ? ry ãã¹ãããå€ã ry ã
> 第4ã®åœä»€ã¯ã第2ã®ãã€ã³ã¿ãæãå€ããã¹ããããã®å€ããŒãã§ãããšãã«ããã°ã©ã ãåæ¢ãããã
> ? ãã€ã³ã¿ãŒãZïŒ0ã®ããŒã¿ã¹ããªã³ã°ã®çµããã®åŸã®ã»ã«1ã«å°éãããšãŒãã« ry ã
> ããŒã¿ã¹ããªã³ã°ã®çµããã®äžã€åŸã® Z:0 ãªã»ã«ã«ãã€ã³ã¿ãå°éãããšé¶ã«ãªããŸãã
> ? ry ã«ãŒãããã¯ããã®ã§ãããã»ã¹ã¯åæ¢æ¡ä»¶ ry ã
>5çªç®ã®åœä»€ã¯ããã°ã©ã ã®å
é ã«ã«ãŒããæ»ãã®ã§ãããã»ã¹ã¯ /HALT ( /ã¢ãµãŒã /ãã²ãŒã ) æ¡ä»¶ãæºããããªããªããŸã§ç¶ããŸãã
> 3. ããŒããŠã§ã¢èšèš
>
> 3.1 æŠèŠ
>
> ? ry å®è£
ã®åºç€ãšããŠäœ¿çšããŸããã
> ã¢ã«ãã©ã®Cyclone III EP3C16 FPGAãããŒããŠã§ã¢å®è£
ã®ããŒã¹ãšããŠæã
ã¯äœ¿çšããŸããã
> ? ry ïŒçŽ30ç±³ãã«ïŒ ry ã
> ãã®éžæã¯ããã®FPGA ICãããã®æ¯èŒçäœäŸ¡æ Œ ( é«ããšãçŽ $30 ) ãšããã®ããã®ãã¹ãããŒããŠã§ã¢ã®å¯çšæ§ã«åºã¥ããŠããŸãã
>
> 䜿çšãããã¹ãããŒãã«ã¯DDR2 RAM ICãè£
åãããŠããŸãããRAMãžã®ã¢ã¯ã»ã¹ã¯äžåºŠã«1ããã»ã¹ã«å¶éãããŠããŸãã
> çã®äžŠåå®è£
ã§ã¯ãããã»ããµããšã«å¥ã
ã®å
éšã¡ã¢ãªãããã¯ãå²ãåœãŠãããŠãããããFPGAå
ã®äœ¿çšå¯èœãªã¡ã¢ãªéã«ãã£ãŠããã»ããµæ°ãå¶éãããŸãã
> EP3C16 FPGAã«ã¯ããããã8Kãããã®16ãããã¡ã¢ãªãããã¯56åããããŸãã
> ? 32ãããã®Subleqã ry ã
> æã
ã® 32bit Subleq ããã»ããµã1ã€å®è£
ããã«ã¯ãæäœ2ã€ã®ã¡ã¢ãªãããã¯ãå¿
èŠã§ãããã®ãããFPGAã«ã¯28åã®ããã»ããµããæèŒã§ããŸããã
> ç§ãã¡ã¯16ãããå®è£
ãéžæããããå€ãã®ããã»ããµïŒæ倧56ïŒãæã€ããšãã§ããŸãããããããã«å²ãåœãŠãããã¡ã¢ãªã¯ããã1Kãã€ãã§ãã
>
> ? ry ããŒã¿ãFPGAã«ããŒãããããã«äœ¿çšãããUSBãšSPIïŒ ry ïŒéã®ã®ããªããžãšããŠæ§æãããå€éšãµã€ãã¬ã¹FX2 CPUã® ry ã
> FPGAã¯ãã³ãŒããšããŒã¿ãšã FPGA ã«ããŒãããçºã«æçšãª SPI ( ã·ãªã¢ã«ããªãã§ã©ã«ã€ã³ã¿ãŒãã§ã€ã¹ ) ãš USB ãšã®éã®ããªããžãšããŠæ§æããããšã¯ã¹ã¿ãŒãã«ãªãµã€ãã¬ã¹ FX2 CPU ã®å©ããåããŠUSBãã¹ã«æ¥ç¶ãããŠããŸãã
> ã€ã³ã¿ãŒãã§ã€ã¹ããªããžã¯ãPCãœãããŠã§ã¢ã«å¯ŸããŠééçã§ãã
>
>
> ( FPGA
> MEMORY < - > PROCESSOR1 < - > (
> ã¡ã¢ãª< - >ããã»ããµ2 < - >
> ã¡ã¢ãª< - >ããã»ããµ3 < - >
> : : < - > SPI < - > CONTROL_CPU < - > USB
> ã¡ã¢ãª< - >ããã»ããµ7 < - >
> ã¡ã¢ãª< - >ããã»ããµ8 < - > ))
>
> å³2 ããŒãã®ãããã¯å³
>
>
> ?6?
>
> Page 7
>
>
> å³2ã¯ããŒãã®éä¿¡ãããã¯å³ã§ãã
> ? ry ã§ã³ãŒãåããã ry ã
> ãã®ãœãªã¥ãŒã·ã§ã³ã¯VHDLã§ã³ãŒãã£ã³ã°ãããã¢ã«ãã©ã®Webãµã€ãããèªç±ã«å
¥æã§ããQuartus II Web EditionãœãããŠã§ã¢ã§ã³ã³ãã€ã«ãããŠããŸãã
> ? ry åœç€Ÿã® ry ã
> æã
ã®ã³ãŒãã¯ã倧èŠæš¡FPGAã§äœ¿çšå¯èœãªæ倧63ããã»ããµãŸã§ã¹ã±ãŒã©ãã«ã§ãã
> 63ããã»ããµã®å¶éã¯SPIãã¹ã®ã¢ãã¬ãã·ã³ã°ã®å®è£
ã«ãããã®ã§ãå¿
èŠã«å¿ããŠå¢ããããšãã§ããŸãã
>
> 28åã®ããã»ããµã¯ãã¹ãŠç¬ç«ããŠåäœããPCBã«åãä»ããããåºæºçºæ¯åšããFPGA PLLã®1ã€ã§çæãããåäžã®150 MHzã¯ããã¯ã«ãã£ãŠåæãããŸãã
>
> ããã»ããµæ°ãå¢ããã«ã¯ãFPGAãæèŒããããŒããUSBãã¹çµç±ã§ç°¡åã«æ¥ç¶ããããšãã§ããŸãã
>
> 3.2 ã€ã³ã¿ãŒãã§ãŒã¹ã®èª¬æ
>
> åããã»ããµã«ã¯ãå²ãåœãŠãããã¡ã¢ãªãžã®ã·ãªã¢ã«ã€ã³ã¿ãã§ãŒã¹ãšã¹ããŒã¿ã¹ãã€ãããããåäžã¢ãã¬ã¹ã®ã·ãªã¢ã«ããŒãããã¢ã¯ã»ã¹ã§ããŸãã
> ? ã·ãªã¢ã«ã€ã³ã¿ãã§ãŒã¹ã¯ãåŠçãåæ¢ãããšã ry ã
> ã·ãªã¢ã«ã€ã³ã¿ãã§ãŒã¹ã¯ãããã»ãã·ã³ã°ãåæ¢ãããšãã¡ã¢ãªã®ããŒã¿ãã¹ãšã¢ãã¬ã¹ãã¹ãåŒãç¶ããŸãã
>
> FPGAå
éšã®ã¢ãã¬ã¹ç©ºéã¯ãããã»ããµã€ã³ããã¯ã¹ãšã¡ã¢ãªã¢ãã¬ã¹ãšãã2ã€ã®æ°å€ã«ãã£ãŠã¢ãã¬ã¹æå®ãããããŒãã«ãšããŠç·šæãããŠããŸãã
> ã€ã³ããã¯ã¹0ãã1ãã€ããèªã¿åããšãFPGAå
éšã®ããã»ããµæ°ãè¿ãããŸãã
> ãã®èšèšã§ã¯ãæ»ãå€ã¯28ã§ãã
> 1ãã28ã®ã€ã³ããã¯ã¹ãããã»ããµã«å²ãåœãŠããã2048ãã€ãïŒ512ãããã®32ãããã¯ãŒãïŒã®ã¡ã¢ãªããããã䜿çšå¯èœã§ãã
>
> ããã»ããµã¡ã¢ãªãžã®æžã蟌ã¿ã¯ã2048ãã€ãã®ãããã¡ãé 次ããŒãããåäœã§ããã
> ããã»ããµã®ã¡ã¢ãªããã®èªã¿åºãã¯ç°ãªããŸããæåã«è¿ãããã¯ãŒãïŒ4ãã€ãïŒã¯ããã»ããµã®ã¹ããŒã¿ã¹ã§ãæ®ãã¯ã¡ã¢ãªã®å
容ã§ãã
>
> ? ã¹ããŒã¿ã¹ãã€ã - æåã®åèªã® ry åæ¢ããå®è¡ããŸããã
> ã¹ããŒã¿ã¹ãã€ã - æåã®ã¯ãŒãã®æåã®ãã€ã - ã¯æ¬¡ã®3ã€ã®ç¶æ
ã®ããããã«ãªããŸãã0xA1 - å®è¡äžã0xA2 - åæ¢ãããã0xA0 - é»æºãå
¥ã£ãŠããåæ¢ãããŠå®è¡ããã
> ããã»ããµã®ã¡ã¢ãªã«æžã蟌ããšèªåçã«å®è¡ãéå§ããããããå¥ã®ã³ãã³ãã§åŠçããå¿
èŠã¯ãããŸããã
> ããã»ããµã®ã¡ã¢ãªããèªã¿åºããšããã®ããã»ããµãåæ¢ããŸãã
> ? äŸå€ã¯ããã»ããµãŒãåæ¢ãããªãç¶æ
ã®æåã®ãã€ããèªã¿åãããšã§ãã
> ãã®ããã»ããµãåæ¢ãããªã 1 ã€äŸå€ã¯ã¹ããŒã¿ã¹ã®å
é ãã€ãã®èªåãã§ãã
> ããã«ãããã»ããµã¯ãã»ã¯ã·ã§ã³2ã§è¿°ã¹ãããã«ãSubleqåæ¢ãªãã©ã³ãïŒ-1ïŒã«ãã£ãŠåæ¢ããããšãã§ããŸãã
> äžèšã®Subleqã¢ã»ã³ããªèšèªã»ã¯ã·ã§ã³ã§èª¬æããå
¥åãåºåãªã©ã®ä»ã®è² ã®åç
§ãããã®ã¢ãŒããã¯ãã£ã§IOæäœãå®çŸ©ãããŠããªãããããã»ããµãåæ¢ããŸãã
>
> 3.3 ãµãã¬ãã¯ããã»ããµ
>
> ã¹ããŒããã·ã³ã¢ã«ãŽãªãºã ã¯ä»¥äžã®ããã«æ¬äŒŒã³ãŒãã§è¡šçŸã§ããŸãã
>
> ããIP = 0
> ããwhile (IP >= 0)
> ãã{
> ããããA = memory[IP] // A =ã¡ã¢ãª[IP]
> ããããB = memory[IP+1]
> ããããC = memory[IP+2]
> ããããif (A < 0 or B < 0): // ifïŒA <0ãŸãã¯B <0ïŒïŒ
> ãããã{
> ããããããIP = -1
> ãããã}
> ããããelse:
> ãããã{
> ããããããmemory[B] = memory[B] - memory[A]
> ããããããif (memory[B] > 0)
> ããããããããIP = IP + 3
> ããããããelse:
> ããããããããIP = C
> ãããããã}
> ãããã}
>
>
> ?7?
>
> Page 8
>
>
> IPã¯åœä»€ãã€ã³ã¿ãmemory []ã¯ã¡ã¢ãªã»ã«ã®å€ãAãBãCã¯æŽæ°ã§ããã
>
> Subleqããã»ããµã»ã³ã¢ã¯ããã¥ã¢ã«ã»ããŒãã»ã¡ã¢ãªã»ã¢ã¯ã»ã¹ãæ§ç¯ããããã«äœ¿çšããQuartus IIãœãããŠã§ã¢ã®RAM 2ããŒãã¡ã¬ãã¡ã³ã¯ã·ã§ã³ã®å©ããåããŠæžãããŠããŸãã
> ? ry ãåŠçã¯ããã¯ãã£ãã¯ãç¯çŽããŸãã
> å®è£
ããããœãªã¥ãŒã·ã§ã³ã¯ã2ã€ã®ç°ãªãã¢ãã¬ã¹ïŒã¡ã¢ãª[A]ãšã¡ã¢ãª[B]ïŒã§åæã«ã³ã³ãã³ãã«ã¢ã¯ã»ã¹ããããšãå¯èœã«ããåŠçã¯ããã¯æ°ãç¯çŽããŸãã
> ãã®å®è£
ã®æ¬ ç¹ã¯ãåäžã®ããŒãã¡ã¢ãªã®å®è£
ãšæ¯èŒããŠãããŒã¿ãã¹ãšã¢ãã¬ã¹ãã¹ã«ã¢ã¯ã»ã¹ããããã®1ã¯ããã¯ãã£ãã¯ã®è¿œå ã¬ã€ãã³ã·ã§ãã
> ãã ãããã¥ã¢ã«ããŒãã®ã¡ã¢ãªã¢ã¯ã»ã¹ãããã®åŠçã¯ããã¯ãã£ãã¯ã®åèšã¯ãåäžããŒãã«å¿
èŠãªã¡ã¢ãªã¢ã¯ã»ã¹ããããŸã å°ãªãã§ãã
>
> ã³ã¢ã¯ãããã»ããµã®ã¡ã¢ãªãããŒãããããšèªåçã«èµ·åããã¹ããŒããã·ã³ã«åºã¥ããŠããŸãã
> ? ãããã®èªã¿åºããŸãã¯æžã蟌ã¿æäœã«ãããŠãããŸãã¯è² ry ééãããšãåŠçã¯åæ¢ããããèšç® ry ãªãããã€ã§ã第1ã®ç¶æ
ãã€ããèªã¿åãããš ry ã
> èªåºåã¯æžèŸŒã®ãããã®æäœãåã¯è² ã®ãªãã©ã³ãã«ééããŠã®åŠçåæ¢ãã«æŒãŠãèšç®ã«åœ±é¿ãäžããããšãªãããã€ã§ãå
é ã®ã¹ããŒã¿ã¹ãã€ããèªåãäºãã§ããã
>
> 4. SubleqçšCã³ã³ãã€ã©
>
> ? ry ããã³ã³ãã€ã© ry ã
> ãã®ç¯ã§ã¯ãç°¡åãªCã³ãŒããSubleq [11]ã«ã³ã³ãã€ã«ããèªåã³ã³ãã€ã©ã®ããã€ãã®èŠçŽ ã«ã€ããŠç°¡åã«èª¬æããŸãã
> ? ry ãã¹ãã®1ã€ã§ãã³ã³ãã€ã« ry ã
> ã³ã³ãã€ã©ã¯ç§ãã¡ã®ãã¹ãã® 1 ã€ã§çšããåã C ãœãŒã¹ããã³ã³ãã€ã«ããããã€ãã£ã C ã³ãŒããš Subleq ã³ãŒããšã®å®è¡ã®éã§çŽæ¥æ¯èŒãå¯èœã§ãã
> ? The compiler is a high-level language interface to OISC ?
> ? ry ã³ã³ãã€ã© ry ã€ã³ã¿ãã§ãŒã¹ã§ããïŒ ç§ãã¡ã«ç¥ãããŠããå¯äžã®ãã®ãããªã³ã³ãã€ã©ã¯ãå·çã®æç¹ã§ã
> ãã®ã³ã³ãã€ã©ã¯OISCã®é«æ°Žæºèšèªã€ã³ã¿ãã§ãŒã¹ã§ã - ãã®æ§ãªã³ã³ãã€ã©ãšããŠå·çæç¹ã§ç§ãã¡ã«ç¥ãããŠããå¯äžã®ã
>
> 4.1 ã¹ã¿ãã¯
>
> ? ry äž»èŠãªCããã°ã©ãã³ã°èšèªã®æŠå¿µã¯ã ry ã
> C ããã°ã©ãã³ã°èšèªã®äž»èŠãªæŠå¿µã¯ãé¢æ°ãšã¹ã¿ãã¯ã§ãã
> ? ry ã¯ãã³ãŒãã®äžã®ã¡ã¢ãªã䜿çšããããšã§å®çŸ ry ã
> Subleqã§ã®ã¹ã¿ãã¯ã®å®è£
ã¯ãäžèšã³ãŒãçãªã¡ã¢ãªäœ¿çšã§å®çŸã§ããŸãã
> ? ryã®èªå·±ä¿®æ£ãäœ¿çš ry ãã¹ã¿ãã¯ã®å€ã«é
眮ããŠååŸããããšãã§ããŸãã
> ã³ãŒãã®èªå·±æžæã䜿çšãããšãã¹ã¿ãã¯ã«çœ®ããããã®å€ãã埩å
ãããã§ããŸãã
> é¢æ°åŒã³åºãã§ã¯ããªã¿ãŒã³ã¢ãã¬ã¹ãã¹ã¿ãã¯ã«é
眮ããå¿
èŠããããŸãã
> 以äžã®Cã³ãŒããèããŠã¿ãŸãããïŒ
>
> void f()
> {
> ...
> }
>
> void main()
> {
> ...
> }
>
> f();
> ...
> }
>
>
> ?8?
>
> Page 9
>
>
> äžèšããã·ã³ã³ãŒãã«ã³ã³ãã€ã«ããåŸã次ã®æäœãå®è¡ããå¿
èŠããããŸã
> ? 1ïŒfãåŒã³åºããçŽåŸ ry ã
> 1ïŒf ãåŒåºãçŽåŸã®åœä»€ã®ã¢ãã¬ã¹ãã¹ã¿ãã¯ã«çœ®ããªããã°ãªããªãã
> 2ïŒé¢æ°fã®ã³ãŒããžãžã£ã³ãããå¿
èŠããããŸã
> 3ïŒé¢æ°fã®çµããã«ãã¹ã¿ãã¯ããã®ã¢ãã¬ã¹ãæœåºããå¿
èŠãããã
> 4ïŒæœåºãããã¢ãã¬ã¹ã«å®è¡ã転éããå¿
èŠããããŸãã
> ? Cæšæºã«ããã°ã ry ã
> Cæšæºã«åŸããé¢æ°mainã¯é©åãªCé¢æ°ã§ããããªãã¡ãããèªèº«ãå«ãä»ã®é¢æ°ããåŒã³åºãããšãã§ããŸãã
> ãããã£ãŠãããã°ã©ã ã«ã¯å¥ã®ãšã³ããªãã€ã³ããå¿
èŠã§ãããã®ãšã³ããªãã€ã³ãã¯ã次ã®ã³ãŒãã§ã¯sqmainãšåŒã°ããŸãã
> äžèšã®Cã³ãŒãã¯æ¬¡ã®ããã«ã³ã³ãã€ã«ãããŸãïŒ
>
> 0 0 sqmain
> _f:
> ...
> #return
> ?+8; sp ?+4; ?+7; 0 ?+3; Z Z 0
> _main:
> ...
> #call f
> dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
> ?+6; sp ?+2; ?+2 0 _f; . ?; inc sp
> ...
> #return
> ?+8; sp ?+4; ?+7; 0 ?+3; Z Z 0
> sqmain:
> #call main
> dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
> ?+6; sp ?+2; ?+2 0 _main; . ?; inc sp
> 0 0 (-1)
> . inc:-1 Z:0 dec:1 sp:-sp
>
> ã»ã«ã¹ã¿ãã¯ãã€ã³ã¿spã¯ãããã°ã©ã å
ã®æåŸã®ã¡ã¢ãªã»ã«ã§ãã
> ããã¯ãããèªèº«ã®ã¢ãã¬ã¹ã®è² ã®å€ã§åæåãããŸãã
> ? A negative value is used here to speed up the code execution ?
> ? ry åããŸããïŒ
> ããã§è² ã®å€ã䜿çšããŠã³ãŒãå®è¡ãé«éåããŸã - ããŒã¿ãå®éã®å€ã®è² æ°ãšããŠèšé²ãããŠããå Žåãæžç®æäœã䜿çšãããšãããã€ãã®ã¹ããããç¯çŽããããšããããŸãã
> åœä»€dec spã¯spãã1ãåŒãã®ã§ããã®å®éã®å€ã¯1ã ãå¢å ããã
> ? Below is an excerpt calling the function f in more readable form ? relative references ?
> ? ry ãé¢æ°fãããèªã¿ããã圢ã§åŒã³åºãæç²ã§ãã çžå¯Ÿçãªåç
§ïŒ ã©ãã«ã«çœ®ãæããããŸãã
> 以äžã¯ãé¢æ° f ãåŒåºãããèªã¿æã圢 - çžå¯Ÿçãªåç
§ - ã©ãã«ã«çœ®æããããŸã - ã®æç²ã§ãã
>
> dec sp
> A; sp A
> B; sp B
> A:0 B:0
> C; sp C
> D C:0 _f
> . D:?
> inc sp
>
> ? ry ã¯ãªã¢ããããšã§ããããã¯ãååã®äœ¿çšæã«æ®ã£ãŠããå€ãããããã§ãã
> 4è¡ç®ã®åœä»€ã¯ãã¹ã¿ãã¯å
ã®ã»ã«ãã¯ãªã¢ããçºã§ãååã®äœ¿çšæã«å€ãæ®ããäºã«å ããŸãã
> ? ããããã¹ã¿ãã¯å
ã®æäžäœã»ã«ãã¯ãªã¢ ry ã
> ããããªãããã¹ã¿ãã¯å
ã®ãããã»ã«ãã¯ãªã¢ããããšã¯ãåœä»€èªäœã®ãªãã©ã³ããã¯ãªã¢ããŠããspãã€ã³ã¿ã®å€ã§åæåããå¿
èŠããããããåäžã¹ãããã®ã¿ã¹ã¯ã§ã¯ãããŸããã
> ? ry ã§ãã
> ãããã£ãŠãå®è¡ã³ãã³ãã·ãŒã±ã³ã¹ã¯æ¬¡ã®ãšããã§ã :
> ã¹ã¿ãã¯ãã€ã³ã¿ãå¢å ãããããšã«ãã£ãŠã¹ã¿ãã¯å
ã«æ°ããã»ã«ãå²ãåœãŠãïŒç¬¬1è¡ïŒã
> åœä»€ã®ç¬¬1ãªãã©ã³ããã¯ãªã¢ããã ãã®ãªãã©ã³ããã¹ã¿ãã¯ãã€ã³ã¿ã®æ°ããå€ã§åæåããïŒ2è¡ç®ïŒã
> ? do the same with the second operand of the instruction ?
> ? ry åãããšãããŸããïŒ
> åœä»€ã®ç¬¬2ãªãã©ã³ããšåãããšãããŸã - ã¯ãªã¢ããŠåæåããïŒ3è¡ç®ïŒã
> ? ãã®åœä»€ãå®è¡ãããšãã¹ã¿ãã¯å
ã®å²ãåœãŠãããã»ã« ry ã
> ãããŠãããããã®åœä»€ãå®è¡ãããšãã¹ã¿ãã¯å
ã®ã¢ãã±ãŒããããã»ã«ãã¯ãªã¢ãããŸãïŒ4è¡ç®ïŒã
>
> ? 次ã®2ã€ã®åœä»€ã¯ã ry ã
> åãæ§ã«æ¬¡ã® 2 ã€ã®åœä»€ã¯ãã»ã«Cãã¯ãªã¢ããŠåæåããŸãã
> ? The instruction DC:0 _f ry .
> The instruction D C:0 _f ry .
> ? åœä»€D CïŒ0_fã¯ã ry ã
> åœä»€ D C:0 _f ã¯ãåœä»€inc spã®ã¢ãã¬ã¹ãã¹ã¿ãã¯ã«ã³ããŒãã_ fã«ãžã£ã³ãããã
> ? ããã¯ãDã次 ry ä¿æããŠããããïŒ ry ïŒãCã¯ã¹ã¿ã㯠ry æããŠããããã§ãã
> ãããæ©èœããã®ã¯ãDã次ã®ã¡ã¢ãªã»ã«ã®å€ãä¿æããŠããïŒèŠããŠããŸããïŒïŒããã㊠C ãã¹ã¿ãã¯äžã®çŸåšæ¶å»ãããŠãããããã»ã«ãæããŠããã®ãçç±ã§ãã
>
>
> ?9?
>
> Page 10
>
>
> ? ry ãã©ãã«_fã«ãžã£ã³ãããŸãã
> ã¹ã¿ãã¯ã«æžã蟌ãŸããè² ã®å€ã¯ãã©ãã« _f ãžã®ãžã£ã³ãã匷å¶ããŸãã
>
> é¢æ°fã®å
éšã§ã¯ãã¹ã¿ãã¯ãã€ã³ã¿ãå€æŽããããšãã§ããŸãããé¢æ°ãçµäºããåã«ããã埩å
ãããšä»®å®ããŸãã
> ãããã£ãŠããªã¿ãŒã³ã³ãŒãã¯ã¹ã¿ãã¯ããæœåºãããã¢ãã¬ã¹ã«ãžã£ã³ãããªããã°ãªããŸããïŒ
>
> A; sp A
> B; A:0 B
> Z Z B:0
>
> ããã§ã¹ã¿ãã¯ãã€ã³ã¿spã®å€ã¯Aã«æžã蟌ãŸããåœä»€AïŒ0 Bã¯æ ŒçŽãããã¢ãã¬ã¹ãBã«ã³ããŒããã
> ? ry ãè² ã«æ ŒçŽããã ry ã
> ã¢ãã¬ã¹ãè² ã§æ ŒçŽãããæ£ã®å€ã埩å
ãããŠããŸãã
>
> ? ry ã ãã§ã¯ãããŸããã
> ã¹ã¿ãã¯ã¯ãªã¿ãŒã³ã¢ãã¬ã¹ãæ ŒçŽããã ããšããèš³ã§ã¯ãããŸããã
> ããã«ã€ããŠã¯ãåŸã®ãµãã»ã¯ã·ã§ã³4.3ãš4.4ã§èª¬æããŸãã
>
> 4.2 åŒ
>
> ? Cèšèªã®æäœã¯ãããŒã¯ãŒãã» ry ãšåŒã§ ry ã
> C èšèªã®ãªãã¬ãŒã·ã§ã³ã¯ãããŒã¯ãŒãã»ã¹ããŒãã¡ã³ããšåŒãšã§æ§æãããã¹ããŒãã¡ã³ãã§æ§æãããŸãã
> ? The syntax of keyword statements and expressions are best represented by Backus-Naur Forms (BNF) ?
> ? ry ïŒBNFïŒã«ãã£ãŠæãããè¡šçŸãããŸããïŒ æèèªç±ææ³ãè¡šãæšæºçãªæ¹æ³ã
> ããŒã¯ãŒãã¹ããŒãã¡ã³ããšåŒã®æ§æã¯Backus-Naur FormsïŒBNFïŒ - æèèªç±ææ³ãè¡šãæšæºçãªæ¹æ³ - ã«ãã£ãŠãã¹ãã«è¡šçŸãããŸã ã
> å€å
žçãªäŸã¯ãç®è¡åŒã®ææ³ã§ãïŒ
>
> expression:= åŒïŒ=
> term ? æé
> expression + term ? åŒ+çšèª
> expression - term ? è¡šçŸ - çšèª
> term:=
> primary äžæ¬¡
> term * primary ? æé*ãã©ã€ããª
> term / primary ã¿ãŒã /ãã©ã€ããª
> primary:= ãã©ã€ããªïŒ=
> identifier èå¥å
> constant å®æ°
> ( expression ) ïŒè¡šçŸïŒ
>
> ãããã®çžäºã«ååž°çãªå®çŸ©ã¯ãææ³çã«æå¹ãªä»»æã®åŒã®ããªãŒè¡šçŸãæ§ç¯ããããã«parserãšåŒã°ããããã°ã©ã ã«ãã£ãŠäœ¿çšã§ããŸãã
> ãã®ãã㪠ry 圹å²ã¯ãäžé£ã®åœä»€ãæŽç ry ã
> ã²ãšãã³ãã®ãããªããªãŒãæ§ç¯ãããã°ãã³ã³ãã€ã©ã®åœ¹å²ã¯ãåœä»€ã®ã·ãŒã±ã³ã¹ãæŽçããŠããã¹ãŠã®ãµãããªãŒã®çµæãããªãŒã«æž¡ãããããã«ããããšã§ãã
> ããšãã°ãåŒã®ããªãŒïŒ
>
> a + ( b - c )
>
> ? ããŒã ry å€æ°aãããã³ããŒ??ãã - ããšå€æ°bããã³cãããªããµãããªãŒãããªãã
> ã¯ã ããŒãã+ããå€æ° aãããã³ãããŒãã - ããšå€æ° b ããã³ c ãšãããªããµãããªãŒããããªãã
>
>
> å³
>
> a
>
> +
> b
> -
> c
>
>
> ? ry ãããã¯åŸã§ããã«äœ¿çš ry ã ry ã
> èšç®ãè¡ãããã«ãã³ã³ãã€ã©ã¯ããµãããªãŒã®çµæãæ ŒçŽããããã«äžæå€æ°ã䜿çšããå¿
èŠããããŸããããã¯åŸã«å ç®ã§äœ¿çšããå¿
èŠããããŸãã ãã®åŒããã倧ããªåŒã®äžéšã§ããå Žåãæœåšçã«ããã«äœ¿çšãããå¯èœæ§ããããŸãã
> ? ry ã§ã¯ãäžæçãªãã®ã¯1〠ry ã ry ã®äžæçãªãã®ãå¿
èŠã§ãã
> ãã®ç¹å®ã®äŸã§ã¯ããã³ãã©ãªã¯ 1 ã€ã ãå¿
èŠã§ãããäžè¬çã«ã¯å€ãã®ãã³ãã©ãªãå¿
èŠã§ãã
> åŒã¯æ¬¡ã®ã³ãŒãã«ã³ã³ãã€ã«ãããŸãïŒ
>
> t; b Z; Z t; Z
> c t
> a Z; Z t; Z
>
>
> ?10?
>
> Page 11
>
>
> æåã®è¡ã¯å€bãäžæçãªtã«ã³ããŒããŸãã
> 2è¡ç®ã¯ãäžæçãªå€ããå€cãæžç®ããŸãã
> ? ry ãã³ã³ãã€ã©ã¯ãµãããªãŒã§çµäºããŸãã
> ãã®æç¹ã§ããµãããªãŒãæºããŠã³ã³ãã€ã©ã¯çµäºããŸãã
> ãã®çµæã¯ãçæãããã³ãŒããšãèšç®ããããµãããªãŒã®å€ãä¿æããäžæå€æ°tã§ãã
> ä»åºŠã¯ã³ã³ãã€ã©ãè¿œå çšã®ã³ãŒããçæããŸãã
> ? ãã®åŒæ°ã¯å€æ°aãšäžætã§ãã
> ãã®ä»åºŠã®åŒæ°ã¯å€æ° a ãšãã³ãã©ãª t ã§ãã
> ? 3è¡ç®ã«aãè¿œå ããŸãã
> a ã t ã« 3 è¡ç®ã§å ç®ããŸãã
> ä»ãtã¯åŒå
šäœã®çµæãä¿æããŸãã
> ãã®åŒããã倧ããªåŒã®äžéšã§ããå Žåãtã¯ããªãŒã®äžäœããŒããžã®åŒæ°ãšããŠããªãŒã«æž¡ãããŸãã
> ããã§ãªãå Žåã¯ãè©äŸ¡ãçµäºãããããtå€ã¯ç Žæ£ãããŸãã
>
> ããé«åºŠãªææ³ã«ã¯ã代å
¥ãéåç
§ãåé
æŒç®ãªã©ããããŸãã
> ããããåææ³æ§é ã¯ã察å¿ãããµãããªãŒã«ãã£ãŠè¡šçŸãããåŸã«ã³ã³ãã€ã©ã«ãã£ãŠåŠçãããŠã³ãŒããçæããããšãã§ããã
> ? äŸãã°ãCã§è¡šãããé ry æžç®ã¯æ¬¡ã®ããã«ãªããŸãã
> äŸãã°ãéåç
§ãããå€ããã®æžç®ã® C è¡šèšã€ãŸã :
>
> ãã*k -= a
>
> ? 翻蚳ãããªããã°ãªããªã
> ã¯æ¬¡ã®æ§ã«å€æãããªããã°ãªããªã
>
> ããt; k Z; Z t; Z
> ããa t:0
>
> ããã§ã¯ãéæ¥åç
§ã®ããã«äžæå€æ°ãã³ãŒãå
ã§äœ¿çšããå¿
èŠããããŸãã
> ? åœä»€ã®é åºã¯æ¬¡ã®ãšããã§ãã kãtã«ã³ããŒããã aããkãåŒãã
> åœä»€ã®æé 㯠: t ãã¯ãªã¢ã k ã t ã«ã³ããŒããã k ããã€ã³ãããã¡ã¢ãªãã a ãåŒãã
>
> ããã§ã¯ãææ³åŠçã®ããã€ãã®èŠçŽ ã觊ããããŠããã
> ? ry ããããã«æ°ããŒãžããããããŸããã
> Cææ³ã¯ãBNFããªã¹ãããã ãã®çºã«æ°ããŒãžäœ¿ããŸãã
> ? ry ææ³ã¯ã ry ã
> ãããããã倧ããããè€éãªææ³ããåæ§ã®æ¹æ³ã§ã³ã³ãã€ã©ã«ãã£ãŠè§£æ±ºãããã
>
> 4.3 é¢æ°åŒã³åºã
>
> ? ry ãã¹ã¿ãã¯ã«æŒã蟌ãã§ããã ry ã
> äžã®ãµãã»ã¯ã·ã§ã³4.1ã§ã¯ãã¹ã¿ãã¯ã«ããã·ã¥ããããããæ¹æ³ã瀺ãããŠããŸããã
> é¢æ°ãåŒæ°ãåããšãããããã¯æ»ãã¢ãã¬ã¹ãšãšãã«ã¹ã¿ãã¯ã«ããã·ã¥ãããªããã°ãªããªãã
> é¢æ°ã®åŸ©åž°æã«ã¹ã¿ãã¯ã埩å
ããå¿
èŠããããŸãã
> 2ã€ã®åŒæ°ãåãé¢æ°ãèããŠã¿ãŸãããïŒ
>
> ããint f(int a, int b);
> ãããã...
> ããããf(a,b);
>
> é¢æ°fãžã®åŒã³åºãã¯ã次ã®ãããªãã®ã«å€æãããªããã°ãªããŸãã
>
> ãã# 1 push b ïŒ1ããã·ã¥b
> ãã# 2 push a ? ïŒ2ããã·ã¥
> ãã# 3 push return_address
> ãã# 4 goto f
> ãã# return_address:
> ãã# 5 sp -= 3
>
> ? ry å¥ã®åŒã®äžéšã«ããããšãã§ããŸãã ã³ã³ãã€ã©
> Cã®åŒæ°ã¯åŒã«ããããšãã§ããé¢æ°ãžã®åŒã³åºãã¯å¥ã®åŒã®äžéš - ãµãåŒã«ããããšãã§ããŸããå³ã¡ã³ã³ãã€ã©ã¯æ¬¡ã®ãããªããè€éãªã±ãŒã¹ãé©åã«åŠçããå¿
èŠããããŸã
>
>
> ?11?
>
> Page 12
>
>
> int f(int a, int b)
> {
> ...
> return f; fãè¿ãã
> }
> ...
> int k;
> k=f;
> k(f(1,2),3); // call via variable - indirect call //å€æ°çµç±ã§åŒã³åºã - éæ¥åŒã³åºã
> k = f(1,2)(3,4); // call by return value //æ»ãå€ã§åŒã³åºã
>
> ããã§ã¯ç°¡åã®ãããCã®é¢æ°åintïŒ*ïŒïŒintãintïŒã¯intãšããŠè¡šãããŠããŸãã
> ? ry ã¯1ã€ã®å€æ°ã¿ã€ãã®ã¿ ry ã
> Subleqã¯å€æ°ã®åã 1 ã€ã®ã¿ãµããŒãããŠããŸãã
> ? ãããã£ãŠããã粟巧ãªã¿ã€ãã³ã°ã·ã¹ãã ã¯ãèšèªã«äœåãªæ©èœãå°å
¥ããŸããã
> åŸã£ãŠèšèªã«ãäœåãªæ©èœããã粟巧ãªã¿ã€ãã³ã°ã·ã¹ãã ãéœããŸããã
>
> ? ry ãšããŠé©åã«èšç® ry ã
> ã¹ã¿ãã¯ã«ããã·ã¥ãããåŒæ°ã¯ããµãåŒïŒãµãããªãŒïŒãšããŠæãªãèšç®ã§ããŸãã
> ? å®éã®é¢æ°åŒã³åºãã®ãã®æå³ã§ã¯ãããã°ã©ã å€æ°ãŸãã¯äžæå€æ°ã®ãããããã¹ã¿ã㯠ry ãããããšã¯ãããŸããã
> ãã®æå³ã§ã¯ãããã°ã©ã å€æ°åã¯äžæå€æ°ãã®ã©ã¡ããå®éã®é¢æ°åŒåºã§ã¹ã¿ãã¯ã«ããã·ã¥ããããããã¯ãããŸããã
>
> ãã# 1 push B ïŒ1ããã·ã¥B
> ?ããããïŒ ry [spã¯è² ã§ããããšãèŠããŠããŸã]
> ããããïŒã¹ã¿ãã¯å
ã®æ¬¡ã®ã»ã«ãã¯ãªã¢ãã[ sp ãè² ã§ããäºãå¿ããªã ]
> ?ããããïŒäžã®è¡ã¯Cã®æ§æãšåãã§ãïŒ*ïŒ++ spïŒ= 0;
> ããããïŒ *(++sp)=0; ãšãã C æ§æãšäžã®è¡ãšã¯åãã§ãïŒ
> ããããdec sp; t1; sp t1; t2; sp t2; t1:0 t2:0
> ããããïŒCã®æ§æãšåãã§ãïŒ* sp + = B;
> ããããt3; sp t3; b Z; Z t3:0; Z
>
> ããïŒ2ããã·ã¥A
> ãããã? # the same with A ? B ?
> ããããïŒAãšåã
> ããããdec sp; t4; sp t4; t5; sp t5; t4:0 t5:0
> ããããt6; sp t6; a Z; Z t6:0; Z
>
> ããïŒ3 push return_address
> ããããdec sp; t7; sp t7; t8; sp t8; t7:0 t8:0
> ããããt9; sp t9; t10 t9:0 goto_address
> ãããã. t10: return_address
>
> ããïŒ4 goto f
> ããããgoto_address: Z Z f
> ããïŒ5 sp - = 3
> ããããreturn_address: const(-3) sp
>
> ? è¡šèšconstïŒ-3ïŒspã¯
> ããŒã : const(-3) sp ã¯ä»¥äžã®ççž®
>
> ããunique_name sp
> ãã...
> ããunique_name:-3
>
> ? ry æ±ã£ãŠããŸããã
> äžã®ã³ãŒãã¯æ»ãå€ãéæ¥åŒã³åºãããŸã æ±ã£ãŠããŸããã
> æ»ãå€ã¯ç¹å¥ãªå€æ°ïŒã¬ãžã¹ã¿ïŒã«æ ŒçŽã§ããŸãã
> ? ry ãµãåŒã§ããå Žåã¯ãæ»ãå€ãããã«äžæçã«å€ã«ã³ã㌠ry ã
> ããã°ã©ã ããµãåŒã®æ»ãå€ã䜿çšãããªãã°ãæ»ãå€ã return åŸããã«ãã³ãã©ãªã«ã³ããŒããå¿
èŠããããŸãã
> ? ry ã¢ãã¬ã¹ãäžæçã«ä¿æããåç
§è§£é€ã«ãã£ãŠ ry ã
> éæ¥åŒã³åºãã¯ãé¢æ°ã®ã¢ãã¬ã¹ãä¿æããŠãããã³ãã©ãªãéæ¥åç
§ããäºã«ãã£ãŠå®çŸã§ããŸãã
> ããã¯ç°¡åã§ãããããè€éãªã³ãŒãã§ãã
>
> ã¹ã¿ãã¯ãã€ã³ã¿ã¯ãé¢æ°ãã¹ã¿ãã¯ïŒããŒã«ã«ïŒå€æ°ãèŠæ±ãããšãã«é¢æ°å
ã§å€æŽã§ããŸãã
> ããŒã«ã«å€æ°ã«ã¢ã¯ã»ã¹ããã«ã¯ãéåžžãããŒã¹ãã€ã³ã¿bpã䜿çšãããŸãã
> ? é¢æ°ã® ry ã ããŒã«ã«å€æ°ã®åºæ¬åç
§ ry ããŸããïŒ åããŒã«ã«å€æ°ã«ã¯ãããŒã¹ãã€ã³ã¿ããã®é¢é£ãªãã»ããããããŸãã é¢æ°ã®çµããã«ã¹ã¿ãã¯ãã€ã³ã¿ã埩å
ããããã«äœ¿çš ry ã
> ããã¯é¢æ°ã®å
¥ãå£ã§åæåãããŸãã ããã¯ããŒã«ã«å€æ°ã®ããŒã¹åç
§ãšããŠäœ¿çšãããŠããŸã - åããŒã«ã«å€æ°ã¯ãããŒã¹ãã€ã³ã¿ããçŽä»ãããããªãã»ãããæã¡ãŸãã ãããŠããã¯ã¹ã¿ãã¯ãã€ã³ã¿åŸ©å
ã®çºã«é¢æ°ã®çµããã§äœ¿çšãããŸãã
> ? ry ã§ããŸããã€ãŸããåé¢æ°ã¯ãçµäºæã®ããŒã¹ãã€ã³ã¿ã®çµäºæã«å
¥åããã³åŸ©å
æã«ä¿åããå¿
èŠããããŸãã
> é¢æ°ã¯ä»ã®é¢æ°ãåŒã³åºãããšãã§ããã€ãŸããåé¢æ°ããããŒã¹ãã€ã³ã¿ããšã³ããªæç¹ã§ä¿åããããŠçµäºæã«åŸ©å
ããå¿
èŠãæå³ããŸãã
> ? ry ãŸãã
> ãããã£ãŠãé¢æ°æ¬äœã¯æ¬¡ã®ã³ãã³ãã§ã©ããããå¿
èŠããããŸã :
>
>
> ?12?
>
> Page 13
>
>
> ãã1. # push bp 1.ïŒããã·ã¥bp
> ãã2. # sp -> bp
> ãã3. # sp -= stack_size
> ãã# ... function body ïŒ...é¢æ°æ¬äœ
> ãã5. # bp -> sp
> ãã6. # pop bp
> ãã7. # return ? 7.ïŒè¿å
>
> ãŸãã¯Subleqã³ãŒãã§ã
>
> ããdec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
> ãã?+6; sp ?+2; bp 0
> ããbp; sp bp
> ããstack_size sp
>
> ãã# ... function body ïŒ...é¢æ°æ¬äœ
>
> ããsp; bp sp
> ãã?+8; sp ?+4; bp; 0 bp; inc sp
> ãã?+8; sp ?+4; ?+7; 0 ?+3; Z Z 0
>
> ? ry ã解æäžã®é¢æ° ry ã
> stack_sizeã¯å®æ°ã§ãããŒã·ã³ã°ã«äŒŽã£ãŠé¢æ°ããšã«èšç®ãããŸãã
> ? bp ry äžååã§ããããšãå€æããŸããã
> èŠããã« bpãä¿åããã ãã§ã¯äžååã§ãã
> é¢æ°åŒã³åºãã¯ãåŒã®äžã§èµ·ããããšããããŸãã
> ? ry ãè¡šçŸã®äžæçãªãã®ãä¿å ry ã
> ãã®ãããªå Žåã«ã¯ãåŒã®å
šãŠã®ãã³ãã©ãªãä¿åããªããã°ãªããªãã
> ? æ°ããæ©èœã¯ã ry åãäžæã¡ã¢ãªã»ã«ã ry ã
> æ°ããé¢æ°ã¯ãããèªèº«ã®å¿
èŠæ§ã®ããã«åããã³ãã©ãªã¡ã¢ãªã»ã«ã䜿çšããããšã«ãªããŸãã
> åŒfïŒïŒ+ gïŒïŒã«å¯ŸããŠãåŒã³åºãã®çµæã¯å€æ°t1ãšt2ã«æ ŒçŽãããã
> ? ry ããé¢æ°gãt1ãå€æŽ ry ã
> é¢æ°fã®çµæãæ ŒçŽãããŠãã t1 ãé¢æ° g ãå€æŽãããšãåé¡ãçºçããŸãã
>
> ? ry ããã¹ãŠã®æ©èœã䜿çšããŠãããã¹ãŠã®äžæçãªããŒã¿ãã¹ã¿ã㯠ry ã
> 解決çã¯ãåé¢æ°æ¯ã«ããã䜿çšããŠããå
šãã³ãã©ãªãã¹ã¿ãã¯ã«ããã·ã¥ããçµäºæã«ãããã埩å
ããããšã§ãã
> 以äžã®é¢æ°ãèããŠã¿ãŸãããïŒ
>
> ããint g()
> ãã{
> ããããreturn k+1; // k + 1ãè¿ãã
> ãã}
>
> ? ry ã«ç¿»èš³ãããŸãïŒ
> ããã¯æ¬¡ã®ããã«ãã©ã³ã¹ã¬ãŒããããŸãïŒ
>
> ãã_g:
> ãããã# save bp
> ããããdec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
> ãããã?+6; sp ?+2; bp 0
> ããããbp; sp bp
>
> ãããã# push t1 ïŒããã·ã¥t1
> ããããdec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
> ãããã?+6; sp ?+2; t1 0
> ãããã# push t2 ïŒããã·ã¥t2
> ããããdec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
> ãããã?+6; sp ?+2; t2 0
>
> ãããã# calculate addition ïŒå ç®ãèšç®ãã
> ããããt1; t2
> ãããã_k t1
> ããããdec t1
> ããããt1 t2
> ãããã# set the return value [negative] ïŒæ»ãå€ãèšå®ãã[è² ]
> ããããax; t2 ax ? æ§; t2 ax
>
> ãããã# pop t2
> ãããã?+8; sp ?+4; t2; 0 t2; inc sp
> ãããã# pop t1
> ãããã?+8; sp ?+4; t1; 0 t1; inc sp
>
> ãããã# restore bp
> ããããsp; bp sp
> ãããã?+8; sp ?+4; bp; 0 bp; inc sp
> ãããã# exit ïŒ åºå£
> ãããã?+8; sp ?+4; ?+7; 0 ?+3; Z Z 0
>
>
> ?13?
>
> Page 14
>
>
> ã³ãŒãã®ã©ããã«ä»ã®é¢æ°ã®åŒã³åºããããå Žåãä»ã®é¢æ°ãå®è¡æã«ããããä¿åããŠåŸ©å
ãããããäžæå€æ°t1ãšt2ã¯èšç®å€ãä¿æããŸãã
> ? ry ãã¹ãŠã®äžæçãªããŒã¿ã¯ã¹ã¿ã㯠ry ãããã®ã§ã䜿çšãããäžæçãªããŒã¿ã®æ°ãæžããããã«æ¯åºãããŸãã
> é¢æ°å
ã§äœ¿çšãããå
šãŠã®ãã³ãã©ãªãã¹ã¿ãã¯ã«ããã·ã¥ãããäºã以ãŠã䜿çšããããã³ãã©ãªã®æ°ãæžããçºã®æ¯æãšãªããŸãã
> ? ããã¯ã䜿çšãããäžæçãªãã®ãã䜿çšãããäžæçãªãã®ã®ããŒã«ã«è§£æŸããããšã«ãã£ãŠããããè¡ãããšãã§ããŸãã
> ããã¯ã䜿çšããããã³ãã©ãªãã䜿çšãã³ãã©ãªã®ããŒã«ã«éããã ãã§å¯èœã§ãã
> ? ry ãæ°ããäžæçãªãã®ãèŠæ± ry æ°ããäžæçãªãã®ãå²ãåœãŠãããŸãã
> ãã®åŸãæ°ãããã³ãã©ãªãèŠæ±ããããšãããŒã«ãæåã«ãã§ãã¯ããããã®ããŒã«ã空ã®å Žåã«ã®ã¿æ°ãããã³ãã©ãªãã¢ãã±ãŒããããŸãã
> ? è¡šçŸ
> åŒ
>
> ãã1+k[1]
>
> ? ã³ã³ãã€ã«ãã
> ã¯ä»¥äžã®éãã«ã³ã³ãã€ã«ããã
>
> ããt1; t2; _k t1; dec t1; t1 t2
> ããt3; t4; ?+11; t2 Z; Z ?+4; Z; 0 t3; t3 t4;
> ããt5; t6; dec t5; t4 t5; t5 t6
> ãã# result in t6 ? ïŒt6ã®çµæ # çµæ㯠t6 ã®äž
>
> ? ry æé軞ã®ããŒã« ry ãæé軞ã®æ° ry ååã«ãªããŸãã
> ãã³ãã©ãªã®ããŒã«ãå°å
¥ããããšããã³ãã©ãªã®æ°ã¯ååã«ãªã :
>
> ããt1; t2; _k t1; dec t1; t1 t2
> ããt1; t3; ?+11; t2 Z; Z ?+4; Z; 0 t1; t1 t3
> ããt1; t2; dec t1; t3 t1; t1 t2
> ãã# result in t2 ? ïŒçµæã¯t2ã«ãªããŸã ïŒçµæ㯠t2 ã®äž
>
> ? ry åé€ããã³ãŒãã ry ã
> 察å¿ããããã·ã¥ããã³ãããæäœãåé€ãã³ãŒãã倧å¹
ã«åæžãããŸãã
>
> 4.4ã¹ã¿ãã¯å€æ°
>
> bpãã¹ã¿ãã¯ã«çœ®ãããspããã¯ãªã¡ã³ããããŠã¡ã¢ãªãå²ãåœãŠããããšããã¹ãŠã®ããŒã«ã«å€æ°ã䜿çšå¯èœã«ãªããŸãã
> ã³ã³ãã€ã©ã¯ã¢ãã¬ã¹ãç¥ããªãããéæ¥çã«ããã¢ã¯ã»ã¹ã§ããŸããã
> ? äŸãã°ãé¢æ°f in
> äŸãã°ã以äžã®é¢æ° f
>
> ããint f(int x, int y)
> ãã{
> ããããint a, b=3, c[3], d=5;
> ãããã...
> ãã}
> ããf(7,9);
>
> ? ã¹ã¿ãã¯ãµã€ãºã6ã«çãã4ã€ã®ããŒã«ã«å€æ°ããããŸãã
> 㯠6 ã«çããã¹ã¿ãã¯ãµã€ãºãšå
±ã«ãã 4 ã€ã®ããŒã«ã«å€æ°ããæã¡ãŸãã
> ? ry é¢æ°ãå
¥åããããšãã¹ã¿ãã¯ã¯æ¬¡ã®å€ã ry ïŒ
> ãã®é¢æ°ãéå§ããããšãã¹ã¿ãã¯ã¯äžèšã®å€ãæã¡ãŸãïŒ
>
> ... y[9] x[7] [return_address] [saved_bp] a[?] b[3] c0[?] c1[?] c2[?] d[5] ...
> ^ ^
> (bp) (sp)
>
> ã³ã³ãã€ã©ã¯ãbpããã®åå€æ°ã®ãªãã»ããã«ã€ããŠç¥ã£ãŠããŸãã
>
>
> ?14?
>
> Page 15
>
>
> å¯å€ãªãã»ãã
> ããy ãã-3
> ããx ãã-2
> ããa ãã1
> ããb ãã2
> ããc ãã3
> ããd ãã6
>
> ãããã£ãŠãã³ãŒãã§ã¯ãé
åãæããªãããŒã«ã«å€æ°ãžã®åç
§ã¯*ïŒbp + offsetïŒã§çœ®ãæããããšãã§ããŸãã
> ? arrayã® ry ã
> é
åã®ååã¯æåã®èŠçŽ ã®ã¢ãã¬ã¹ãªã®ã§ãé
åcã¯ïŒbp + offsetïŒã«çœ®ãæããªããã°ãªããŸããã
> ååã¯å€æ°ãåç
§ããã®ã§ã¯ãªãã[]ã§åç
§ããããšã¯å€æ°ãåç
§ããŸãã
> Cã§
>
> ããc[i]
>
> ? is the same as ?
> is the same as
> ? ãšåãã§ã
> ã¯ä»¥äžãšåãã§
>
> ãã*(c+i)
>
> ãã®äŸã§ã¯æ¬¡ã®ããã«è§£éã§ããŸãã
>
> ãã*((bp+3)+i)
> 4.5 ä¹ç®
>
> Subleqã«ãããå¯äžã®äºçŽ°ãªä¹ç®ã¯2åã®ä¹ç®ã§ããã
>
> ããt=a+a: t; a Z; a Z; Z t; Z
>
> ?ãåŒã䜿çšã§ããŸã
> 2ã€ã®æ°åãä¹ç®ããã«ã¯ã以äžã®åŒã䜿çšã§ããŸã
>
> ããA*B = (2A)*(B/2) + A*(B%2)
>
> ? ry æŽæ°ãšã¢ãžã¥ãŒã«åå²ãå¿
èŠã§ãã
> ããã¯åçŽãªååž°åŒã§ãããæŽæ°ãšå°äœæŒç®ãšãå¿
èŠã§ãã
> é€ç®ã¯ã次ã®ã¢ã«ãŽãªãºã ãšããŠå®è£
ã§ããŸãã
> ? ry äžãããããšããBã¯2ã ãå¢å ãã次ã®å¢å ãBããAãã倧ãããªããŸã§å¢å ããã
> 2ã€ã®æ°AãšBãäžããããæ B ãã B ã A ãã倧ãããªããŸã§ 2 åããã
> ? ry ããããšåæã«ãå¥ã®å€æ°Iã2ã ãå¢ãããŸããããã¯1ã«åæåãããŠããŸãã
> Bãå¢å ããåæã«ã 1 ã«åæåãããŠããå¥ã®å€æ° I ã 2 åããŸãã
> ? ry ãšãç§ã¯é€ç®ã®çµæã®äžéšãä¿æããŸããïŒ æ®ãã¯ABãšå
ã®Bã ry ã
> BãAãã倧ãããªããšã I ã¯é€ç®ã®çµæã®äžéšãä¿æã - æ®ã㯠A - ( 蚳泚 : ååã® ) B ãšå
ã® B ãšã䜿çšããŠããã«èšç®ãããŸãã
> ããã¯ååž°çã«ãã¹ãŠã®Iãèç©ããããšãã§ããŸãã
> A <Bã®æåŸã®ã¹ãããã§ã¯ãAã¯ã¢ãžã¥ã©ã¹ã§ãã
> ãã®ã¢ã«ãŽãªãºã ã¯ãCã®çãååž°é¢æ°ãšããŠå®è£
ã§ããŸãã
> ? çµäºæã«ããã®é¢æ°ã¯åŒæ°jã®çµæãšé€ç®ã¢ãžã¥ã©ã¹ãšããŠæŽæ°é€ç®ãè¿ããŸãã
> ãã®æŽæ°é€ç®ãã®çµæãšããããŠåŒæ° j ã®é€ç®ã¢ãžã¥ã©ã¹ãšãããã®é¢æ°ã¯çµäºæã«è¿ããŸãã
>
> ããint a, int b, int * j)
> ãã{
>
> ããããif( a < b ) { *j=a; return 0; } // 0ãè¿ããŸãã
>
> ããããint b1=b, i=1, bp, ip;
>
> ããnext: // 次ïŒ
> ããããbp = b1; ip = i;
> ããããb1 *= 2; i *= 2;
> ããããif( b1 > a )
> ããããããreturn ip+divMod(a-bp,b,j);
> ããããgoto next; ? // 次ãžé²ãã // next ãžè¡ã;
> ãã}
>
>
> ?15?
>
> Page 16
>
>
> ãã®æ©èœã¯æé©ã§ã¯ãããŸããã
> ååž°ãå¥ã®å€éšã«ãŒãã«çœ®ãæããããšã§ãããå¹ççãªé¢æ°ãå®çŸã§ããŸãã
> éåžžã«ç²Ÿå·§ãªèšç®ãå¿
èŠãšããä¹ç®ãæŽæ°ããã³ã¢ãžã¥ã©é€ç®æŒç®ã¯ãã©ã€ãã©ãªé¢æ°ãšããŠå®è£
ã§ããŸãã
> ã€ãŸããåä¹ç®a * bã¯ãåŒã³åºã_mulïŒaãbïŒã«çœ®ãæããããšãã§ããåŸã§ã³ã³ãã€ã©ã¯é¢æ°ã®å®è£
ãïŒå¿
èŠã«å¿ããŠïŒè¿œå ããããšãã§ããŸãã
>
> 4.6 æ¡ä»¶ãžã£ã³ã
>
> Cã§ã¯ããŒããšè©äŸ¡ãããããŒã«åŒã¯åœã§ãããéãŒãã¯çã§ãã
> ? Subleqã§ã¯ããã¹ãŠã®ããŒã«åŒãå¹³çãŸãã¯äžçå·ã«åºã¥ããŠãŒãã«è©äŸ¡ããããããããŒã«åŒãåŠçãããšãã«ã³ãŒããé·ããªããŸãã
> Subleq ã§ã¯ããŒã«åŒãæ±ãå Žåã«ã³ãŒããé·ããªããŸããäœæ
ãªãå
šãŠã®ããŒã«åŒè©äŸ¡ã 0 ãšã®çåäžçã«åºã¥ãçºã§ãã
>
> ? ry åœãšæ£ã®å€ãçãšããŠæ± ry ã
> ããè¯ãæ¹æ³ã¯ããŒã以äžãåœãšãæ£ã®å€ãçãšããŠæ±ãããšã§ãã
> ? if-expression ifïŒexprïŒ{<body>}ã1ã€ã®åœä»€ã«ãããªãå Žå
> ãããš if-åŒ if(expr){<body>} ã¯ãã£ã 1 ã€ã®åœä»€
>
> Z t next
> <body>
> next: ... æ¬¡ïŒ ...
>
> ? tã¯åŒ ry ã
> ã«ãªã t ãåŒexprã®çµæã§ãã
> ? ãã ããïŒx + 1ïŒ{...}ãããŒã«å€ãžã®æé»çãªå€æã®å Žåãªã©ãCãšå®å
šã«äºææ§ãä¿ã€ããã«ã ry ã
> äœã泚æãšããŠã C ( äŸãã°ãããŒã«å€ãžã®æé»çãªå€æãšããŠã® if(x+1){...} ) ãšã®å®å
šäºæã®çºã«ãæŽæ°åŒãããŒã«å€ãšããŠäœ¿çšããããã¹ãŠã®ã±ãŒã¹ãæ€åºããå¿
èŠããããŸãã
> ? ry ã§ãã
> 幞ãããã®ãããªã±ãŒã¹ã¯ã»ãã®ãããã§ã :
>
> if(expr)
> while(expr)
> for(...,expr,...)
> ! expr
> expr1 && expr2
> expr1 || expr2
>
> ? ry ã§ããã®ã§ãã³ã³ãã€ã©ã¯ããŒã«å€ãæŽæ°åŒãæ°ã«ããå¿
èŠããªãããã ry ã
> ãã®äœæ¥ã¯ããŒãµå
ã§è¡ãããšãã§ãããããšã³ã³ãã€ã©ã¯ãããŒãªã¢ã³ãæŽæ°ãåŒã«ä»ããŠãæ°ã«ããå¿
èŠããªããããŠããåçŽãªã³ãŒããçæããããšãã§ããŸãã
>
> ? ry ã次ã®ããã«ãªããŸãã
> ããŒã«å€æ°ãåŒã§æŽæ°ãšããŠäœ¿çšãããå Žåã次ã®æ§ã« :
>
> ãã åŒæ°fïŒa> 0ïŒãæž¡ãã
> ?ãã é¢æ°ã®æ»ãå€ïŒa> 0ïŒããæ»ãå€ã
> ãã é¢æ° return(a>0); ããæ»ãå€ã
> ãã 代å
¥x =ïŒa> 0ïŒã
> ãã ä»ã®ç®è¡åŒx = 1 + 5 *ïŒa> 0ïŒã
>
> å€æ°ã¯Cã¹ã¿ã€ã«ã«å€æããå¿
èŠããããŸããã€ãŸããè² ã®çµæã¯ãŒãã«ãªããŸãã
> ããã¯ã以äžã®ããã«ç°¡åã«è¡ãããšãã§ããŸãã
>
> ããx Z ?+3; x; Z ? xâ z + 3ã§ããã ãã; Z
>
>
> Z x ? + 3 x > 0 次ã®è¡ã®ã¢ãã¬ã¹ + 3 ( = 4 - 1 ) çªå°ã€ãŸã次ã®æ¬¡ã®è¡ããå®è¡
> Z Z â â ? ã°ãŒã°ãŒ
> x Z â â
> Z x == 0
>
> x < 0
>
> ? å³3æ¡ä»¶ä»ããžã£ã³ããè¡šãå³
> å³3 æ¡ä»¶ãžã£ã³ããè¡šããã€ã¢ã°ã©ã
>
>
> ?16?
>
> Page 17
>
>
> ? ry 0ããå°ãããçããããŸãã¯ãã倧ããå Žåã®ç°¡æœ ry ãšããã§ãã
> å€ã0ããå°ãããçããããããã倧ãããã®ç°¡æœãªãã§ãã¯ã¯æ¬¡ã®éã㧠:
>
> ããZ x ?+3; Z Z G; x Z E; Z; L:
>
> ããã§ãLãEãããã³Gã¯ãxããããã0ããå°ãããçããããŸãã¯å€§ããå Žåã®å®è¡ã«åæ Œããã¢ãã¬ã¹ã§ãã
> å³3ã«å®è¡ã®ã¹ããŒãã瀺ããŸãã
> ? xãå€ããããZããŒãã§ããããšã«æ³šæããŠãã ããã
> x ã¯å€åããªãããããŠã©ã㪠exit ã«æŒãŠã Z ã¯ãŒãã§ãããã«æ³šæã
>
> 5.çµæ
>
>
>
> å³4 FPGAããŒãã28åã®Subleqããã»ããµãããã»ããµããã2 Kbå²ãåœãŠ
>
>
> å³4ã¯ãUSBã±ãŒãã«ãä»ããŠFPGAããŒãã«çµŠé»ããç¶æ
ã瀺ããŠããŸãã
> ããŒãã¯çŽ5 x 7ã»ã³ãã¡ãŒãã«ã®å€§ããã§ã28åã®Subleqããã»ããµãæèŒããŠãããããã»ããµããã2 KBã®ã¡ã¢ãªãå²ãåœãŠãããã¯ããã¯åšæ³¢æ°150 MHzã§åäœããŸãã
>
> ããŒãã®å¹çããã¹ãããããã«ãæã
ã¯2ã€ã®æ°åŠçåé¡ãéžãã ã
> æåã¯ãç®è¡æŒç®ã°ã«ãŒãã®é¢æ°å°äœã®ãµã€ãºãèšç®ããŸãã
> ? ry 2çªç®ã®ã¢ãžã¥ãŒã«ã¯ãäºééä¹ãèš ry ã
> 2çªç®ã«ãã¢ãžã¥ã©äºééä¹ãèšç®ããŸãã
>
> 5.1 ãã¹ãïŒ1
>
> ? ry ãã¹ãã§ã¯ã次ã®ããã»ã¹ã®é¢æ°æ®åºã®é åºãèŠã€ããåé¡ãéžæããŸããã
> æåã®ãã¹ãã§æã
ãéžæããã®ã¯ä»¥äžã«ç€ºããé¢æ°æ®åºã®é åºãèŠã€ããåé¡ :
>
> ããxi +1 = 2 xi mod M
> ããyi +1 = 2( xi + yi ) mod M
>
> ? x ry ãMã¯ããå€ã§ãã
> ã§ã xãšyã¯1ã«åæåãããæŽæ°ãmodã¯ã¢ãžã¥ãæŒç®ãM ã¯ãšããå€ã§ãã
> ç¹ïŒx0 = 1ãy0 = 1ïŒããåºçºããŠãæ¹çšåŒã¯å¯Ÿã®ã·ãŒã±ã³ã¹ãçæããã
> ? ãã®åé¡ã¯ã解決çãé£ãããMïŒM 2æªæºïŒãããé »ç¹ã«çããå€ãããããã®åé¡ãéžæããŸããã
> 解æ³ãé£ãããçãã M ããããã°ãã°éåžžã«å€§ãã ( ããã M 2 æªæº ) çº ããã®åé¡ãæã
ã¯éžæããŸããã
> ? ry æ°Mãéžæãããã®ã§ãèšç® ry ã
> æ° M ããã®æ§ã«éžæãããèšç®ã¯æ°åã§å®äºããããšãã§ããŸããã
> ? ry æ°ãããã¢ã®ã㢠ry åãã«ãªããŸãã
> ãã®ã·ãŒã±ã³ã¹ãååã«é·ãå Žåãçæãããæ°ããæ°ã®ãã¢ã¯ãã·ãŒã±ã³ã¹å
ã§ä»¥åã«çæããããã¢ãšãããŠåãã«ãªããŸãã
> ã¿ã¹ã¯ã¯ãåãå€ãæã€çµæãæåã«åºçŸãããŸã§ã«å®äºããå¿
èŠã®ããã¹ãããã®æ°ãèŠã€ããããšã§ãã
> æã
ã®ãã¹ãã§ã¯ãMã®éžæå€ã¯M = 5039ã§ãããå埩åæ°ã¯12693241ãšèšç®ãããã
>
>
> Page 17
>
> ?18?
>
>
> ? ry ã®ACããã°ã©ã ã¯ã ry ãŸãã
> ãã®åé¡ã解決ããããã® C ããã°ã©ã ã¯ãä¹ç®ãŸãã¯é€ç®ã䜿çšããã«èšè¿°ããããšãã§ããŸã :
>
> ããint x=1, y=1, m=5039;
> ããint c=0, ctr=1, t;
> ããint x0=0, y0=0;
>
> ããint printf();
> ããint main()
> ãã{
>
> ããããwhile(1) ? // äžæ¹ãïŒ1ïŒ
> ãããã{
> ããããããy += x; y += y; x += x;
> ããããããwhile( x>=m ) x-=m;
> ããããããwhile( y>=m ) y-=m;
>
> ããããããif( x==x0 && y==y0 ) break;
>
> ããããããif( ++c==ctr )
> ãããããã{
> ããããããããx0=x; y0=y;
> ããããããããc=0; ctr+=ctr;
> ãããããã}
> ãããã}
> ããããprintf("point: %d %d loop: %d of %dÂ¥n",x0,y0,c+1,ctr); printfïŒ "ãã€ã³ãïŒïŒ
dïŒ
dã«ãŒãïŒïŒ
dã®ïŒ
d Â¥ n"ãx0ãy0ãc + 1ãctrïŒ;
> ãã}
>
> ? ry ãŸãã
> ãã®ããã°ã©ã ã¯ã以äžã®å Žåã«ãã¹ããããŠããŸã :
>
> 1. Subleqã³ã³ãã€ã©ã§ã³ã³ãã€ã«ããFPGAããŒãäžã®ããã»ããµã®1ã€ã§å®è¡ããŸãã
> 2. Subleqã³ã³ãã€ã©ã§ã³ã³ãã€ã«ããPCïŒ1ïŒIntel Q9650 at 3GHzïŒã§ãšãã¥ã¬ãŒãããŸãã
> 3. Microsoft C / C ++ã³ã³ãã€ã©ïŒv16ïŒã§å®å
šæé©åããŠã³ã³ãã€ã«ããPCïŒ1ã§å®è¡ããŸãã
> 4. 2ãšåãã§ãããPCïŒ2ïŒ1.7GHzã®Pentium 4ïŒã§åäœããŸãã
> ? 5. PCïŒ2ã§3åå®è¡ãšåã
> 5. 3 ãšåãäºã PC#2 ã§
>
> 以äžã®è¡šã¯ãåãã¹ãã®å®è¡æéãç§åäœã§ç€ºããŠããŸãã
>
> 1 Subleq on 1ããã»ããµFPGA 94.0
> 2 Subleq on PCïŒ1 46.0
> 3 C on PCïŒ1 0.37
> 4 PCïŒ2äžã®Subleq 216
> ? PCïŒ2ã®5C 0.54
> 5 PC#2 ã® C 0.54
>
> ãããã®çµæãããFPGAäžã®åäžããã»ããµã®é床ã¯ãSubleqåœä»€ããšãã¥ã¬ãŒãããå Žåãéåžžã®PCã®CPUã®é床ãšåããªãŒããŒã®å€§ããã§ãããšçµè«ã¥ããããŸãã
> PCäžã®ãã€ãã£ãã³ãŒãã¯çŽ100åé«éã«åäœããŸãã
>
> 5.2ãã¹ãïŒ2
>
> ? ry èšç®ã§ãã£ãã
> 第2ã®ãã¹ãã¯ãã¢ãžã¥ã©ãŒäºéä¹ã®èšç®ãã€ãŸã
>
> ãã N n
> ãã(N !)! mod M = ?? i mod M
> ãã n =1 i =1
>
>
> Page 18
>
> ?19?
>
>
> ãã®ãã¹ãã±ãŒã¹ã§ã¯ããã«ãããã»ããµSubleqã·ã¹ãã ã®ãã«ãã¯ãŒã䜿çšããããšãã§ããŸãããäžèšã®åŒã®ä¹ç®ã¯28åã®ããã»ããµãã¹ãŠã§äžŠåã«èšç®ã§ããããã§ãã
> N = 5029ããã³M = 5039ã®å Žåãçµæã¯95ã§ããããããã®æ°å€ã¯ãã¹ãã§äœ¿çšãããã
> æ°Mã¯ãã¹ãïŒ1ãšåãã§ãããæ°Nã¯ASCIIå°å·å¯èœç¯å²å
ã®çµæïŒ95ïŒãäžããããã«éžæãããã
> ? ry ãã
> èšç®ã¯æ¬¡ã®æ§æã§å®è¡ãããŸãã :
>
> ? 1.ææžãFPGAããŒãã®Subleqã³ãŒãå®è¡[ ry
> 1. ææžãã® Subleq ã³ãŒãã FPGA ããŒãäžå®è¡ [ä»é²7.3]
> ? ry ã³ãŒãïŒæåã®ãã¹ãã§ã¯PCïŒ1ãšåãïŒ
> 2. PCäžã§ãšãã¥ã¬ãŒããããSubleqã³ãŒã ( æåã®ãã¹ãã PC#1 äžã§ãšåã )
> ? ry ãCã³ ry ã«ãããPCäžã§å®è¡ãããåçã®Cã³ãŒã[ä»é²7.1]
> 3. åã C ã³ã³ãã€ã©ã§ã³ã³ãã€ã«ãããåçã® C ã³ãŒããã㊠PCäžã§å®è¡ [ ä»é²7.1 ]
> 4. Subleqã³ã³ãã€ã©ã§ã³ã³ãã€ã«ãããPCäžã§ãšãã¥ã¬ãŒããããåãCã³ãŒã
> 5. Cã³ã³ãã€ã©ã§ã³ã³ãã€ã«ããŠPCäžã§å®è¡ããä¹ç®æŒç®ãªãã®ç䟡Cã³ãŒã[ä»é²7.2]
> 6. Subeqã³ã³ãã€ã©ã§ã³ã³ãã€ã«ãããPCäžã§ãšãã¥ã¬ãŒãããã5ãšåãCã³ãŒã
>
> ? ry ããããã«?OïŒN^2ïŒã§ã¯ãªããã¢ãžã¥ã© ry ãåé¡ãžã®è§£æ±ºã«?OïŒNlogNïŒæŒç® ry ãäœ¿çš ry ã
> ä»é²ã«ç€ºãããŠããæ§ãªã âŸO( N^2 ) ã§ãªãã¢ãžã¥ã©çŽ¯ä¹ãå©çšããå Žåã«ã¯ãåé¡ãžã®è§£æ³ã« âŸO( NlogN ) æŒç®ãå¿
èŠãªã®ã§ãæã
ã䜿çšããã³ãŒãã¯100ïŒ
å¹ççã§ã¯ãããŸããã§ããã
> ãã ããããã¯çžå¯Ÿçãªããã©ãŒãã³ã¹ãè©äŸ¡ããéã«ã¯éèŠã§ã¯ãããŸããã
>
> çµæã以äžã®è¡šã«ç€ºãã
> å€ã¯ç§åäœã®å®è¡æéã§ãã
>
> 1 FPGAäžã®Subleqã28ããã»ããµã§äžŠå 62.0
> 2 PCäžã®ãµãã¬ãã¯ïŒãšãã¥ã¬ãŒã·ã§ã³ïŒ 865
> ? ry ä»ã3 CãPCäžã§å®è¡å¯èœãªå®è¡0.15
> 3 ä¹ç®ä» C ãå®è¡åœ¢æ
ã PC äžã§å®è¡ 0.15
> ? ry ä»ã4 CãPC 12060ã§ãšã㥠ry ãSubleq
> 4 ä¹ç®ä» C ãPC ã§ãšãã¥ã¬ãŒããããSubleq 12060
> ? ry ãªãã®5 CãPC 7.8ã§å®è¡å¯èœãªå®è¡
> 5 ä¹ç®ãªãã® C ãå®è¡åœ¢æ
ã PC äžã§å®è¡ 7.8
> ? ry ãªãã®6 CãPC 9795ã§ãš ry ãSubleq
> 6 ä¹ç®ãªãã® C ãPC ã§ãšãã¥ã¬ãŒããããSubleq 9795
>
> 28ã®FPGAããã»ããµã¯ãPCäžã§åãSubleqã³ãŒãã®ãšãã¥ã¬ãŒã·ã§ã³ã容æã«åé§ããŸãã
> ? ry ã«ã³ã³ãã€ã«ãããä¹ç®ã®ãªãCã³ãŒãã¯ãä¹ç®ä»ãã®Cã³ãŒããããé«éã«å®è¡ãããŸãã ry é¢æ°ã»ã©å¹ç ry ã
> Subleqã«ã³ã³ãã€ã«ãããããŠãšãã¥ã¬ãŒããããå®è¡ã§ãä¹ç®ãªãã® C ã³ãŒãã¯ä¹ç®ããã® C ã³ãŒããããé«éã§ããããã¯ãã³ã³ãã€ã©ã®ã©ã€ãã©ãªä¹ç®é¢æ°ããã®äŸã§èšè¿°ãããä¹ç®é¢æ°çšã«ã¯å¹ççã§ãªãããã§ãã
> 6.çµè«
>
> ? å®äŸ¡ãªCyclone ry 䜿çšããŠã䞊å ry ããã€ã¹ãæ§ç¯ããŸããã
> é«äŸ¡ã§ãªã Cyclone III FPGAã䜿çšãæã
ã¯ã䞊åã«åäœããããã»ããµãåããOISCãã«ãããã»ããµã»ããã€ã¹æ§ç¯ã«æåããŸããã
> ? Each processor has its own memory limited to 2 Kb.
> ? ry ã2 Kb ry ã
> åããã»ããµã«ã¯ã 2 KBã«å¶éãããç¬èªã®ã¡ã¢ãªããããŸãã
> ãã®å¶éã®ããã«ãäŸãã°ãããã³ã㌠[2] ã®æ§ãªæŽã«åçŽãªåå¥ããã»ããµåœä»€ã»ãããæã€ãã«ãããã»ããµããŒããæ§ç¯ããããšã¯ã§ããŸããã§ããã äœæ
ãªããã®å Žåãå®éã«æçšãªèšç®ã¿ã¹ã¯ãå®è¡ããããã«å¿
èŠæå°éã®ã¡ã¢ãªã¯1ããã»ããµããã⟠1Mbã®ã¡ã¢ãªã§ãã
> ? ry éãããŠããŠããä» ry 䜿çšãããªã©ãããé«åºŠãªããã°ã©ã ãå®è¡ããããšã¯ã§ããŸããã§ããã ry ã ãã¹ãŠã®èšç®ã³ãŒããåããã»ããµã«å²ãåœãŠãããã¡ã¢ãªå
ã«å ry ã
> ç§ãã¡ã®ããã€ã¹ã§å©çšå¯èœãªã¡ã¢ãªãéãããŠããã ãã§ãªããä»ã®ããã»ããµã®ãšãã¥ã¬ãŒã¿ãããè€éãªèšç®ã¢ã«ãŽãªãºã ã䜿çšãããšãã£ããããé«åºŠãªããã°ã©ã ã®å®è¡ã®äœå°ãäžããããŸããã§ããã åããã»ããµã«å²ãåœãŠãããã¡ã¢ãªã®äžã«èšç®ã³ãŒããã®å
šãŠãåãŸãå¿
èŠãããããã§ãã
>
>
> Page 19
>
> ?20?
>
>
> ? ry ãããé«äŸ¡ãªFPGAã§ããã«ãããããããããé«éã§é«éãªãã®ãéžæããããšã§ãå ry ã
> Stratix Vãªã©ãããé«äŸ¡ã§ããã©ãã倧èŠæš¡ã§ããé«é㪠FPGA ãéžæããäºã«ãããåããã»ããµã§äœ¿çšã§ããã¡ã¢ãªã®ãµã€ãºãå¢ããããšãã§ããŸãã
> ? ãã®åŸããã ry CPUãå®è£
ry ã
> ãããšãããéãåŠçã¯ããã¯ãšããå€ãã® CPU ãšãäžæãå®è£
ããããšãã§ããŸãã
> CPUã¹ããŒããã·ã³ã®VHDLã³ãŒããæé©åããŠèšç®é床ãåäžãããããšãã§ããŸãã
> ååãªã¡ã¢ãªãããã°ãä»ã®ããã»ããµã¢ãŒããã¯ãã£ããšãã¥ã¬ãŒãããä»ã®CPUçšã«æžãããã¢ã«ãŽãªãºã ã䜿çšãããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãå®è¡ããããšãå¯èœã§ãã
> ? èšæ¶ã®å¶çŽãšã¯å¥ã«ããã®æå°éã®ã¢ãããŒã ry ã¯ã¹ããŒãã®äœäžã§ãã£ãã
> ã¡ã¢ãªã®å¶çŽãšã¯å¥ã«ããã®æå°é䞻矩è
ã¢ãããŒãã®ããäžã€ã®æ¬ ç¹ã¯äœé床ã§ãã£ãã
> ç§ãã¡ã®ããŒãã¯ãCPUã¯ããã¯ã®é床ãããªãé
ãïŒ150MHzïŒã
> åè¿°ã®ããã«ãããé«äŸ¡ãªFPGAã¯ã¯ããã«é«éãªã¯ããã¯é床ã§åäœããããšãã§ããŸãã
>
> äžæ¹ãèšèšã®ç°¡çŽ åã«ãããã¹ã¿ã³ãã¢ããŒã³åã®å°åãã«ãããã»ããµãŒã»ã³ã³ãã¥ãŒã¿ãŒãšããŠå®è£
ã§ãããããç©ççãµã€ãºãšãšãã«ã®ãŒæ¶è²»ã®äž¡æ¹ãåæžãããŸãã
> é©åãªããŒããŠã§ã¢ã䜿çšãããšãå®äŸ¡ãªé»åã§äœ¿çšããããã®ãšåæ§ã®äœé»å倪éœé»æ± ã§ãã®ãããªããã€ã¹ã«é»åãäŸçµŠããããšãå¯èœã§ãã
> ? ry å®è£
ã¯æ¡åŒµæ§ããããŸã - ãã¹ãã®é»æºã«å€§ããªè² è·ããããããšãªãè¿œå ã®ããŒããæ¥ç¶ããããšã«ãããããã»ããµã®æ°ãå¢ããããšã¯å®¹æã§ãã
> ç§ãã¡ã®å®è£
ã¯ã¹ã±ãŒã©ãã« - è¿œå ããŒãã®æ¥ç¶ã«ããããã¹ãã®é»æºã®è² è·ã®å€§ããªåœ±é¿ãªãã®ããã»ããµæ°å¢ã¯å®¹æã§ãã
>
> ãã¹ãPCã¯ãã³ãŒããããŒãããŠçµæãèªã¿åãããã«é«éã§ããå¿
èŠã¯ãããŸããã
> æã
ã®å®è£
ã¯FPGAããŒã¹ã§ãããããFPGAãåããã°ã©ãã³ã°ããããšã«ãã£ãŠãç¹å®ã®ã¿ã¹ã¯ã«åãããŠã«ã¹ã¿ãã€ãºãããä»ã®ã¿ã€ãã®å®è¡æåããŒãå¯èœãªCPUãäœæããããšãå¯èœã§ãã
>
> çµè«ãšããŠãæã
ã¯OISCã³ã³ã»ããã®å®çŸå¯èœæ§ãå®èšŒãããããOISCãã«ãããã»ããµã·ã¹ãã ã®æ©èœãããã¿ã€ãæ§ç¯ã«é©çšããã
> æã
ã®çµæã¯ãé©åãªããŒããŠã§ã¢ããã³ãœãããŠã§ã¢å®è£
ã§ã¯ãéåžžã«åçŽãªOISCãã«ãããã»ããµèšèšã§ãã§ã«çžåœãªèšç®èœåãéæã§ããããšã瀺ããŠããŸãã
>
>
> Page 21
>
> ?21?
>
>
> 7.ä»é²
>
> ? ry ã³ãŒãã瀺ããŸãã
> ãã®ã»ã¯ã·ã§ã³ã§ã¯ãã¢ãžã¥ã©ãŒäºéä¹ãèšç®ããã³ãŒãçã瀺ããŸãã
>
> ? ä¹ç®ä»ãã®7.1C
> 7.1 ä¹ç®ä»ã® C
>
> ? ry ãçµã¿èŸŒã¿ã® ry ã
> 次ã®Cããã°ã©ã ã¯ããã«ãã€ã³ã®çµã¿èŸŒã¿ã®ä¹ç®ãšé€ç®ã䜿çšããŠã¢ãžã¥ã©ãŒäºéä¹ãèšç®ããŸãã
>
> 1 ããint printf();
> 2 ããint main()
> 3 ãã{
> 4 ããããint a=5029;
> 5 ããããint b=1;
> 6 ããããint m=5039;
> 7 ããããint x=1;
> 8 ããããint i,j;
> 9
> 10 ããããfor( i=a; i>b; i-- )
> 11 ããããfor( j=1; j<=i; j++ )
> 12 ããããx = (j*x)%m;
> 13
> 14 ããããprintf("%d",x);
> 15 ãã}
>
> ? ry ã®è€çŽ ã«ãŒãã§ãã
> 10è¡ç®ãã12è¡ç®ã¯ãbããã¢ãžã¥ãmãŸã§ã®åæ°ã®äºéã«ãŒãã§ãã
>
> 7.2 ä¹æ³ãªãã®C
>
> ? ry ããä¹ç®ãšé€ç®ã®çµã¿èŸŒã¿æäœã¯ãããŸããã
> ãã®Cããã°ã©ã ã¯ã7.1ã®ããã°ã©ã ãšåãèšç®ãè¡ããŸããããã«ãã€ã³ãªä¹é€ç®ã¯ãããŸããã
> ä¹ç®ãšé€ç®ã®é¢æ°ã¯æ瀺çã«èšè¿°ãããŸãã
>
> 1 ããint DivMod(int a, int b, int *m)
> 2 ãã{
> 3 ããããint b1, i1, bp, ip;
> 4 ããããint z = 0;
> 5
> 6 ããstart: 6ã¹ã¿ãŒãïŒ
> 7 ããããif( a<b ){ *m=a; return z; } zãè¿ããŸãã
> 8
> 9 ããããb1=b; i1=1;
> 10
> 11 ããnext:
> 12 ããããbp = b1; ip = i1;
> 13 ããããb1 += b1; i1 += i1;
> 14
> 15 ããããif( b1 > a )
> 16 ãããã{
> 17 ããããããa = a-bp;
> 18 ããããããz += ip;
> 19 ããããããgoto start;
> 20 ãããã}
> 21
> 22 ããããif( b1 < 0 ) return z; ïŒb1 <0ïŒãzãè¿ãã
> 23
> 24 ããããgoto next;
> 25 ãã}
> 26
> 27 ããint Mult(int a, int b)
> 28 ãã{
> 29 ããããint dmm, r=0;
> 30
> 31 ããããwhile(1)
> 32 ãããã{
> 33 ããããããif( !a ) return r;
> 34 ããããããa=DivMod(a,2,&dmm);
> 35 ããããããif( dmm ) r += b;
> 36 ããããããb += b;
> 37 ãããã}
> 38 ãã}
> 39
> 40 ããint printf();
> 41
> 42ããint a=5029, b=1, m=5039;
> 43 ããint k=0, x=1, t;
> 44
> 45 ããint main()
> 46 ãã{
> 47 ããstart: k=a;
> 48 ããloop: t=Mult(k,x); ã«ãŒãïŒt = MultïŒkãxïŒ;
> 49 ããããDivMod(t,m,&x);
> 50
> 51 ããããif( --k ) goto loop; gotoã«ãŒãã
> 52 ããããif( --a > b ) goto start;
> 53
> 54 ããããprintf("%d",x);
> 55 ãã}
>
> è¡1-25ã¯ã4.5ã§èª¬æããåå²ã¢ã«ãŽãªãºã ãå®è£
ããŠããŸãããååž°åŒã³åºããåé€ããããšã§æé©åãããŠããŸãã
> ä¹ç®ïŒ27?38è¡ç®ïŒã¯ã4.5ã«ç€ºãåŒã®çŽæ¥çãªå®è£
ã§ãã
>
>
> Page 21
>
> ?22?
>
>
> ? ry 7.3ã§Subleqã®å®è£
ry ã
> Cã«ãŒãã¯ã次ã®ãµãã»ã¯ã·ã§ã³7.3 ã§ã® Subleq å®è£
ãšåæ§ã®ããã»ã¹ãããŒãäœãããã«gotoæã«çœ®ãæããããŠããŸãã
>
> ? 7.3 ãµãã³ãŒã
> 7.3 Subleq ã³ãŒã
>
> Cããã®ã³ã³ãã€ã«ãããSubleqãã¡ã¢ãªã«åãŸããªãã£ããããSubleqã³ãŒãã®ã¢ãžã¥ã©ãŒäºéä¹èšç®ã¯æåã§æžãããŠããŸãã
> ? 以äžã®ã³ãŒãã¯83ã®åœä»€ãæã£ãŠããŸããããã¯32ãããã¯ãŒãã®1Kbã«ãé©åããŸãã
> 83 ã®åœä»€ãæã€ã 32 ãããã¯ãŒãã® 1KB ã«é©åããã³ãŒãã以äžã«ã
>
> 1 ãã0 0 Start ã¹ã¿ãŒã
> 2
> 3 ãã. A:5029 B:1 MOD:5039
> 4 ãã. Z:0 K:0 X:1
> 5
> 6 ããStart: éå§ïŒ
> 7 ããA Z; Z K; Z
> 8
> 9 ããLoop: ã«ãŒãïŒ
> 10 ããmu_a; K mu_a
> 11 ããmu_b; X mu_b
> 12
> 13
> 14 ããMult: ãã«ãïŒ
> 15 ããmu_r
> 16
> 17 ããmu_begin:
> 18 ããt2; mu_a t2 mu_return:N2
> 19
> 20 ããdm_a; mu_a dm_a
> 21 ããdm_b; C2 dm_b
> 22 ããdm_return; N3L dm_return
> 23 ããt2 t2 DivMod
> 24
> 25 ããN3:
> 26 ããdm_m t2 ?+3
> 27
> 28 ããmu_b mu_r
> 29
> 30 ããmu_a; dm_z mu_a
> 31 ããmu_b Z; Z mu_b; Z Z mu_begin
> 32
> 33 ãã. mu_a:0 mu_b:0 mu_r:0
> 34
> 35 ãã#Mult ? ïŒæ宀 # ä¹ç®
> 36
> 37
> 38 ããN2:
> 39 ããdm_a; mu_r Z; Z dm_a; Z
> 40 ããdm_b; MOD dm_b
> 41
> 42 ããdm_return; N1L dm_return
> 43 ããZ Z DivMod
> 44
> 45 ããN1:
> 46 ããX; dm_m X
> 47
> 48 ããC1 K ?+3
> 49 ããZ Z Loop ã«ãŒã
> 50
> 51 ããC1 A
> 52 ããB A END
> 53 ããB Z; Z A; Z
> 54 ããK K Start ã¹ã¿ãŒã
> 55
> 56 ããEND: çµäºïŒ
> 57 ããX (-1)
> 58 ããZ Z (-1)
> 59
> 60 ããDivMod:
> 61
> 62 ããdm_z
> 63 ããdm_m
> 64
> 65 ããdm_start:
> 66 ããt1; dm_b t1
> 67 ããdm_a t1 ?+6
> 68 ããdm_a dm_m; Z Z dm_return:0
> 69
> 70 ããdm_b1; dm_b Z; Z dm_b1; Z
> 71 ããdm_i1; C1 dm_i1
> 72
> 73ããdm_next:
> 74 ããdm_bp; dm_b1 dm_bp
> 75 ããdm_ip; dm_i1 dm_ip
> 76
> 77 ããdm_b1 Z; Z dm_b1; Z
> 78 ããdm_i1 Z; Z dm_i1; Z
> 79 ããt1; dm_b1 t1
> 80 ããdm_a t1 dm_next
> 81
> 82 ããdm_bp dm_a
> 83 ããdm_ip Z; Z dm_z; Z Z dm_start
> 84
> 85 ãã. dm_a:0 dm_b:0 dm_z:0
> 86 ãã. dm_m:0 dm_b1:0 dm_ip:0
> 87 ãã. dm_i1:0 dm_bp:0 t1:0
> 88
> 89 ãã#divMod
> 90
> 91 ãã. N1L:-N1 N3L:-N3 t2:0
> 92 ãã. C1:1 C2:2 0
>
> 3è¡ç®ãš4è¡ç®ã¯ãäžèšã®Cã®äŸã§å€æ°ãå®çŸ©ããæ¹æ³ãšåæ§ã®å€æ°ãå®çŸ©ããŠããŸãã
> Aã¯äºééä¹ãèšç®ãããæ°ãå®çŸ©ããã Bã¯éå§çªå·ã§ã - ç§ãã¡ã®å Žåã¯1ã§ãããäžè¬çã«ã¯ä»»æã®æ°ã«ããããšãã§ããŸãã
> ã¿ã¹ã¯ã䞊åããã»ããµéã§åæ£ããããšãç¯å²BããAã¯ããå°ããªç¯å²ã«åå²ãããç¬ç«ããŠããã»ããµã«æåºãããã
> å®äºãããšãçµæã¯åéãããããã«åŠçãããŸãã
> MODã¯ã¢ã«ãŽãªãºã ã®ã¢ãžã¥ã©ã¹ã§ãã
> Zã¯SubleqãŒãã¬ãžã¹ã¿ã§ãã
> Kã¯Aãã1ãŸã§ã®äžéå€ã§ãã
> ? X ry ã
> ãã㊠Xã¯çŽ¯ç©ãããçµæã§ãã
>
> 7è¡ç®ãKãåæåããã
> 10è¡ç®ãš11è¡ç®ã¯ã14è¡ç®ãš35è¡ç®ã®éã«æžãããä¹ç®ã¢ã«ãŽãªãºã ã®ä»®åŒæ°ãæºåããŸãã
> ä¹ç®ã¢ã«ãŽãªãºã ã®ãã®ã³ãŒãã¯ãåã®ãµãã»ã¯ã·ã§ã³ã§èšè¿°ãããé¢æ°Multã«ã»ãŒ1察1ã«çžåœããŸãã
>
>
> Page 22
>
> ?23?
>
>
> ? ry é¢æ°ãé¢æ°ã§ããã ry ã
> å¯äžã®è€åäœã¯ãããã§ç·šæãããDivModæ©èœãé¢æ°ã§ããããã®ã³ãŒãã23è¡ç®ãš43è¡ç®ããåå©çšãããŠãããšããããšã§ãã
> ? ry ãé¢æ°ã®æ£åŒãªåŒæ°ãšæ»ãã¢ãã¬ã¹ãåæ ry ã
> ãããå¯èœã«ããã«ã¯ãé¢æ°ã®ä»®åŒæ°ããªã¿ãŒã³ã¢ãã¬ã¹ã«åæåããå¿
èŠããããŸãã
> ãªã¿ãŒã³ã¢ãã¬ã¹ã¯ãéæ¥ã©ãã«N1Lããã³N3Lãä»ããŠã³ããŒãããŸãã
>
> ? ry ãé€ç®ã®çµæ ry ã
> 39è¡ãš40è¡ã¯ãä¹ç®ã®çµæãåãåããé€ç®ã®åŒæ°ãåæåããŸãã
> 42è¡ãš43è¡ã¯ãªã¿ãŒã³ã¢ãã¬ã¹ãåæåããDivModãåŒã³åºããŸãã
> 46è¡ç®ã¯çµæãXã«æœåºããŸãã
>
> ? ry å°ãããã©ããã ry ã
> 48è¡ãš49è¡ã¯Kãæžåãã1ããå°ãããããã§ãã¯ããŸãã
> ããã§ãªããã°ãå埩å
šäœããKã1ã ãå°ããããŠç¹°ãè¿ãããã
> KããŒãã«éããå Žåã¯ãé²ã¿ãŸãã
>
> è¡51-54ã¯AãæžåããAãBã«éãããã©ããããã§ãã¯ããã
> ? ã¯ãã®å Žåã¯ãENDãšã©ãã«ä»ãããŸãã
> ãã yes ãªãã°ãã©ãã« END ãžé£ã³ãŸãã
> ? ããã§ãªãå Žåã¯ã7è¡ç®ã«æ»ããããäžåºŠããã»ã¹å
šäœãç¹°ãè¿ããŸãããAãAãæ°ããå€ãAãšããŸãã
> ããããã§ãªããªãã°ã 7 è¡ç®ãžé£ã³ãããŠããã»ã¹å
šäœãåã³ç¹°è¿ããŸããä»åºŠã¯ãå°ãããªã£ã A ãšãããŠåœç¶ A ã®æ°ããå€ãª K ãšå
±ã«å§ãŸããŸãã
>
> ? 57è¡ç®ã¯ãçµæãå°å·ããããšã§ãã
> 57 è¡ç®ã¯åž°çµãšããŠçµæ衚瀺ããŸãã
> ãã®åœä»€ã¯ãSubleqããšãã¥ã¬ãŒããããšãã«äŸ¿å©ã§ãã
> ããããFPGAããŒãäžã§ã®èšç®ã§ã¯ãããŒãã«å
¥åºååŠçã®æŠå¿µããªãããããã®åœä»€ã¯ååšããŸããã
> 次ã®ã©ã€ã³58ã¯æå¹ãªSubleqåæ¢ã³ãã³ãã§ããã
>
> 60?89è¡ç®ã¯ãäžèšã®ãµãã»ã¯ã·ã§ã³ã®Cã§æ瀺ãããé¢æ°DivModã®å¯Ÿå¿ããSubleqã³ãŒãã§ãã
>
> ? ry ãDivModãäžæçãªt2ã2ã€ã®å®æ°1ãš2ã®åŒã³åºãã®æ»ãã¢ãã¬ã¹ãå®çŸ©ããŸãã
> æåŸã«ã91è¡ç®ãš92è¡ç®ã¯ãDivMod åŒåºãã®ãªã¿ãŒã³ã¢ãã¬ã¹ãšããã³ãã©ãª t2 ãšã2 ã€ã®å®æ° 1 ãš 2 ãšãå®çŸ©ããŸãã
> ? ry 4.5ããã®ä¹ç®åŒã®é€ ry ã
> åŸè
ã¯ã4.5 ã«ããä¹ç®åŒå
ã®é€ç®ã«å¿
èŠã§ãã
>
> åèæç®
>
> 1ã
> ãžã§ãŒã³ãºããã°ã©ã¹W.
> ïŒ1988幎6æïŒã
> "究極ã®RISC"ã
> ACM SIGARCH Computer Architecture NewsïŒãã¥ãŒãšãŒã¯ïŒACMïŒ16ïŒ3ïŒïŒ48ïŒ55ã
> 2ã
> Oleg Mazonkaã "ãããã³ããŒïŒç©¶æ¥µã®èšç®ã®åçŽã"ã
> Complex Systems Journal 2011ãVol 19ãN3ãpp.263-285
> 3ã
>
http://esolangs.org/wiki/TOGA_computer
> 4ã
>
http://esolangs.org/wiki/ByteByteJump
> 5ã
> ?
http://esolangs.org/wiki/ Subleqã®åç
§ã»ã¯ã·ã§ã³ã®æŽŸçèšèª
>
http://esolangs.org/wiki/Subleq# ã®åç
§ã»ã¯ã·ã§ã³å
ã®æŽŸçèšèª
> 6ã
> ? ; MavaddatãFã ParhamiãB.
> Mavaddat, F.; ParhamiãB.
> ïŒ1988幎10æïŒã
> "URISCïŒç©¶æ¥µã®çž®å°åœä»€ã»ããã³ã³ãã¥ãŒã¿"ã
> åœéJ.é»æ°å·¥åŠæè² ïŒãã³ãã§ã¹ã¿ãŒå€§åŠåºçïŒ25ïŒ4ïŒïŒ 327?334
> 7ã
>
http://esolangs.org/wiki/Subleq
> 8ã
>
http://da.vidr.cc/projects/subleq/
> 9ã
>
http://www.sccs.swarthmore.edu/users/06/adem/engin/e25/finale/
>
>
> Page 23
>
> ?24?
>
>
> 10ã
>
http://techtinkering.com/articles/?id=22
> 11ã
>
http://esolangs.org/wiki/Higher_Subleq
>
>
>
> --
> ããªãŒãœãããŠãšã¢é¢é£ãã©ã³ãã£ã¢ã®çæ§ã«æè¬ç³äžããŸããšå
±ã«
> åœåçš¿å·çç·šéã®ç倧ã³ã¹ããžã®åŸ¡é
æ
®ã«åã埡瀌ç³äžããŸã
> äžè± UFJ éè¡ å¹³éæ¯åº ( æ® ) 0111481 ã€ãã°ãã»ã€ã»ã€
> éµäŸ¿å± 218æ®2449768 ã€ãã°ãã»ã€ã»ã€
> Yahoo pt 1362821068616323 Rakuten pt 1100-3310-4065-1717
>
http://yahoo.jp/HsDIGs?#_2TB_0S03224
>
>
>
> èšæ£ : Smalltalkã®èåŸã«ããèšèšåå
>
>
>>å³1ïŒ èšèªèšèšã®ã¹ã³ãŒã
>>ããã®èå¥åã®èšåã ãããªãªãžãã«ãªããžã§ã¯ãåç
§ã®çºã«å¿
èŠã§ãã
>>ãšããèšèªãäžæãæ©èœããŠããããèŠåºãæ¹æ³ã¯ã圌ãããã°ã©ã ãããŠããäºã圌ãããã£ãŠãããã®æ§ã§ãããã圌ããèŠãäºã§ãã
>>ã¡ãã»ãŒãžéä¿¡ã¡ã¿ãã¡ã¯ãã¡ãã»ãŒãžã®æå³ ïŒãã®ååã§å
·çŸåãããŠããïŒãããã®æå³ã®å®è¡ã®çºã«åä¿¡è
ã«ãã£ãŠäœ¿çšããããã®ã¡ãœãããããåé¢ãããšã«ãã£ãŠã¢ãžã¥ãŒã«æ§ãæäŸããã
>>ãå¿ã®äžã®å¥ãªããžã§ã¯ããçŽç²Ÿç¥çãªæ€
ååã¯æ€
åæ§ãšããŠé¡åšåããŸãã
> èšæ£ ( åŸå )
>>æäœãããªããžã§ã¯ãã«ã³ãŒããäŸåããŠããå Žåã
>>第2ã«ããŠãŒã¶ãŒã¯ç¹å®ã®ããŒãºãæºããã³ã³ããŒãã³ããããç°¡åã«äœçœ®æå®ããäºãã§ããŸãã
>>å æ¢å解ã§ã®å€±æãã¢ãžã¥ãŒã«æ§ã®ç Žãã«éããæ§ãããªãã¯ç®ã«ããŸãã
>>åå¿åçïŒ ãŠãŒã¶ãŒãã¢ã¯ã»ã¹å¯èœãªãã¹ãŠã®ã³ã³ããŒãã³ãã¯ããèªèº«ã芳å¯ãšæäœãšã®çºã®ææ矩ãªæ¹æ³ã§æ瀺ã§ããã¹ãã§ãã
>>ç¬ç«ãªããžã§ã¯ã矀ãããµãã·ã¹ãã ãèªç¶ã«çµã¿èŸŒãŸããŠãã Smalltalk: ããã§ã¯æ¢åã®å€§èŠæš¡ãªèšè¿°ã®å®å®ããã£ã³ãã¹ã«ã§ããŸãããããŠãããã¯ããŠãŒã¶ã€ã³ã¿ãã§ãŒã¹å
ã®ã³ã³ããŒãã³ããšããŠåç»ã§ãããŠãŒã¶ããšã®ã€ã³ã¿ã©ã¯ã·ã§ã³ãå蟌ãã§ããŸãã
> èŠåºã
>>ã¹ã³ãŒã : ã³ã³ãã¥ãŒã¿ã䜿çšããããã®èšèªã®ãã¶ã€ã³ã¯ãå
éšã¢ãã«ãå€éšã¡ãã£ã¢ãããã³ãããã®éã§ã®ã人éãšã³ã³ãã¥ãŒã¿ãšã®äž¡æ¹ã«ãããã€ã³ã¿ã©ã¯ã·ã§ã³ããååããã°ãªããŸããã
>>? è¯ããã¶ã€ã³ïŒ ry äžè¬çãªãã® ry ã¯çµ±äžãããæ çµã¿ã®äžã«ä¿æ ry ã
>>ã¡ãã»ãŒãžïŒ ã³ã³ãã¥ãŒãã£ã³ã°ã¯ãã¡ãã»ãŒãžãéä¿¡ããããšã«ãã£ãŠçµ±äžçåŒåºããã§ãããªããžã§ã¯ãåºææ©èœãšèŠãªãå¿
èŠããããŸãã
>>å æ°å解 ( å æ¢å解 é»æ¢å解 ) : ã·ã¹ãã å
ã®åç¬ç«ã³ã³ããŒãã³ã㯠1 ç®æã«ããçŸåºããŸããã
>
>
> èŠåºãçŽå ( : )
>>ãŠã©ãŒã ã¢ããã ããåŸãçºã«ã¯ãç§ã¯æè¡çããã瀟äŒçã§ããããããŠãããSmalltalkãããžã§ã¯ãã®ç¹å®ã®åãã«ãšã£ãŠå€§ããªåœ¹å²ãæããããšããååããå§ããŸãïŒ
>>ãèšèšã®äžè¬ååãæšæž¬ããããšãã§ããŸã :
>>èšèªã¯ãã®æ
å ±ã®éµã§ã :
>>ããªããžã§ã¯ãã®ã¡ã¿ãã¡ãå®å
šã«ãµããŒãããããã«äžå¯æ¬ ã§ã :
>>ããã¯ãã¶ã€ã³ã®3çªç®ã®ååã瀺åããŠããŸã :
>>ã°ãããã¶ã€ã³ãã®ååã¯ãèšèªã«ä»ããŠãèšããŸã :
>>ãã·ãã¥ã¬ãŒã·ã§ã³ã«ããããå«ããããã®å€æŽã¯äžèŠã§ã :
>>ç¶æ¿ã¯ããã¡ã¯ã¿ãªã³ã°ã®ããã«å®çšçãªå©ç¹ã瀺ããŠããŸã :
>>ããŒãã£ã«ãã·ã³ä»æ§ãšåŒã°ããŸã :
>>ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã®ååãªæè»æ§ãå®çŸããããã®æå¹æ¡ä»¶ã¯ããªããžã§ã¯ãæåãªååãšèšããŸã :
> èšæ£éèŠåºŠäœ
>>? è¯ããã¶ã€ã³ïŒ ry äžè¬çãªãã® ry ã¯çµ±äžãããæ çµã¿ã®äžã«ä¿æ ry ã
>>ãçµéšã¯æåéããªããã®ãã®ããšæœè±¡çãªããã®æ€
åã®ãããªãã®ããšã®åæ¹ãåŸãããŸãã
>>ç¶æ¿ãéããããå æ¢å解ãããèšèšãSmalltalk ã¯å¥šå±ããŸãã
>>Smalltalk ããŒãã£ã«ãã·ã³ã¯ãã¹ããŒãªããžçšã®ãªããžã§ã¯ãæåã¢ãã«ã
>>? ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã¯ã ry ã
>>Smalltalk ã¯ããèªäœã§ã¯ããªãã¬ãŒã·ã§ã³ã·ã¹ãã ããæã¡ãŸãã
>>ãã£ã¹ã¯ããããŒãžãèªã¿åããªã©ã®å¿
èŠãªããªããã£ããªãã¬ãŒã·ã§ã³ã¯è©±ãå¥ã§ãã