• how to get the sign of each row in matrix

    From nitin sapre@21:1/5 to All on Thu Jan 23 20:15:14 2020
    i have a matrix



    i need to get sign of each rows



    L =

    3.4000 -4.4000 4.7000 0 2.9000 0 0
    0 -4.6000 4.9000 -3.0000 0 2.1000 0
    -3.5000 -4.5000 0 -2.5000 0 0 -2.6000
    -4.1000 0 5.4000 0 3.6000 2.6000 3.2000



    first row should be -ve 2nd row is +ve and so on In verilog

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick C@21:1/5 to nitin sapre on Thu Jan 23 20:41:59 2020
    On Thursday, January 23, 2020 at 11:15:17 PM UTC-5, nitin sapre wrote:
    i have a matrix



    i need to get sign of each rows



    L =

    3.4000 -4.4000 4.7000 0 2.9000 0 0
    0 -4.6000 4.9000 -3.0000 0 2.1000 0
    -3.5000 -4.5000 0 -2.5000 0 0 -2.6000
    -4.1000 0 5.4000 0 3.6000 2.6000 3.2000



    first row should be -ve 2nd row is +ve and so on In verilog

    What is the algorithm you intend to use to find the sign of each row in the matrix?

    How much Verilog do you know?

    --

    Rick C.

    - Get 1,000 miles of free Supercharging
    - Tesla referral code - https://ts.la/richard11209

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nitin sapre@21:1/5 to Rick C on Sat Jan 25 09:15:54 2020
    On Friday, January 24, 2020 at 10:12:02 AM UTC+5:30, Rick C wrote:
    On Thursday, January 23, 2020 at 11:15:17 PM UTC-5, nitin sapre wrote:
    i have a matrix



    i need to get sign of each rows



    L =

    3.4000 -4.4000 4.7000 0 2.9000 0 0
    0 -4.6000 4.9000 -3.0000 0 2.1000 0
    -3.5000 -4.5000 0 -2.5000 0 0 -2.6000
    -4.1000 0 5.4000 0 3.6000 2.6000 3.2000



    first row should be -ve 2nd row is +ve and so on In verilog

    What is the algorithm you intend to use to find the sign of each row in the matrix?

    How much Verilog do you know?

    --

    Rick C.

    - Get 1,000 miles of free Supercharging
    - Tesla referral code - https://ts.la/richard11209

    module sign(L);


    parameter BIT_WIDTH=8;
    parameter L_MATRIX= 224;
    parameter L_ROW=4,L_COL=7;
    parameter MEM_WIDTH=28;
    parameter M_ROW=4,M_COL=7;

    input [L_MATRIX-1:0] L;//for H matrix
    // output reg [MEM_WIDTH:0] Res;//storage


    reg [BIT_WIDTH-1:0] L1 [0:L_ROW-1][0:L_COL];// H matrix elements
    reg RES1 [0:M_ROW-1][0:M_COL-1];//storage matrix memory
    reg [0:3]S;
    integer i,j;
    always@ (*)
    begin
    //Initialize the matrices-convert 1 D to 3D arrays

    {L1[0][0],L1[0][1],L1[0][2],L1[0][3],L1[0][4],L1[0][5],L1[0][6],
    L1[1][0],L1[1][1],L1[1][2],L1[1][3],L1[1][4],L1[1][5],L1[1][6],
    L1[2][0],L1[2][1],L1[2][2],L1[2][3],L1[2][4],L1[2][5],L1[2][6],
    L1[3][0],L1[3][1],L1[3][2],L1[3][3],L1[3][4],L1[3][5],L1[3][6]} = L;
    i = 0;
    j = 0;


    for(i=0;i <= 3;i=i+1)
    for(j=0;j<=6;j=j+1)
    begin
    RES1[i][j] = L1[i][j][7];


    end



    frm this code i got the MSB of each element of a row..

    i just need to xor all elements of a row to get my ans

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)