Atelier des rouesLab FR
Objects/Documentation

neurones.v

I give both binary-layer descriptions.

Download ↓
// Four fixed bipolar threshold neurons. x[j]=1 encodes +1, x[j]=0 encodes -1.
module dot_unit #(parameter [7:0] W=0, parameter integer T=0)
    (input [7:0] x, output y);
    integer i;
    reg signed [4:0] total;
    always @* begin
        total=0;
        for(i=0;i<8;i=i+1)
            total=total+((x[i]==W[i]) ? 5'sd1 : -5'sd1);
    end
    assign y=($signed(total)>=T);
endmodule

module pop_unit #(parameter [7:0] W=0, parameter integer T=0)
    (input [7:0] x, output y);
    wire [7:0] hit=~(x^W);

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.