V
Ved
Hi all,
I am learning perl and could have done this by myself by taking a few
days. But its needed early.
I have a file which has major chunk contaning samething like show
below:
if ( dat0s0 > dat1s0) then
dat0s1 <= dat0s0 ;
dat1s1 <= dat1s0 ;
else
dat0s1 <= dat1s0 ;
dat1s1 <= dat0s0 ;
end if;
if ( dat2s0 > dat3s0) then
dat2s1 <= dat2s0 ;
dat3s1 <= dat3s0 ;
else
dat2s1 <= dat3s0;
dat3s1 <= dat2s0 ;
end if;
----
if ( dat4s0 > dat5s0) then
dat4s1 <= dat4s0 ;
dat5s1 <= dat5s0 ;
else
dat4s1 <= dat5s0;
dat5s1 <= dat4s0 ;
end if;
..........
..............
.......... and so on ........
I have to replace only the lines
if ( dat0s0 > dat1s0) then
with
if ( abs(dat0s0) > abs(dat1s0)) then
Rest of the code has to be as it is.
Please help
Thanks
Ved
I am learning perl and could have done this by myself by taking a few
days. But its needed early.
I have a file which has major chunk contaning samething like show
below:
if ( dat0s0 > dat1s0) then
dat0s1 <= dat0s0 ;
dat1s1 <= dat1s0 ;
else
dat0s1 <= dat1s0 ;
dat1s1 <= dat0s0 ;
end if;
if ( dat2s0 > dat3s0) then
dat2s1 <= dat2s0 ;
dat3s1 <= dat3s0 ;
else
dat2s1 <= dat3s0;
dat3s1 <= dat2s0 ;
end if;
----
if ( dat4s0 > dat5s0) then
dat4s1 <= dat4s0 ;
dat5s1 <= dat5s0 ;
else
dat4s1 <= dat5s0;
dat5s1 <= dat4s0 ;
end if;
..........
..............
.......... and so on ........
I have to replace only the lines
if ( dat0s0 > dat1s0) then
with
if ( abs(dat0s0) > abs(dat1s0)) then
Rest of the code has to be as it is.
Please help
Thanks
Ved