Altera_Forum
Honored Contributor
18 years agoVHDL code for simple calculation: b = 68 - (a/25)
I want to do a simple calculation in FPGA:
b = 68 - (a/25) Anyone help me how can I write VHDL code for this calculation? I try write this code but it fails. Can anybody correct this code? signal a: std_logic_vector(10 downto 0); signal b: std_logic_vector(10 downto 0); process(a) variable tmp1: unsigned(10 downto 0); variable tmp2: unsigned(10 downto 0); begin tmp1 := unsigned(a)/25; tmp2 := 68 - tmp1; b<= std_logic_Vector(tmp2); end process;