Quiero comparar dos matrices multidimensionales con cada elemento de una matriz con la otra matriz. ¿Cuál es el procedimiento para hacerlo posible?
timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 09:21:01 01/08/2015
// Design Name:
// Module Name: FACTORISING_INTEGER
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
module FACTORISING_INTEGER(
input [15:0] f,g,
//output reg [15:0] b,c,
output reg [15:0]mem,
//output reg [15:0]memc[15:0],
input clk
);
reg [15:0]memb[15:0];
reg [15:0]memc[15:0];
reg [15:0] b,c ;
integer address;
integer i,j;
always@(posedge clk)
begin
for(i=1;i<=f;i=i+1)
begin
if(f % i == 0)
begin
$display("%b is the factor of f ",i);
#100;
b<=i;
memb[i]<=b;
end
end
for(j=1;j<=g;j=j+1)
begin
if(g % j == 0)
begin
$display("%b is the factor of g ",j);
#100;
c<=j;
memc[j]<=c;
end
end
end
always@(posedge clk)
begin
for(address=0;address<16;address=address+1)
begin
if(memc[address]==(memb[address]))
#100
mem[address]<=memb[address];
else if(memb[address]>(memc[address]))
#100
mem[address]<=memb[address];
else if(memc[address]>(memb[address]))
#100
mem[address]<=memc[address];
end
end
endmodule