[myhdl-list] combining values in signals
Brought to you by:
jandecaluwe
From: Edward V. <dev...@sb...> - 2015-03-03 15:58:20
|
Hello All, I am creating a 160 bit signals which works okay when the values are positive. 2130 36 0 0x390e5390e2388e238ce2388e4390df37cdf38ce2L 0x390e538ce5388e238ce0388e4390e3380e1390e2L 0x38ce4394e4388e2388e3388e2390e437cdf37ce2L W0 is set to 10 each value should take 10 bits. lft_s_i.next = (r[row+31][col] << W0*15) + (r[row+29][col] << W0*14) + (r[row+27][col] << W0*13) +(r[row+25][col] << W0*12) + (r[row+23][col] << W0*11) + (r[row+21][col] << W0*10) + (r[row+19][col] << W0*9) + (r[row+17][col] << W0*8) + (r[row+15][col] << W0*7) + (r[row+13][col] << W0*6) + (r[row+11][col] << W0*5) + (r[row+9][col] << W0*4) + (r[row+7][col] << W0*3) + (r[row+5][col] << W0*2) + (r[row+3][col] << W0*1) + (r[row-1][col] ) sa_s_i.next = (r[row+32][col] << W0*15) + (r[row+30][col] << W0*14) + (r[row+28][col] << W0*13) +(r[row+26][col] << W0*12) + (r[row+24][col] << W0*11) + (r[row+22][col] << W0*10) + (r[row+20][col] << W0*9) + (r[row+18][col] << W0*8) + (r[row+16][col] << W0*7) + (r[row+14][col] << W0*6) + (r[row+12][col] << W0*5) + (r[row+10][col] << W0*4) + (r[row+8][col] << W0*3) + (r[row+6][col] << W0*2) + (r[row+4][col] << W0*1) + (r[row][col] ) rht_s_i.next = (r[row+33][col] << W0*15) + (r[row+31][col] << W0*14) + (r[row+29][col] << W0*13) +(r[row+27][col] << W0*12) + (r[row+25][col] << W0*11) + (r[row+23][col] << W0*10) + (r[row+21][col] << W0*9) + (r[row+19][col] << W0*8) + (r[row+17][col] << W0*7) + (r[row+15][col] << W0*6) + (r[row+13][col] << W0*5) + (r[row+11][col] << W0*4) + (r[row+9][col] << W0*3) + (r[row+7][col] << W0*2) + (r[row+5][col] << W0*1) + (r[row+1][col] ) When the values are negative now() r[row+31][col] 14592190 -2 now() (r[row+31][col] << W0*15) 14592190 -2854495385411919762116571938898990272765493248 ValueError: intbv value -2857285703481726135295571520461941387401627422 < minimum 0 I tried changing the + to & with the results 0x0L lft_s_i.next = (r[row+31][col] << W0*15) & (r[row+29][col] << W0*14) & (r[row+27][col] << W0*13) & (r[row+25][col] << W0*12) & (r[row+23][col] << W0*11) & (r[row+21][col] << W0*10) & (r[row+19][col] << W0*9) & (r[row+17][col] << W0*8) & (r[row+15][col] << W0*7) & (r[row+13][col] << W0*6) & (r[row+11][col] << W0*5) & (r[row+9][col] << W0*4) & (r[row+7][col] << W0*3) & (r[row+5][col] << W0*2) & (r[row+3][col] << W0*1) & (r[row-1][col] ) sa_s_i.next = (r[row+32][col] << W0*15) & (r[row+30][col] << W0*14) & (r[row+28][col] << W0*13) & (r[row+26][col] << W0*12) & (r[row+24][col] << W0*11) & (r[row+22][col] << W0*10) & (r[row+20][col] << W0*9) & (r[row+18][col] << W0*8) & (r[row+16][col] << W0*7) & (r[row+14][col] << W0*6) & (r[row+12][col] << W0*5) & (r[row+10][col] << W0*4) & (r[row+8][col] << W0*3) & (r[row+6][col] << W0*2) & (r[row+4][col] << W0*1) & (r[row][col] ) rht_s_i.next = (r[row+33][col] << W0*15) & (r[row+31][col] << W0*14) & (r[row+29][col] << W0*13) & (r[row+27][col] << W0*12) & (r[row+25][col] << W0*11) & (r[row+23][col] << W0*10) & (r[row+21][col] << W0*9) & (r[row+19][col] << W0*8) & (r[row+17][col] << W0*7) & (r[row+15][col] << W0*6) & (r[row+13][col] << W0*5) & (r[row+11][col] << W0*4) & (r[row+9][col] << W0*3) & (r[row+7][col] << W0*2) & (r[row+5][col] << W0*1) & (r[row+1][col] ) Now when the values are positive I get 0x0L What is the procedure to combine signals. This is in a test bench right now. Thanks Edward Vidal Jr. e-mail dev...@sb... 915-595-1613 |