title: Sinus in verilog
body: <p>So I need to get sinus waveform.
  In cases I have wrote values of x and y axis in range of 2pi</p>
  
  <p>how to get the waveform of the sinus in this range?</p>
  
  <pre><code>module sinus1(in,clk,res,out);
  input clk,res;
  input [7:0]in;
  output reg [7:0]out;
  always @(posedge clk)
  if (res)
  case (in)
  8'b00000000: out&lt;=8'b10000000;
  8'b00000001: out&lt;=8'b10000011;
  8'b00000010: out&lt;=8'b10000110;
  8'b00000011: out&lt;=8'b10001001;
  8'b00000100: out&lt;=8'b10001100;
  8'b00000101: out&lt;=8'b10001111;
  8'b00000110: out&lt;=8'b10010010;
  ...
  ...
  ...
  8'b11111111: out&lt;=8'b01111101;
  endcase
  else out&lt;=8'b00000000;
  endmodule
  
  module testbench;
  reg clk,res;
  reg [7:0]in;
  sinus1 sinusoid(in,clk,res,out);
  always #5 clk=~clk
  initial
  begin
  clk=0;res=0;
  #5 res=1;
  #5000 $finish;
  end
  endmodule
  </code></pre>