Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // パーセプトロン
- module perceptron#(
- parameter NUM_INPUT = 2,
- parameter BIT_WIDTH = 8
- )(
- input wire [NUM_INPUT-1:0][BIT_WIDTH-1:0] x, w,
- output wire [BIT_WIDTH-1:0] out);
- assign out = fire(x,w);
- function [BIT_WIDTH-1:0] fire;
- input wire [NUM_INPUT-1:0][BIT_WIDTH-1:0] x, w;
- fire = 0;
- for (integer i=0;i<NUM_INPUT;++i) begin
- fire = fire + x[i] * w[i];
- end
- endfunction
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement