Forum Discussion
Altera_Forum
Honored Contributor
15 years agoDevide in VHLD
I want to implement this function : A<= B/x"A", when I compile, the Quartus put a notice: "/" used but didn't declare. When I try with "*" (multiply) or "+" (add), it is ok. I don't know this er...
Altera_Forum
Honored Contributor
15 years agosomething like this...
-- A_in/B_in = R (& rem remainder) -- R, rem initialised to zero -- A = abs(A_in), B = abs(B_in)
clked process...
rem <= A - B * R;
if rem >= B then
R <= R + 1;
else
result_out <= R; -- also decide sign here
remainder_out <= rem;
done <= '1';
end if;
if B = 0 then
alarm <= '1';
end if;