{"id":283158,"date":"2016-12-28T10:30:09","date_gmt":"2016-12-28T07:30:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283158"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283158","title":{"rendered":"\u041e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u041f\u041b\u0418\u0421 \u2014 \u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d. \u0417\u0432\u0443\u043a\u0438 \u0438 \u043c\u0443\u0437\u044b\u043a\u0430"},"content":{"rendered":"<p><em>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0443 \u043d\u0430\u0441 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u0435\u0434\u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u044f\u044f \u0441\u0435\u0440\u0438\u044f \u043f\u0440\u043e \u041f\u041b\u0418\u0421 \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0443 \u0424\u0440\u0435\u043d\u043a\u0438. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0435\u0440\u0438\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/316234\/\">1<\/a>, <a href=\"https:\/\/habrahabr.ru\/post\/316586\/\">2<\/a>.<\/em><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7f7\/4f9\/4e0\/7f74f94e04cc4d53956f2e899a184327.gif\" align=\"left\"\/>\u041c\u044b \u0443\u0436\u0435 <a href=\"https:\/\/habrahabr.ru\/post\/316234\/\">\u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u0442\u043e\u043d\u043e\u0432\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043f\u043e \u0440\u0430\u0434\u0438\u043e<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u044b \u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u0438 \u0438 \u043c\u0443\u0437\u044b\u043a\u0443.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u041f\u041b\u0418\u0421 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a. \u041a \u0424\u0440\u0435\u043d\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430 25.175 \u041c\u0413\u0446. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0434\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0441\u043b\u044b\u0448\u0438\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442 \u0438 \u043f\u043e\u0434\u0430\u0442\u044c \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u041f\u041b\u0418\u0421, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0437\u0432\u0443\u043a. \u041c\u0435\u043d\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0432\u0443\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0432\u0443\u0447\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c\u044b\u0439 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043b\u0443\u0445\u0430\u0447 \u0432 \u0434\u043e\u043c\u0435 \u2014 \u041c\u0430\u0448\u0430. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0447\u0430\u0441\u0442\u043e\u0442 \u0432 60 \u041a\u0413\u0446 \u2014 \u044d\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u0448\u0443\u0442\u043a\u0438! )))<br clear=\"left\"\/>  <\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0421\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0432\u0443\u043a\u0430, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u043a \u0438\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 &quot;\u0417\u043d\u0430\u0442\u043e\u043a&quot; (\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441 \u0445\u043e\u0434\u0443 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b). \u0414\u0438\u043d\u0430\u043c\u0438\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e \u043a \u0432\u044b\u0432\u043e\u0434\u0443 \u041f\u041b\u0418\u0421 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u0441 \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c 470 \u041e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4df\/611\/220\/4df611220c714e0587b69cde50ad2bf8.png\"\/><\/p>\n<h1>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0437\u0432\u0443\u043a<\/h1>\n<p>  <\/p>\n<p>\u0412 \u041f\u041b\u0418\u0421 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0424\u0440\u0435\u043d\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 16 \u0431\u0438\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0442 0 \u0434\u043e 65535. \u0418\u043c\u0435\u044f \u043d\u0430\u0448\u0438 25.175 \u041c\u0413\u0446 \u0438 16 \u0431\u0438\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0432\u0443\u043a \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 25175000 \/ 65536 = 384,14 \u0413\u0446<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output wire audio;  \/\/ \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0430 16 \u0431\u0438\u0442 reg [15:0] counter; always @(posedge clk) counter &lt;= counter+1;  \/\/ \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0438\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u043a assign audio = counter[15];  endmodule<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/QKK7aBGS52g?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u041d\u043e\u0442\u0430 \u00ab\u041b\u042f\u00bb \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u043a\u0442\u0430\u0432\u044b (440 \u0413\u0446)<\/h1>\n<p>  <\/p>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u0443, \u0440\u0430\u0432\u043d\u0443\u044e 440 \u0413\u0446. \u042d\u0442\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043d\u043e\u0442\u044b &quot;\u041b\u042f&quot; \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u043a\u0442\u0430\u0432\u044b.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043d\u0430 65536, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 57216 (27175000 \u0413\u0446 \/ 440 \u0413\u0446).<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output wire audio;  \/\/ \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0430 16 \u0431\u0438\u0442 reg [15:0] counter; initial counter &lt;= 16'd0;  always @(posedge clk) begin     if(counter==57216) begin         counter &lt;= 0;      end else begin         counter &lt;= counter + 1'b1;     end end  assign audio = counter[15];  endmodule<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/yXZBuGCIajI?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0425\u043e\u0442\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0438 \u0440\u0430\u0432\u043d\u0430 440 \u0413\u0446, \u043d\u043e \u0441\u043a\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 50%. \u041d\u0438\u0437\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u043e\u0442 0 \u0434\u043e 32767, \u0430 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043e\u0442 32767 \u0434\u043e 56817. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0442\u043e\u043b\u044c\u043a\u043e 42% \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043a\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c 50% \u2014 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0432\u0430. \u0422\u043e \u0435\u0441\u0442\u044c, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430 28608, \u0430 \u0437\u0430\u0442\u0435\u043c \u0435\u0449\u0435 \u043d\u0430 2.<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output audio;  \/\/ \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0430 15 \u0431\u0438\u0442 reg [14:0] counter; initial counter &lt;= 15'd0;  always @(posedge clk) begin     if(counter==28608) begin         counter &lt;= 0;      end else begin         counter &lt;= counter + 1'b1;     end end  reg audio; always @(posedge clk) if(counter==28608) audio &lt;= ~audio;  endmodule<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430 \u0441\u043b\u0443\u0445 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/FAJLaJBBABU?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0439 \u043a\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 clkdivider. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0447\u0435\u0442\u0430 \u0432 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439. \u0420\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u041f\u041b\u0418\u0421 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output audio;  parameter clkdivider = 25175000\/440\/2;  reg [14:0] counter; initial counter &lt;= 15'd0;  always @(posedge clk) begin     if(counter==0) begin         counter &lt;= clkdivider - 1'b1;      end else begin         counter &lt;= counter - 1'b1;     end end  reg audio; always @(posedge clk) if(counter==0) audio &lt;= ~audio;  endmodule<\/code><\/pre>\n<p>  <\/p>\n<h1>\u0421\u0438\u0440\u0435\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0439 \u043f\u043e\u043c\u043e\u0449\u0438<\/h1>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0447\u0435\u0440\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u043e\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c<br \/>  \u0441\u0447\u0435\u0442\u0447\u0438\u043a (\u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e tone) \u043d\u0430 24 \u0431\u0438\u0442\u0430, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u043e\u0440\u044f\u0434\u043a\u0430 1.5 \u0413\u0446.<br \/>  \u042d\u0442\u043e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output audio;  parameter clkdivider = 25175000\/440\/2;  reg [14:0] counter; initial counter &lt;= 15'd0;  reg [23:0] tone; initial tone &lt;= 24'd0; always @(posedge clk) tone &lt;= tone+1;  always @(posedge clk) begin     if(counter==0) begin         counter &lt;= (tone[23] ? clkdivider-1 : clkdivider\/2-1);      end else begin         counter &lt;= counter - 1'b1;     end end  reg audio; always @(posedge clk) if(counter==0) audio &lt;= ~audio;  endmodule<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/ncdPQsfWp3E?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0446\u0435\u0439\u0441\u043a\u0443\u044e \u0441\u0438\u0440\u0435\u043d\u0443. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a tone \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0435\u043c \u0431\u044b\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e 23 \u0431\u0438\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0434\u0432\u043e\u0435 (\u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 3 \u0413\u0446).<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0442\u0440\u044e\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c &quot;\u043f\u0438\u043b\u0443&quot;. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0431\u0438\u0442\u044b \u0441 15 \u043f\u043e 21 \u0438\u0437 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0442\u043e\u043d\u0430. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a: <code>tone[21:15]<\/code>. \u042d\u0442\u0438 7 \u0431\u0438\u0442 \u0434\u0430\u0434\u0443\u0442 \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 127, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u0442\u044c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 127, \u043e\u043d\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0432 0 \u0438 \u043d\u0430\u0447\u043d\u0435\u0442 \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0431\u0438\u0442\u044b. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a: <code>(~tone[21:15])<\/code>. \u042d\u0442\u0438\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0443\u0442 \u0432\u043d\u0438\u0437 \u043e\u0442 127 \u0434\u043e 0, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0438\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043b\u0430\u0432\u043d\u043e \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043b\u0430\u0432\u043d\u043e \u0441\u043f\u0430\u0434\u0430\u0435\u0442,<br \/>  \u0432\u043e\u0437\u044c\u0435\u043c \u0431\u0438\u0442 <code>tone[22]<\/code>.<\/p>\n<p>  <\/p>\n<pre><code>wire [6:0] ramp = (tone[22] ? tone[21:15] : ~tone[21:15]);  \/\/ \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \/\/ &quot;if tone[22]=1 then ramp=tone[21:15] else ramp=~tone[21:15]&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0438\u043b\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0438\u043b\u044b \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 <code>7'b0000000<\/code> \u0434\u043e <code>7'b1111111<\/code>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0432\u0443\u043a, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0441\u043b\u043e\u0432\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u043b\u044b \u0435\u0449\u0435 2 \u0431\u0438\u0442\u0430 <code>'01'<\/code> \u0441\u043b\u0435\u0432\u0430 \u0438 \u0448\u0435\u0441\u0442\u044c \u0431\u0438\u0442 <code>'000000'<\/code> \u0441\u043f\u0440\u0430\u0432\u0430.<\/p>\n<p>  <\/p>\n<pre><code>wire [14:0] clkdivider = {2'b01, ramp, 6'b000000};<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u044e\u0449\u0435\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 clkdivider \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 <code>15'b010000000000000<\/code> \u0434\u043e <code>15'b011111111000000<\/code>, \u0438\u043b\u0438 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e\u0442 <code>15'h2000<\/code> \u0434\u043e <code>15'h3FC0<\/code>, \u0438\u043b\u0438 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 8192 to 16320. \u041f\u0440\u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 25.175 \u041c\u0413\u0446 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0437\u0432\u0443\u043a \u0441\u0438\u0440\u0435\u043d\u044b \u043e\u0442 771 \u0413\u0446 \u0434\u043e 1537 \u0413\u0446.<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output audio;  reg [14:0] counter; initial counter &lt;= 15'd0;  reg [23:0] tone; initial tone &lt;= 24'd0; always @(posedge clk) tone &lt;= tone+1;  wire [6:0] ramp = (tone[22] ? tone[21:15] : ~tone[21:15]);  wire [14:0] clkdivider = {2'b01, ramp, 6'b000000};  always @(posedge clk) begin     if(counter==0) begin         counter &lt;= clkdivider;     end else begin         counter &lt;= counter - 1'b1;     end end  reg audio; always @(posedge clk) if(counter==0) audio &lt;= ~audio;  endmodule<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/nO7-Ag8yKCM?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0418 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0441\u0438\u0440\u0435\u043d\u0443. \u041d\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0441\u0438\u0440\u0435\u043d\u0430 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043d\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0443\u044e. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0437\u044f\u0442\u044c \u0431\u0438\u0442\u044b <code>tone[21:15]<\/code> \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043f\u0438\u043b\u044b, \u0438 \u0431\u0438\u0442\u044b <code>tone[24:18]<\/code> \u0434\u043b\u044f \u043f\u0438\u043b\u044b \u0441 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439.<\/p>\n<p>  <\/p>\n<pre><code>wire [6:0] fastsweep = (tone[22] ? tone[21:15] : ~tone[21:15]); wire [6:0] slowsweep = (tone[25] ? tone[24:18] : ~tone[24:18]); wire [14:0] clkdivider = {2'b01, (tone[27] ? slowsweep : fastsweep), 6'b000000};<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 tone.<\/p>\n<p>  <\/p>\n<pre><code>module epm7064_test(clk, audio); input wire clk; output audio;  reg [14:0] counter; initial counter &lt;= 15'd0;  reg [27:0] tone; initial tone &lt;= 28'd0; always @(posedge clk) tone &lt;= tone+1;  wire [6:0] ramp = (tone[22] ? tone[21:15] : ~tone[21:15]);  wire [6:0] fastsweep = (tone[22] ? tone[21:15] : ~tone[21:15]); wire [6:0] slowsweep = (tone[25] ? tone[24:18] : ~tone[24:18]); wire [14:0] clkdivider = {2'b01, (tone[27] ? slowsweep : fastsweep), 6'b000000};  always @(posedge clk) begin     if(counter==0) begin         counter &lt;= clkdivider;     end else begin         counter &lt;= counter - 1'b1;     end end  reg audio; always @(posedge clk) if(counter==0) audio &lt;= ~audio;  endmodule<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/ABj0ZFJ-T9g?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u0418\u0433\u0440\u0430\u0435\u043c \u043c\u0435\u043b\u043e\u0434\u0438\u044e<\/h1>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c, \u0432 \u0447\u0435\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u0434\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u043f\u0435\u0441\u0435\u043d\u043a\u0443 \u043f\u0440\u043e \u0451\u043b\u043e\u0447\u043a\u0443. \u041f\u043e\u0438\u0449\u0435\u043c <a href=\"http:\/\/balalaika.org.ru\/music-sheets\/little_christmas_tree.png\">\u043d\u043e\u0442\u044b<\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=DMPIZOSefHA\">\u0432\u0438\u0434\u0435\u043e<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0438\u0433\u0440\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u043f\u0435\u0441\u0435\u043d\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u0440\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u043e\u0442, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u043a\u0432\u0435\u043d\u0441\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u043e\u0442\u044b, \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0442\u044b \u043c\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0434\u043b\u044f \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043d\u043e\u0442\u0443.<\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0438\u0434\u0435\u043e, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043e\u043a\u0442\u0430\u0432\u0430 + 1. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432\u0441\u0435 \u043d\u043e\u0442\u044b \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u044b.<br \/>  \u0410 \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e 7 \u043d\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0441\u043d\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u043d\u043e\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 3 \u0431\u0438\u0442. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435 \u043d\u043e\u043c\u0435\u0440 \u043d\u043e\u0442\u044b, \u0430 \u043d\u043e\u043c\u0435\u0440 \u0442\u043e\u043d\u0430 \u0438\u043b\u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0432 \u043c\u0435\u043b\u043e\u0434\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0432 \u043c\u0435\u043b\u043e\u0434\u0438\u0438 \u0435\u0441\u0442\u044c \u043d\u043e\u0442\u044b: \u0434\u043e, \u0440\u0435, \u043c\u0438, \u0444\u0430, \u0441\u043e\u043b\u044c, \u043b\u044f \u0438 \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u043a\u0442\u0430\u0432\u044b. \u041c\u044b \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u043e\u043d\u0443\u043c\u0435\u0440\u0443\u0435\u043c. \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f:<\/p>\n<p>  <\/p>\n<pre><code>\u0441\u043e\u043b\u044c           5 \u043c\u0438 \u043c\u0438         3 3  \u0441\u043e\u043b\u044c           5 \u043c\u0438 \u043c\u0438         3 3  \u0441\u043e\u043b\u044c \u0444\u0430 \u043c\u0438 \u0440\u0435 \u0434\u043e    5 4 3 2 1  \u043b\u044f \u0434\u043e(+1) \u043b\u044f \u0441\u043e\u043b\u044c \u043c\u0438 \u043c\u0438 \u0441\u043e\u043b\u044c \u0444\u0430 \u043c\u0438 \u0440\u0435 \u0434\u043e<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0440\u0438\u0441\u0443\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4a1\/f9c\/c07\/4a1f9cc07a5e436f8e0a808e0b1b6dc8.JPG\"\/><\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043d\u043e\u0442 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0445 \u043e\u043a\u0440\u0443\u0433\u043b\u0438\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2d6\/a4f\/5e2\/2d6a4f5e2eae47c7973d71ddbb93d4cd.png\"\/><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u044b \u043e\u043a\u043e\u043d\u0447\u0435\u043d\u044b, \u043e\u043f\u0438\u0448\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>  <\/p>\n<p>\u0414\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 \u043d\u043e\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code>wire [15:0] clkdivider =                           (note_num == 0) ? 16'd0 :                          (note_num == 1) ? 16'b1011101111110000 :                          (note_num == 2) ? 16'b1010011101110000 :                          (note_num == 3) ? 16'b1001010100110000 :                          (note_num == 4) ? 16'b1000110011010000 :                          (note_num == 5) ? 16'b0111110101110000 :                          (note_num == 6) ? 16'b0110111111000000 :                          (note_num == 7) ? 16'b0101111000000000 : 16'd0;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435, \u0441\u0435\u043a\u0432\u0435\u043d\u0441\u043e\u0440 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 64 \u0448\u0430\u0433\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 tone.<\/p>\n<p>  <\/p>\n<pre><code>reg [27:0] tone; initial tone &lt;= 28'd0; always @(posedge clk) tone &lt;= tone + 1'b1;  wire [5:0] step_num = tone[26:(26-5)];  \/\/ 6 \u0431\u0438\u0442 \u044d\u0442\u043e \u043e\u0442 0 \u0434\u043e 63<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043d\u043e\u043c\u0435\u0440\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0448\u0430\u0433\u0430 \u0441\u0435\u043a\u0432\u0435\u043d\u0441\u043e\u0440\u0430 \u0432 \u043d\u043e\u043c\u0435\u0440 \u043d\u043e\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code>wire [2:0] note_num =                        (step_num == 0) ? 5 :    \/\/ 1                       (step_num == 1) ? 5 :    \/\/ 2                       (step_num == 2) ? 0 :    \/\/ 3                       (step_num == 3) ? 0 :    \/\/ 4                       (step_num == 4) ? 3 :    \/\/ 5                       (step_num == 5) ? 0 :    \/\/ 6                       (step_num == 6) ? 3 :    \/\/ 7                       (step_num == 7) ? 0 :    \/\/ 8                       (step_num == 8) ? 5 :    \/\/ 9                       (step_num == 9) ? 5 :    \/\/ 10                       (step_num ==10) ? 0 :    \/\/ 11                       (step_num ==11) ? 0 :    \/\/ 12                       (step_num ==12) ? 3 :    \/\/ 13                       (step_num ==13) ? 0 :    \/\/ 14                       (step_num ==14) ? 3 :    \/\/ 15                       (step_num ==15) ? 0 :    \/\/ 16 ... \u0438 \u0442. \u0434.<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>module epm7064_test(clk, audio); input wire clk; output audio;  reg [15:0] counter; initial counter &lt;= 16'd0;  reg [27:0] tone; initial tone &lt;= 28'd0; always @(posedge clk) tone &lt;= tone + 1'b1;  wire [5:0] step_num = tone[26:(26-5)];  wire [2:0] note_num =                        (step_num == 0) ? 5 :    \/\/ 1                       (step_num == 1) ? 5 :    \/\/ 2                       (step_num == 2) ? 0 :    \/\/ 3                       (step_num == 3) ? 0 :    \/\/ 4                       (step_num == 4) ? 3 :    \/\/ 5                       (step_num == 5) ? 0 :    \/\/ 6                       (step_num == 6) ? 3 :    \/\/ 7                       (step_num == 7) ? 0 :    \/\/ 8                       (step_num == 8) ? 5 :    \/\/ 9                       (step_num == 9) ? 5 :    \/\/ 10                       (step_num ==10) ? 0 :    \/\/ 11                       (step_num ==11) ? 0 :    \/\/ 12                       (step_num ==12) ? 3 :    \/\/ 13                       (step_num ==13) ? 0 :    \/\/ 14                       (step_num ==14) ? 3 :    \/\/ 15                       (step_num ==15) ? 0 :    \/\/ 16                        (step_num ==16) ? 5 :    \/\/ 17                       (step_num ==17) ? 0 :    \/\/ 18                       (step_num ==18) ? 4 :    \/\/ 19                       (step_num ==19) ? 0 :    \/\/ 20                       (step_num ==20) ? 3 :    \/\/ 21                       (step_num ==21) ? 0 :    \/\/ 22                       (step_num ==22) ? 2 :    \/\/ 23                       (step_num ==23) ? 0 :    \/\/ 24                       (step_num ==24) ? 1 :    \/\/ 25                       (step_num ==25) ? 1 :    \/\/ 26                       (step_num ==26) ? 1 :    \/\/ 27                       (step_num ==27) ? 1 :    \/\/ 28                       (step_num ==28) ? 0 :    \/\/ 29                       (step_num ==29) ? 0 :    \/\/ 30                       (step_num ==30) ? 0 :    \/\/ 31                       (step_num ==31) ? 0 :    \/\/ 32                        (step_num ==32) ? 6 :    \/\/ 33                       (step_num ==33) ? 6 :    \/\/ 34                       (step_num ==34) ? 0 :    \/\/ 35                       (step_num ==35) ? 0 :    \/\/ 36                       (step_num ==36) ? 7 :    \/\/ 37                       (step_num ==37) ? 0 :    \/\/ 38                       (step_num ==38) ? 6 :    \/\/ 39                       (step_num ==39) ? 0 :    \/\/ 40                       (step_num ==40) ? 5 :    \/\/ 41                       (step_num ==41) ? 5 :    \/\/ 42                       (step_num ==42) ? 0 :    \/\/ 43                       (step_num ==43) ? 0 :    \/\/ 44                       (step_num ==44) ? 3 :    \/\/ 45                       (step_num ==45) ? 0 :    \/\/ 46                       (step_num ==46) ? 3 :    \/\/ 47                       (step_num ==47) ? 0 :    \/\/ 48                        (step_num ==48) ? 5 :    \/\/ 49                       (step_num ==49) ? 0 :    \/\/ 50                       (step_num ==50) ? 4 :    \/\/ 51                       (step_num ==51) ? 0 :    \/\/ 52                       (step_num ==52) ? 3 :    \/\/ 53                       (step_num ==53) ? 0 :    \/\/ 54                       (step_num ==54) ? 2 :    \/\/ 55                       (step_num ==55) ? 0 :    \/\/ 56                       (step_num ==56) ? 1 :    \/\/ 57                       (step_num ==57) ? 1 :    \/\/ 58                       (step_num ==58) ? 1 :    \/\/ 59                       (step_num ==59) ? 1 :    \/\/ 60                       (step_num ==60) ? 0 :    \/\/ 61                       (step_num ==61) ? 0 :    \/\/ 62                       (step_num ==62) ? 0 :    \/\/ 63                       (step_num ==63) ? 0 :    \/\/ 64                         0;  wire [15:0] clkdivider =                           (note_num == 0) ? 16'd0 :                          (note_num == 1) ? 16'b1011101111110000 :                          (note_num == 2) ? 16'b1010011101110000 :                          (note_num == 3) ? 16'b1001010100110000 :                          (note_num == 4) ? 16'b1000110011010000 :                          (note_num == 5) ? 16'b0111110101110000 :                          (note_num == 6) ? 16'b0110111111000000 :                          (note_num == 7) ? 16'b0101111000000000 : 16'd0;  always @(posedge clk) begin     if(counter==0) begin         counter &lt;= clkdivider;     end else begin         counter &lt;= counter - 1'b1;     end end  reg audio; always @(posedge clk) if(counter==0) audio &lt;= ~audio;  endmodule<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f<\/p>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/9DZTW11HW3k?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u041c\u0430\u0448\u0430 \u043e\u0434\u043e\u0431\u0440\u044f\u0435\u0442 \ud83d\ude09 ^_^<\/p>\n<p>  <\/p>\n<h1>\u0412\u044b\u0432\u043e\u0434\u044b<\/h1>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u041f\u041b\u0418\u0421 \u043d\u0430 64 \u044f\u0447\u0435\u0439\u043a\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0432 \u0440\u043e\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0434\u043b\u044f \u0441\u0438\u0440\u0435\u043d\u044b \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043c\u0435\u043b\u043e\u0434\u0438\u0435\u0439 \u043f\u0440\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e \u0451\u043b\u043e\u0447\u043a\u0443, \u0437\u0430\u043d\u044f\u043b 61 \u044f\u0447\u0435\u0439\u043a\u0443 \u0438\u0437 64-\u0445. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0432\u0435\u0440\u043d\u043e\u0439 \u0437\u0432\u043e\u043d\u043e\u043a (\u043f\u0440\u0438\u0432\u0435\u0442 90\u0435!).<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b: <a href=\"https:\/\/github.com\/UA3MQJ\/epm7064_audio\"><a href=\"https:\/\/github.com\/UA3MQJ\/epm7064_audio\">https:\/\/github.com\/UA3MQJ\/epm7064_audio<\/a><\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u0434\u0435\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0441\u0442\u0430\u0442\u044c\u0438 \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/fpga4fun.com\/\">fpga2fun<\/a> \u2014 <a href=\"http:\/\/fpga4fun.com\/MusicBox.html\">Music Box<\/a>.<\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/317876\/\"> https:\/\/habrahabr.ru\/post\/317876\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><em>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0443 \u043d\u0430\u0441 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u0435\u0434\u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u044f\u044f \u0441\u0435\u0440\u0438\u044f \u043f\u0440\u043e \u041f\u041b\u0418\u0421 \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0443 \u0424\u0440\u0435\u043d\u043a\u0438. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0435\u0440\u0438\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/316234\/\">1<\/a>, <a href=\"https:\/\/habrahabr.ru\/post\/316586\/\">2<\/a>.<\/em><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7f7\/4f9\/4e0\/7f74f94e04cc4d53956f2e899a184327.gif\" align=\"left\"\/>\u041c\u044b \u0443\u0436\u0435 <a href=\"https:\/\/habrahabr.ru\/post\/316234\/\">\u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u0442\u043e\u043d\u043e\u0432\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043f\u043e \u0440\u0430\u0434\u0438\u043e<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u044b \u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u0438 \u0438 \u043c\u0443\u0437\u044b\u043a\u0443.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u041f\u041b\u0418\u0421 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a. \u041a \u0424\u0440\u0435\u043d\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430 25.175 \u041c\u0413\u0446. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0434\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0441\u043b\u044b\u0448\u0438\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442 \u0438 \u043f\u043e\u0434\u0430\u0442\u044c \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u041f\u041b\u0418\u0421, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0437\u0432\u0443\u043a. \u041c\u0435\u043d\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0432\u0443\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0432\u0443\u0447\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c\u044b\u0439 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043b\u0443\u0445\u0430\u0447 \u0432 \u0434\u043e\u043c\u0435 \u2014 \u041c\u0430\u0448\u0430. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0447\u0430\u0441\u0442\u043e\u0442 \u0432 60 \u041a\u0413\u0446 \u2014 \u044d\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u0448\u0443\u0442\u043a\u0438! )))<br clear=\"left\"\/>  <\/p>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283158","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283158"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283158\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}