EDAboard.com | EDAboard.de | EDAboard.co.uk | WTWH Media

how to get the sign of each row in matrix

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Verilog Language - how to get the sign of each row in matrix

nitin sapre
Guest

Fri Jan 24, 2020 5:45 am   



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

Rick C
Guest

Fri Jan 24, 2020 5:45 am   



On Thursday, January 23, 2020 at 11:15:17 PM UTC-5, nitin sapre wrote:
Quote:
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

nitin sapre
Guest

Sat Jan 25, 2020 6:45 pm   



On Friday, January 24, 2020 at 10:12:02 AM UTC+5:30, Rick C wrote:
Quote:
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

elektroda.net NewsGroups Forum Index - Verilog Language - how to get the sign of each row in matrix

Ask a question - edaboard.com

Arabic version Bulgarian version Catalan version Czech version Danish version German version Greek version English version Spanish version Finnish version French version Hindi version Croatian version Indonesian version Italian version Hebrew version Japanese version Korean version Lithuanian version Latvian version Dutch version Norwegian version Polish version Portuguese version Romanian version Russian version Slovak version Slovenian version Serbian version Swedish version Tagalog version Ukrainian version Vietnamese version Chinese version Turkish version
EDAboard.com map