OpenCores
URL https://opencores.org/ocsvn/artificial_neural_network/artificial_neural_network/trunk

Subversion Repositories artificial_neural_network

[/] [artificial_neural_network/] [trunk/] [ANN_kernel/] [RTL_VHDL_files/] [layers_pkg.vhd] - Diff between revs 3 and 7

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 3 Rev 7
Line 232... Line 232...
   function calculate_addr_l(NumIn : integer; NumN : int_vector; n : integer) return integer is -- matrix + b_sel
   function calculate_addr_l(NumIn : integer; NumN : int_vector; n : integer) return integer is -- matrix + b_sel
      variable addr_l : integer := log2(NumIn)+log2(NumN(0)); -- return value. Initialized with the weight memory length of the first layer
      variable addr_l : integer := log2(NumIn)+log2(NumN(0)); -- return value. Initialized with the weight memory length of the first layer
   begin
   begin
      -- Calculate the maximum of the weight memory length:
      -- Calculate the maximum of the weight memory length:
      for i in 1 to n-1 loop
      for i in 1 to n-1 loop
         addr_l := max2( addr_l, log2(NumN(i-1)+log2(NumN(i))) );
         addr_l := max2( addr_l, log2(NumN(i-1))+log2(NumN(i)) );
      end loop;
      end loop;
      addr_l := addr_l +1; -- add bias select bit
      addr_l := addr_l +1; -- add bias select bit
      return addr_l;
      return addr_l;
   end calculate_addr_l;
   end calculate_addr_l;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.