Advertisement
toweber

relu.v

Aug 29th, 2022
1,239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module relu #(parameter WIDTH=4)    (in1, out);  
  2.    input signed [WIDTH-1:0] in1;
  3.    output reg signed [WIDTH-1:0] out;
  4.  
  5.    always @(in1)
  6.      begin
  7.         if (in1 > 0)
  8.           out <= in1;
  9.         else
  10.           out <= 0;        
  11.      end
  12.        
  13. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement