FPGAã§ããªãã¥ã¢ã®ååãã©ã³ãã ã«è¡¨ç¤ºãã
ããã¯ããªãã¥ã¢ Advent Calendar 2014ã®10æ¥ç®ã®è¨äºã§ãã
ç»é²ã¯ãããããã¿ã«å°ã£ãã®ã§æè¿è²·ã£ãFPGAãã¼ãã使ã£ã¦ã©ã³ãã ã«ããªãã¥ã¢ã®ååã表示ããåè·¯ãä½ããã¨ã«ãã¾ããã
FPGAã¯Digilentã®Basys3ï¼Xilinxã®Artix-7ãå
¥ã£ãè©ä¾¡ãã¼ãï¼ãç¨ãã¾ãã
ã¨ã¯è¨ã£ã¦ãã表示系ã«VGAãç¨ããã®ã¯æéãèããã¨è¾ãã®ã§ã7ã»ã°ã«è¡¨ç¤ºãããã¨ã«ãã¾ããã
7ã»ã°ãªã®ã§å½ç¶èªèãã«ããæåãããã¾ããããã®è¾ºã¯å²ãåããã¨ã«ãã¾ãã
ï¼å¤§å¥½ããªãã¥ã¢ãã¤ã³ãèå¥ã§ãããªããã
ã¾ãã¯ãä»æ§ã®ç¢ºèªã§ãã
Basys3のマニュアル(pdf)ãèªãã¨ã¢ãã¼ãã³ã¢ã³ã®7ã»ã°ã4ã¤ä»ãã¦ãã¦ãã«ã½ã¼ãå´ã¯4ã¤ã®7ã»ã°ã§å
±éã¨ã®ãã¨ã
å¶å¾¡ã®ã¿ã¤ãã³ã°ããããã¦ããã®ã§ããããåèã«å
¥åãä½ãã¾ãã
Basys3ã®ã¯ããã¯ã¯100MHzãªã®ã§é©å½ã«åå¨ãã¦åã¢ãã¼ãã®ãã©ã³ã¸ã¹ã¿ãONã«ãã250usãããã®ä¿¡å·ãä½ãã¾ãã
1clk=1nsãªã®ã§2^18ã«ã¦ã³ãããã¨ç´262usã
ãã®ã¯ããã¯ã§ã¢ãã¼ããå¶å¾¡ãã¾ãã
ããã«ã4æååãã表示ã§ããªãã®ã§ã¹ã¯ãã¼ã«ããå¿
è¦ãããã®ã§ã
åå¨ããã¯ããã¯ã2^8ã«ã¦ã³ããã¾ãã
ãã®ãããã¯é©å½ã«ãã©ã¤ãã¨ãåããæ©ãããªããï¼é
ãããªããï¼ã¨è¦ãªããé©å½ã«èª¿æ´ãã¾ãã
ãã¨ã¯ãããªãã¥ã¢ã®ååã7ã»ã°ã§è¡¨ç¤ºããããã«å¤æãã¾ãã
ã«ã½ã¼ãå´ãONã»OFFãã¦æåãä½ãã®ã§ã¹ã¤ãããONããã¨ãããæ¶ç¯ãã¦ãOFFããã¨ããç¹ç¯ãã¾ãã
ã¢ã«ãã¡ãããã¯wikipediaの7セグããã¿ã¼ã³ã使ããã¨ã«ãã¾ãã
1æåã{DP, CG, CF, CE, CD, CC, CB, CA}ã®é çªã«ä¸¦ã¹ãã¨
ãã¨ãã°ã"CURE PINE"ã§ããã°"11000110_11100011_10101111_10000110_11111111_10001100_11111011_10101011_10000110"ã¨ãªãã¾ãã
ãã¨ã¯è¡¨ç¤ºããããã£ã©åãããä½ã£ã¦IDã«å¯¾ãã¦ååãåºåããåè·¯ãä½ãã°OKã§ãã
ï¼å®éã«ã¯ãã£ã©ã¯ã¿åã¯16æååã¨ãã¦ç¢ºä¿ãã¦ãä½ã£ãé¨åã¯æ¶ç¯ã§åãã¦ãã¾ãã
ã¹ã¯ãã¼ã«ã®å®è£
ã¯ãã®ãã¼ã¿ã8bit(1æå)ãã¤å¾ªç°ãããã°ç°¡åã«ã§ãã¾ãã
ãã¦ãå
¨å¡åã®ååã表示ãããããã«ãªã£ãããã©ã³ãã ã«é¸æããé¨åãå®è£
ãã¾ãã
åè·¯ã§ã©ã³ãã ã£ã½ãã®ãå®ç¾ããã«ã¯LFSRãã¤ããã®ãç°¡åã§ãã
ããªãã¥ã¢ã®TVã·ãªã¼ãºã®ã¡ã³ãã§ããã°63éãããã°å
åãªã®ã§ã6bitã®LFSRãè¨ç®ãããã¿ã³ãæ¼ããæã®å¤ãIDã¨ãã¦ä½¿ãã¾ãã
ã¨ãããã¨ã§ããã¿ã³ãæ¼ãã¨ããªãã¥ã¢ã®ååãã©ã³ãã ã«è¡¨ç¤ºãããåè·¯ãã§ããããã¾ããã
以ä¸ãããªãã¥ã¢ã®ååãã©ã³ãã ã«è¡¨ç¤ºããåè·¯ã§ããã