{"id":378,"date":"2018-05-06T03:42:55","date_gmt":"2018-05-05T18:42:55","guid":{"rendered":"http:\/\/tamatoyaku.com\/b\/?p=378"},"modified":"2018-05-06T03:42:55","modified_gmt":"2018-05-05T18:42:55","slug":"378","status":"publish","type":"post","link":"https:\/\/p-0.me\/b\/p\/378\/","title":{"rendered":"SystemVerilog\u3067Montgomery curves\u306e\u52a0\u7b97\u516c\u5f0f\u306e\u5b9f\u88c5"},"content":{"rendered":"<p>[mathjax]\u4eca\u56de\u306fSystemVerilog\u3067Montgomery curves\u306e\u5c04\u5f71\u5ea7\u6a19\u3067\u306e\u52a0\u7b97\u516c\u5f0f\u306e\u5b9f\u88c5\u3092\u3057\u305f\uff0e<br \/>\n\u6ce8\uff1a\u3053\u308c\u3068<a href=\"https:\/\/tamatoyaku.com\/b\/p\/375\">\u524d\u306e\u8a18\u4e8b<\/a>\u3092\u30bc\u30df\u8cc7\u6599\u3068\u3057\u3066<a href=\"https:\/\/tamatoyaku.com\/work\/semi2.pdf\">\u30b9\u30e9\u30a4\u30c9<\/a>\u306b\u307e\u3068\u3081\u305f\uff0e\u307e\u305f\uff0c\u30bc\u30df\u3067\u306e\u6307\u6458\u3092\u6700\u5f8c\u306b\u8ffd\u8a18\u3057\u305f\uff0e<br \/>\n<!--more--><br \/>\n<strong>1.<a href=\"https:\/\/tamatoyaku.com\/b\/p\/375\">\u524d\u56de<\/a>\u306e\u7d50\u679c\u304b\u3089<\/strong><br \/>\n\u52a0\u6e1b\u7b97\u5668\u30922\u3064\uff0c\u4e57\u7b97\u5668\u30921\u3064\u3067\u306f8\u30b9\u30c6\u30c3\u30d7\u3067\u51e6\u7406\u3092\u5b8c\u4e86\u3067\u304d\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\uff0e\u3057\u304b\u3057\uff0c\u4eca\u56de\u306f\u7c21\u5358\u306e\u305f\u3081\u52a0\u6e1b\u7b97\u56682\u3064\u3067\u306f\u306a\u304f\u52a0\u7b97\u56681\u3064\u3068\u6e1b\u7b97\u56681\u3064\u3067\u5b9f\u88c5\u3092\u884c\u3046\uff0e<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n<strong>2.\u69cb\u6210<\/strong><br \/>\n\u4eca\u56de\u306e\u30b7\u30b9\u30c6\u30e0\u306fcontrol unit,memory,adder,subtractor,multiplier\u306e5\u3064\u3067\u69cb\u6210\u3059\u308b\uff0e\u4ee5\u4e0b\u306b\u30b7\u30b9\u30c6\u30e0\u306e\u30d6\u30ed\u30c3\u30af\u56f3\u3068\u4fe1\u53f7\u306e\u6d41\u308c\u3092\u56f31\u3068\u3057\u3066\u793a\u3059\uff0e\u306a\u304a\uff0ccontrol unit\u306b\u5bfe\u3059\u308b\u5165\u529bX1,Z1,Xm,Zm,Xn,Zn\u3068\u51fa\u529bXmn,Zmn\u306f\u7c21\u5358\u306e\u305f\u3081\u7701\u7565\u3057\u3066\u3044\u308b\uff0e<br \/>\n\u52d5\u4f5c\u3068\u3057\u3066\u306fcontrol unit\u304cmemory\u306e\u5165\u529b\/\u51fa\u529b\u3092\u5236\u5fa1\u3057\uff0c\u6f14\u7b97\u3068memory\u3078\u306e\u7d50\u679c\u306e\u4fdd\u5b58\u3092\u7e70\u308a\u8fd4\u3057\u306a\u304c\u3089\uff0cXmn\u3068Zmn\u3092\u8a08\u7b97\u3059\u308b\uff0e<br \/>\n<a href=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/Untitled-Diagram-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-380 size-large\" src=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/Untitled-Diagram-5-1024x470.png\" alt=\"\" width=\"1024\" height=\"470\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u56f31 \u52a0\u7b97\u306b\u3064\u3044\u3066\u306e\u30d6\u30ed\u30c3\u30af\u56f3<\/p>\n<p>&nbsp;<br \/>\n<strong>2.1.control unit\u306e\u5185\u90e8\u72b6\u614b<\/strong><br \/>\ncontrol unit\u306e\u5185\u90e8\u72b6\u614b\u3068\u3057\u3066\u306finf\u3068count\u304c\u5b58\u5728\u3059\u308b\uff0einf\u306f\u52a0\u7b97\u306e\u5bfe\u8c61\u3068\u306a\u308b\u7247\u65b9\u306e\u70b9\u304c\u7121\u9650\u9060\u70b9(Z\u5ea7\u6a19\u304c0)\u306a\u30891\u3068\u3057\uff0c\u7121\u9650\u9060\u70b9\u3067\u306f\u306a\u3044\u65b9\u306e\u70b9\u3092Xmn,Zmn\u3068\u3057\u3066\u51fa\u529b\u3068\u3059\u308b\uff0ecount\u306f\u51e6\u7406\u306e\u30b9\u30c6\u30c3\u30d7\u30920\u304b\u30898\u3068\u3057\u3066\u4fdd\u6301\u3057\uff0ccontrol unit\u306fcount\u306e\u5024\u306b\u5408\u308f\u305b\u3066in_sel\u3084out_sel\u3092\u5909\u5316\u3055\u305b\u3066memory\u3092\u5236\u5fa1\u3059\u308b\uff0e<br \/>\n&nbsp;<br \/>\n<strong>2.2.in_sel,out_sel\u306e\u69cb\u9020<\/strong><br \/>\nin_sel,out_sel\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u69cb\u9020\u3068\u306a\u3063\u3066\u3044\u308b\uff0e<br \/>\nlogic [1:0] in_sel[2:0];<br \/>\nlogic [3:0] out_sel[5:0];<br \/>\nin_sel\u306f2\u30d3\u30c3\u30c8\u304c3\u3064\u306e\u914d\u5217\u3068\u306a\u3063\u3066\u3044\u308b\uff0ein_sel\u306f\u6f14\u7b97\u5668\u306e\u6f14\u7b97\u7d50\u679c\u3092memory\u306e\u3069\u3053\u306b\u683c\u7d0d\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\uff0e\u306a\u304a\uff0c\u5024\u306e\u6307\u5b9a\u306b\u306f6\u304c\u30aa\u30d5\u30bb\u30c3\u30c8\u3055\u308c\u308b\uff0e\u4f8b\u3048\u3070in_sel[1]\u306e\u5024\u304c1\u3067\u3042\u308b\u3068\u304d\uff0c\u6e1b\u7b97\u306e\u7d50\u679c\u306fmemory[7]\u306b\u4fdd\u5b58\u3055\u308c\u308b\uff0e<br \/>\n&nbsp;<\/p>\n<p style=\"text-align: center;\">\u88681 in_sel\u306e\u8aac\u660e<\/p>\n<table style=\"margin: 0 auto;\">\n<tbody>\n<tr>\n<td>in_sel[0]<\/td>\n<td>\u52a0\u7b97\u5668\u306e\u7d50\u679c\u3092memory\u306e\u4f55\u756a\u76ee\u306b\u683c\u7d0d\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>in_sel[1]<\/td>\n<td>\u6e1b\u7b97\u5668\u306e\u7d50\u679c\u3092memory\u306e\u4f55\u756a\u76ee\u306b\u683c\u7d0d\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>in_sel[2]<\/td>\n<td>\u4e57\u7b97\u5668\u306e\u7d50\u679c\u3092memory\u306e\u4f55\u756a\u76ee\u306b\u683c\u7d0d\u3059\u308b\u304b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nout_sel\u306f4\u30d3\u30c3\u30c8\u304c6\u3064\u306e\u914d\u5217\u3068\u306a\u3063\u3066\u3044\u308b\uff0eout_sel\u306f\u5404\u6f14\u7b97\u5668\u306e\u5165\u529b\u306bmemory\u306e\u3069\u3053\u306e\u756a\u5730\u3092\u51fa\u529b\u3059\u308b\u304b\u3068\u6c7a\u3081\u308b\uff0e<br \/>\n&nbsp;<\/p>\n<p style=\"text-align: center;\">\u88682 out_sel\u306e\u8aac\u660e<\/p>\n<table style=\"margin: 0 auto;\">\n<tbody>\n<tr>\n<td>out_sel[0]<\/td>\n<td>\u52a0\u7b97\u5668\u306e\u5165\u529ba\u306bmemory\u306e\u4f55\u756a\u76ee\u3092\u51fa\u529b\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>out_sel[1]<\/td>\n<td>\u52a0\u7b97\u5668\u306e\u5165\u529bb\u306bmemory\u306e\u4f55\u756a\u76ee\u3092\u51fa\u529b\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>out_sel[2]<\/td>\n<td>\u6e1b\u7b97\u5668\u306e\u5165\u529ba\u306bmemory\u306e\u4f55\u756a\u76ee\u3092\u51fa\u529b\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>out_sel[3]<\/td>\n<td>\u6e1b\u7b97\u5668\u306e\u5165\u529bb\u306bmemory\u306e\u4f55\u756a\u76ee\u3092\u51fa\u529b\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>out_sel[4]<\/td>\n<td>\u4e57\u7b97\u5668\u306e\u5165\u529ba\u306bmemory\u306e\u4f55\u756a\u76ee\u3092\u51fa\u529b\u3059\u308b\u304b<\/td>\n<\/tr>\n<tr>\n<td>out_sel[5]<\/td>\n<td>\u4e57\u7b97\u5668\u306e\u5165\u529bb\u306bmemory\u306e\u4f55\u756a\u76ee\u3092\u51fa\u529b\u3059\u308b\u304b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\n<strong>2.3.\u30e1\u30e2\u30ea\u306e\u914d\u7f6e<\/strong><br \/>\n\u30e1\u30e2\u30ea\u914d\u7f6e\u306e\u610f\u5473\u3092\u4ee5\u4e0b\u306e\u88683\u3068\u3057\u3066\u793a\u3059\uff0e<br \/>\n&nbsp;<\/p>\n<p style=\"text-align: center;\">\u88683 \u30e1\u30e2\u30ea\u914d\u7f6e\u306e\u8aac\u660e<\/p>\n<table style=\"margin: 0 auto;\">\n<tbody>\n<tr>\n<td>memory[0]<\/td>\n<td>X1<\/td>\n<\/tr>\n<tr>\n<td>memory[1]<\/td>\n<td>Z1<\/td>\n<\/tr>\n<tr>\n<td>memory[2]<\/td>\n<td>Xm<\/td>\n<\/tr>\n<tr>\n<td>memory[3]<\/td>\n<td>Zm<\/td>\n<\/tr>\n<tr>\n<td>memory[4]<\/td>\n<td>Xn<\/td>\n<\/tr>\n<tr>\n<td>memory[5]<\/td>\n<td>Zn<\/td>\n<\/tr>\n<tr>\n<td>memory[6]<\/td>\n<td>\u4e3b\u306b\u52a0\u7b97\u306e\u7d50\u679c<\/td>\n<\/tr>\n<tr>\n<td>memory[7]<\/td>\n<td>\u4e3b\u306b\u6e1b\u7b97\u306e\u7d50\u679c<\/td>\n<\/tr>\n<tr>\n<td>memory[8]<\/td>\n<td>\u4e3b\u306b\u4e57\u7b97\u306e\u7d50\u679c<\/td>\n<\/tr>\n<tr>\n<td>memory[9]<\/td>\n<td>\u4e3b\u306b\u4e57\u7b97\u306e\u7d50\u679c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\n<strong>2.4.\u5404\u4fe1\u53f7\u306b\u3064\u3044\u3066<\/strong><br \/>\n\u30d6\u30ed\u30c3\u30af\u56f3\u4e2d\u306e\u4fe1\u53f7\u306e\u610f\u5473\u306b\u3064\u3044\u3066\uff0c\u4ee5\u4e0b\u306b\u88684\u3068\u3057\u3066\u793a\u3059\uff0e<br \/>\n&nbsp;<\/p>\n<p style=\"text-align: center;\">\u88684 \u30d6\u30ed\u30c3\u30af\u56f3\u4e2d\u306e\u4fe1\u53f7\u306e\u8aac\u660e<\/p>\n<table style=\"margin: 0 auto;\">\n<tbody>\n<tr>\n<td>\u4fe1\u53f7\u540d<\/td>\n<td>\u30d3\u30c3\u30c8\u5e45<\/td>\n<td>\u914d\u5217\u5e45<\/td>\n<td>\u8aac\u660e<\/td>\n<\/tr>\n<tr>\n<td>clk<\/td>\n<td>1<\/td>\n<td><\/td>\n<td>\u30af\u30ed\u30c3\u30af\u4fe1\u53f7<\/td>\n<\/tr>\n<tr>\n<td>rst<\/td>\n<td>1<\/td>\n<td><\/td>\n<td>memory\u306b\u5bfe\u3059\u308b\u30ea\u30bb\u30c3\u30c8\u4fe1\u53f7\uff0e\u8ca0\u8ad6\u7406\u3067\uff0c0\u306e\u5834\u5408\u306fmemory[0]\u304b\u3089memory[5]\u306bX1,Z1,Xm,Zm,Xn,Zn\u3092\u30ed\u30fc\u30c9\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>in_sel<\/td>\n<td>[1:0]<\/td>\n<td>[2:0]<\/td>\n<td>0&lt;=i&lt;=2\u306b\u3064\u3044\u3066\uff0cmemory[6+in_sel[i]]=calc_out[i];\u3068\u3057\u3066\u4f7f\u3046<\/td>\n<\/tr>\n<tr>\n<td>out_sel<\/td>\n<td>[3:0]<\/td>\n<td>[5:0]<\/td>\n<td>0&lt;=i&lt;=5\u306b\u3064\u3044\u3066\uff0cmemory_out[i]=memory[out_sel[i]];\u3068\u3057\u3066\u4f7f\u3046<\/td>\n<\/tr>\n<tr>\n<td>X1,Z1,Xm,Zm,Xn,Zn<\/td>\n<td>[N-1:0]<\/td>\n<td><\/td>\n<td>\u52a0\u7b97\u306b\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf<\/td>\n<\/tr>\n<tr>\n<td>memory_out<\/td>\n<td>[N-1:0]<\/td>\n<td>[5:0]<\/td>\n<td>\u30e1\u30e2\u30ea\u304b\u3089\u306e\u51fa\u529b\uff0e\u6f14\u7b97\u5668\u306b\u5bfe\u3059\u308b\u5165\u529b\u3068\u306a\u308b\uff0e<\/td>\n<\/tr>\n<tr>\n<td>calc_out<\/td>\n<td>[N-1:0]<\/td>\n<td>[2:0]<\/td>\n<td>\u6f14\u7b97\u5668\u306e\u51fa\u529b\uff0e\u30e1\u30e2\u30ea\u3078\u306e\u5165\u529b\u3068\u306a\u308b\uff0e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\n&nbsp;<br \/>\n<strong>3.\u5236\u5fa1\u4fe1\u53f7\u306e\u8a2d\u8a08<\/strong><br \/>\ncontrol unit\u306fin_sel,out_sel\u3092\u7528\u3044\u3066memory\u3092\u5236\u5fa1\u3057\uff0cXmn\u3068Zmn\u3092\u8a08\u7b97\u3059\u308b\uff0e\u8a08\u7b97\u306e\u305f\u3081\uff0c\u524d\u56de\u793a\u3057\u305f\u52a0\u7b97\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u304b\u3089\u5236\u5fa1\u4fe1\u53f7\u3068\u3057\u3066in_sel,out_sel\u306b\u4f55\u3092\u51fa\u529b\u3059\u308b\u3079\u304d\u304b\u3092\u8003\u3048\u308b\uff0e\u6700\u521d\u306b8\u30b9\u30c6\u30c3\u30d7\u306e\u306a\u304b\u3067\uff0cmemory\u3068\u6f14\u7b97\u5668\u304c\u3069\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308c\u3070\u3088\u3044\u306e\u304b\u8003\u3048\u3066\u307f\u308b\uff0e<br \/>\n\u3053\u3053\u3067M\u306fmemory\u306e\u4e2d\u306e\u30c7\u30fc\u30bf\u3092\u8868\u3057\uff0cM[0]\u304b\u3089M[5]\u306b\u306fX1,Z1,Xm,Zm,Xn,Zn\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3068\u3059\u308b\uff0e\u306a\u304a\uff0c\u5de6\u8fba\u306e\u6dfb\u5b57\u30926+?\u3068\u3057\u3066\u3044\u308b\u306e\u306fmemory\u306b\u5165\u529b\u3059\u308b\u306e\u306fmemory[6]\u304b\u3089memory[9]\u3067\u3042\u308a\uff0cin_sel\u306f2\u30d3\u30c3\u30c8\u3067\u8868\u3059\u305f\u3081\u3067\u3042\u308b\uff0e\u307e\u305f\uff0c<span style=\"color: #99ccff;\">\u6c34\u8272<\/span>\u3067\u793a\u3057\u305f\u90e8\u5206\u306f\u672c\u6765\u5fc5\u8981\u306a\u3044\u8a08\u7b97\u3067\u3042\u308a\uff0c\u7d50\u679c\u306fmemory\u306e\u4f7f\u308f\u306a\u3044\u90e8\u5206\u306b\u683c\u7d0d\u3057\u3066\u3044\u308b\uff0e<br \/>\nstep1<\/p>\n<p style=\"padding-left: 30px;\">M[6+0]=M[4]+M[5]<\/p>\n<p style=\"padding-left: 30px;\">M[6+1]=M[2]-M[3]<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+2]=M[0]*M[0]<\/span><\/p>\n<p>step2<\/p>\n<p style=\"padding-left: 30px;\">M[6+0]=M[2]+M[3]<\/p>\n<p style=\"padding-left: 30px;\">M[6+1]=M[4]-M[5]<\/p>\n<p style=\"padding-left: 30px;\">M[6+2]=M[6]*M[7]<\/p>\n<p>step3<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+0]=M[0]+M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+1]=M[0]-M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\">M[6+3]=M[6]*M[7]<\/p>\n<p>step4<\/p>\n<p style=\"padding-left: 30px;\">M[6+0]=M[8]+M[9]<\/p>\n<p style=\"padding-left: 30px;\">M[6+1]=M[8]-M[9]<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+2]=M[0]*M[0]<\/span><\/p>\n<p>step5<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+0]=M[0]+M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+3]=M[0]-M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\">M[6+2]=M[6]*M[6]<\/p>\n<p>step6<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+0]=M[0]+M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+1]=M[0]-M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\">M[6+3]=M[7]*M[7]<\/p>\n<p>step7<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+0]=M[0]+M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+1]=M[0]-M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\">M[6+2]=M[1]*M[8]<\/p>\n<p>step8<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+0]=M[0]+M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #99ccff;\">M[6+1]=M[0]-M[0]<\/span><\/p>\n<p style=\"padding-left: 30px;\">M[6+3]=M[0]*M[9]<\/p>\n<p>\u4e0a\u8a18\u306e\u547d\u4ee4\u304b\u3089\uff0c\u5236\u5fa1\u4fe1\u53f7\u3092\u69cb\u6210\u3059\u308b\uff0e<strong>2.2.in_sel,out_sel\u306e\u69cb\u9020<\/strong>\u3088\u308a\u5236\u5fa1\u4fe1\u53f7\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\uff0e\u306a\u304a\uff0c\u914d\u5217\u306e\u6dfb\u5b57\u304c\u5c0f\u3055\u3044\u65b9\u304c\u53f3\u5074\u306b\u306a\u308b\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066\u3044\u308b\uff0e<br \/>\n&nbsp;<br \/>\nstep1<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: <span style=\"color: #99ccff;\">10<\/span> 01 00<\/p>\n<p style=\"padding-left: 30px;\">out_sel : <span style=\"color: #99ccff;\">0000 0000<\/span> 0011 0010 0101 0100<\/p>\n<p>step2<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: 10 01 00<\/p>\n<p style=\"padding-left: 30px;\">out_sel : 0111 0110 0101 0100 0011 0010<\/p>\n<p>step3<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: 11 <span style=\"color: #99ccff;\">01 00<\/span><\/p>\n<p style=\"padding-left: 30px;\">out_sel : 0111 0110 <span style=\"color: #99ccff;\">0000 0000 0000 0000<\/span><\/p>\n<p>step4<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: <span style=\"color: #99ccff;\">10<\/span> 01 00<\/p>\n<p style=\"padding-left: 30px;\">out_sel : <span style=\"color: #99ccff;\">0000 0000<\/span> 1001 1000 1001 1000<\/p>\n<p>step5<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: 10 <span style=\"color: #99ccff;\">11 00<\/span><\/p>\n<p style=\"padding-left: 30px;\">out_sel : 0110 0110 <span style=\"color: #99ccff;\">0000 0000 0000 0000<\/span><\/p>\n<p>step6<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: 11 <span style=\"color: #99ccff;\">01 00<\/span><\/p>\n<p style=\"padding-left: 30px;\">out_sel : 0111 0111\u00a0<span style=\"color: #99ccff;\">0000 0000 0000 0000<\/span><\/p>\n<p>step7<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: 10 <span style=\"color: #99ccff;\">01 00<\/span><\/p>\n<p style=\"padding-left: 30px;\">out_sel : 1000 0001\u00a0<span style=\"color: #99ccff;\">0000 0000 0000 0000<\/span><\/p>\n<p>step8<\/p>\n<p style=\"padding-left: 30px;\">in_sel\u00a0 \u00a0: 11 <span style=\"color: #99ccff;\">01 00<\/span><\/p>\n<p style=\"padding-left: 30px;\">out_sel : 1001 0000<span style=\"color: #99ccff;\">\u00a00000 0000 0000 0000<\/span><\/p>\n<p>&nbsp;<br \/>\n\u4e0a\u8a18\u306e\u5236\u5fa1\u4fe1\u53f7\u3092control unit\u304ccount\u306b\u5408\u308f\u305b\u3066\u51fa\u529b\u3059\u308b\u3053\u3068\u3067\uff0c\u610f\u56f3\u3057\u305f\u3068\u304a\u308a\u306b\u8a08\u7b97\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b\uff0e<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n<strong>4.SystemVerilog\u306b\u3088\u308b\u5b9f\u88c5<\/strong><br \/>\n<strong>4.1.adder,subtractor,multiplier<\/strong><br \/>\n\u4ee5\u4e0b\u306b\u6f14\u7b97\u5668\u306e\u30b3\u30fc\u30c9\u3092\u793a\u3059\uff0e\u306a\u304a\uff0c\u3053\u3053\u3067\u306f\u6f14\u7b97\u306fSystemVerilog\u306e\u6a5f\u80fd(\u52a0\u7b97\uff0c\u6e1b\u7b97\uff0c\u4e57\u7b97\uff0c\u5270\u4f59)\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\uff0e\u3053\u308c\u306f\u5f8c\u304b\u3089\u3088\u308a\u9ad8\u901f\u306a\u3082\u306e\u3078\u5909\u66f4\u3059\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u304c\uff0c\u3053\u3053\u3067\u306f\u5f8c\u56de\u3057\u3068\u3057\u3066\u3044\u308b\uff0e<br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/b6fac449a348473d88e8f1cec99751cd.js\"><\/script><br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/9eff8cc8c2a14060a571b0d5577b6203.js\"><\/script><br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/b9164b2a336e140bcda0704fcc71e65b.js\"><\/script><br \/>\n<strong>4.2.memory<\/strong><br \/>\n\u4ee5\u4e0b\u306bmemory\u306e\u30b3\u30fc\u30c9\u3092\u793a\u3059\uff0e<br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/91e5d306c393208f3655c7987636a6d9.js\"><\/script><br \/>\n&nbsp;<br \/>\n<strong>4.3.control unit<\/strong><br \/>\ncontrol unit\u306e\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306b\u793a\u3059<br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/c89386718da3d503265d5447f446a17c.js\"><\/script><br \/>\n<strong>5.\u52d5\u4f5c\u78ba\u8a8d<\/strong><br \/>\n<strong>5.1.\u4f7f\u7528\u3059\u308b\u66f2\u7dda\u3068\u70b9<\/strong><br \/>\n\u4f7f\u7528\u3059\u308b\u66f2\u7dda\u306f\\(y^2=x^3+84x^2+x\\)\u3067\uff0c\\(p=65521\\)\u3068\u3059\u308b\uff0e\u307e\u305f\uff0c\u70b9\u306b\u3064\u3044\u3066\u306f\\(P_1=(5731,1),P_m=(51081,56042),P_n=(19818,18646)\\)\u00a0 \u00a0 \u00a0\\(P_{m+n}=P_m+P_n=(5951,21120)\\)\u3068\u3059\u308b\uff0e\u306a\u304a\uff0c\\(mod\\ p,mod\\ l\\)\u3092\u8a08\u7b97\u3059\u308b\u969b\u306b\\(p,l\\)\u304c\u64ec\u30e1\u30eb\u30bb\u30f3\u30cc\u7d20\u6570\u3067\u3042\u308b\u3068\u90fd\u5408\u304c\u826f\u3044\u306e\u3067\uff0c\u4eca\u5f8c\u306f\u305d\u308c\u3082\u5ff5\u982d\u306b\u7f6e\u3044\u3066\u304a\u304f\uff0e<br \/>\n&nbsp;<br \/>\n<strong>5.2.\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong><br \/>\n\u4ee5\u4e0b\u306bModelSim-Altera\u3067\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3057\u305f\u7d50\u679c\u3092\u4ee5\u4e0b\u306b\u793a\u3059\uff0e\u306a\u304a\uff0c\u753b\u50cf\u306f\u30af\u30ea\u30c3\u30af\u3057\u3066\u62e1\u5927\u3057\u306a\u3044\u3068\u5c0f\u3055\u304f\u3066\u898b\u3048\u306a\u3044\uff0e<br \/>\n&nbsp;<br \/>\n<a href=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/sim.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-381 size-large\" src=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/sim-1024x289.png\" alt=\"\" width=\"1024\" height=\"289\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u56f32 \u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u7d50\u679c<\/p>\n<p>\u4e0a\u8a18\u306e\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u7d50\u679c\u3088\u308a\uff0c\u6b63\u3057\u304f\\(P_{m+n}=(5951,21120)\\)\u304c\u8a08\u7b97\u3067\u304d\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308b\uff0e\u307e\u305f\uff0c\u52a0\u7b97\u3059\u308b\u70b9\u306e\u7247\u65b9\u3092\u7121\u9650\u9060\u70b9(Z\u5ea7\u6a19\u304c0)\u3068\u3057\u305f\u3068\u304d\u306e\u7d50\u679c\u3092\u4ee5\u4e0b\u306b\u793a\u3059\uff0e<br \/>\n<a href=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/sim2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-382 size-large\" src=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/sim2-1024x287.png\" alt=\"\" width=\"1024\" height=\"287\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u56f33 \\(P_m\\)\u304c\u7121\u9650\u9060\u70b9\u306e\u5834\u5408\u306e\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u7d50\u679c<\/p>\n<p><a href=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/sim3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-383 size-large\" src=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/sim3-1024x289.png\" alt=\"\" width=\"1024\" height=\"289\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u56f34 \\(P_n\\)\u304c\u7121\u9650\u9060\u70b9\u306e\u5834\u5408\u306e\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u7d50\u679c<\/p>\n<p>\u70b9\u306e\u52a0\u7b97\u304c\u7121\u9650\u9060\u70b9\u306e\u5834\u5408\uff0c\u3082\u3046\u7247\u65b9\u306e\u70b9\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u308b\uff0e\u3088\u3063\u3066\uff0c\u52a0\u7b97\u306f\u6b63\u3057\u304f\u5b9f\u884c\u3067\u304d\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308b\uff0e<br \/>\n&nbsp;<br \/>\n<strong>6.\u30bc\u30df\u767a\u8868\u3067\u306e\u5148\u751f\u306e\u6307\u6458<\/strong><br \/>\n\u3053\u306e\u72b6\u614b\u3067\u306f\u6f14\u7b97(+,-,*)\u3068\\(mod\\ p\\)\u3092SystemVerilog\u306e+,-,*,%\u6f14\u7b97\u5b50\u3092\u7528\u3044\u3066\u5b9f\u88c5\u3057\u3066\u3044\u308b\uff0e\u52a0\u6e1b\u7b97\u306b\u3064\u3044\u3066\u306f\u52a0\u6e1b\u7b97\u81ea\u4f53\u306e\u5b9f\u88c5\u306f\u5bb9\u6613\u3067\u3042\u308a\uff0c\\(mod\\ p\\)\u306e\u8a08\u7b97\u3082\u7d50\u679c\u306e\u5927\u5c0f\u6bd4\u8f03\u3092\u884c\u3044\\(p\\)\u3092\u52a0\u7b97(\u6e1b\u7b97)\u3059\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u3067\u304d\u308b\uff0e<br \/>\n\u3057\u304b\u3057\uff0c\u4e57\u7b97\u306b\u3064\u3044\u3066\u306f\u305d\u308c\u307b\u3069\u7c21\u5358\u3067\u306f\u306a\u304f\uff0c\u64ec\u30e1\u30eb\u30bb\u30f3\u30cc\u7d20\u6570\u3092\u7528\u3044\u308b\u5834\u5408\u306f\u300c\u3042\u308b\u610f\u54733\u56de\u4e57\u7b97\u3092\u884c\u3046\u3053\u3068\u306b\u306a\u308b\u300d\u305f\u3081\uff0cmultiplier\u306e\u5f8c\u308d\u306b\u30d6\u30ed\u30c3\u30af\u3092\u4ed8\u3051\u52a0\u3048\u308b\u3060\u3051\u3067\u306f\u4e0d\u5341\u5206\u3067\u3042\u308a\uff0c\u30b9\u30c6\u30fc\u30c8\u30de\u30b7\u30f3\u81ea\u4f53\u3092\u6539\u9020\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\uff0e<br \/>\n&nbsp;<br \/>\n\u6b21\u306b\u884c\u3046\u4f5c\u696d\u3068\u3057\u3066\u306f2\u500d\u7b97(+Montgomery ladder\u307e\u3067?)\u3092\u884c\u3046\u304b\uff0c\\(mod\\ p\\)\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u304b\uff0c2\u3064\u306e\u9078\u629e\u80a2\u304c\u3042\u3063\u305f\u304c\u5148\u306b\\(mod\\ p\\)\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u3053\u3068\u3068\u3057\u305f\uff0e\u3053\u308c\u306f\uff0c\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u81ea\u4f53\u306b\u5909\u66f4\u304c\u5fc5\u8981\u306a\u53ef\u80fd\u6027\u304c\u3042\u308a\uff12\u500d\u7b97\u3092\u5148\u306b\u5b9f\u88c5\u3057\u3066\u3082\u5927\u5e45\u306a\u4fee\u6b63\u304c\u5fc5\u8981\u3068\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3067\u3042\u308b\uff0e<br \/>\n\u3088\u3063\u3066\uff0c\\(p\\)\u304c\u64ec\u30e1\u30eb\u30bb\u30f3\u30cc\u7d20\u6570\u306b\u304a\u3051\u308b\\(mod\\ p\\)\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u305f\u3081\uff0c&#8221;Optimal Extension Fields for Fast Arithmetic in Public-Key Algorithms&#8221;\u3092\u8aad\u307f\u89e3\u304f\u4f5c\u696d\u306b\u5165\u308b\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[mathjax]\u4eca\u56de\u306fSystemVerilog\u3067Montgomery curves\u306e\u5c04\u5f71\u5ea7\u6a19\u3067\u306e\u52a0\u7b97\u516c\u5f0f\u306e\u5b9f\u88c5\u3092\u3057\u305f\uff0e \u6ce8\uff1a\u3053\u308c\u3068\u524d\u306e\u8a18\u4e8b\u3092\u30bc\u30df\u8cc7\u6599\u3068\u3057\u3066\u30b9\u30e9\u30a4\u30c9\u306b\u307e\u3068\u3081\u305f\uff0e\u307e\u305f\uff0c\u30bc\u30df\u3067\u306e\u6307\u6458\u3092\u6700\u5f8c\u306b\u8ffd\u8a18\u3057\u305f\uff0e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":0,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"wp:attachment":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}