ea1aa509f28467649b54a1116e0e639e9b77fe73
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

1) LIBRARY ieee;
2) USE ieee.std_logic_1164.all;
3) USE ieee.numeric_std.all;
4) USE work.mips_types.all;
5) 
6) ENTITY e_mips_div IS
7)     PORT (
8)         rst:      IN  std_logic;
9)         clk:      IN  std_logic;
10)         i_num:    IN  std_logic_vector(31 DOWNTO 0);
11)         i_denom:  IN  std_logic_vector(31 DOWNTO 0);
12)         i_signed: IN  std_logic;
13)         i_start:  IN  std_logic;
14)         o_busy:   OUT std_logic;
15)         o_res:    OUT std_logic_vector(31 DOWNTO 0);
16)         o_rem:    OUT std_logic_vector(31 DOWNTO 0)
17)     );
18) END ENTITY e_mips_div;
19) 
20) ARCHITECTURE a_mips_div OF e_mips_div IS
21) 
22)     SUBTYPE t_state IS natural RANGE 0 TO 33;
23)     SIGNAL n_state: t_state;
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

24)     SIGNAL r_state: t_state := 0;
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

25) 
26)     SIGNAL n_num:   signed(63 DOWNTO 0);
27)     SIGNAL n_denom: signed(63 DOWNTO 0);
28)     SIGNAL n_neg:   boolean;
29)     SIGNAL n_res:   signed(31 DOWNTO 0);
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

30)     SIGNAL r_num:   signed(63 DOWNTO 0) := (OTHERS => '0');
31)     SIGNAL r_denom: signed(63 DOWNTO 0) := (OTHERS => '0');
32)     SIGNAL r_neg:   boolean             := false;
33)     SIGNAL r_res:   signed(31 DOWNTO 0) := (OTHERS => '0');
34)     SIGNAL s_rem:   signed(31 DOWNTO 0) := (OTHERS => '0');