Forum Discussion
Altera_Forum
Honored Contributor
14 years agoVHDL comparison
Hi all, I'd like to write a limiter: 1. Input/output are 16 bit signed number 2. If input is -32768 then output is limited by -32767, otherwise the output is just bypass of the input....
Altera_Forum
Honored Contributor
14 years agoTry this:
process(clk)
begin
if rising_edge(clk) then
if (data_in = X"8000") then
data_out <= X"8001";
else
data_out <= data_in;
end if;
end if;
end process;
Cheers, Dave