quartus fuer windows:
[hwmod.git] / src / calc.vhd
index c17199c00fef0f085f43628b8cf4260ee7c0813a..7347002dcd823619e8d00e7ef18358d3f9a41645 100644 (file)
@@ -44,14 +44,20 @@ begin
                opcode => opcode
        );
 
-       process
+       process (sys_clk, sys_res_n)
        begin
-               op1 <= op3;
-               opcode <= DIV;
-               op2 <= to_signed(2,CBITS);
+               if sys_res_n = '0' then
+                       op1 <= (others => '0');
+                       opcode <= NOP;
+                       op2 <= (others => '0');
+                       do_calc <= '0';
+               elsif rising_edge(sys_clk) then
+                       op1 <= op3;
+                       opcode <= DIV;
+                       op2 <= to_signed(2,CBITS);
 
-               do_calc <= calc_done;
-               wait until sys_clk = '1';
+                       do_calc <= calc_done;
+               end if;
        end process;
 end architecture top;