amitjagtap
Full Member level 5
hi all,
Which is more efficient way to write HDL code.
Bellow...which one is good...and why?
1st way----------
If Din=0 then ab<="00" else
If Din=1 then ab<="01" else
If Din=2 then ab<="10" else
If Din=3 then ab<="11" end if;
2nd Way------------
If Din=0 or Din=1 then a<=0 else
If Din=2 or Din=3 then a<=1 end if;
If Din=0 or Din=2 then b<=0 else
If Din=1 or Din=3 then b<=1 end if;
:lol:
Which is more efficient way to write HDL code.
Bellow...which one is good...and why?
1st way----------
If Din=0 then ab<="00" else
If Din=1 then ab<="01" else
If Din=2 then ab<="10" else
If Din=3 then ab<="11" end if;
2nd Way------------
If Din=0 or Din=1 then a<=0 else
If Din=2 or Din=3 then a<=1 end if;
If Din=0 or Din=2 then b<=0 else
If Din=1 or Din=3 then b<=1 end if;
:lol: