PoC.arith.div
Implementation of a Non-Performing restoring divider with a configurable radix. The multi-cycle division is controlled by ‘start’ / ‘rdy’. A new division is started by asserting ‘start’. The result Q = A/D is available when ‘rdy’ returns to ‘1’. A division by zero is identified by output Z. The Q and R outputs are undefined in this case.
Entity Declaration:
1entity arith_div is
2 generic (
3 A_BITS : positive; -- Dividend Width
4 D_BITS : positive; -- Divisor Width
5 RAPOW : positive := 1; -- Power of Compute Radix (2**RAPOW)
6 PIPELINED : boolean := false -- Computation Pipeline
7 );
8 port (
9 -- Global Reset/Clock
10 clk : in std_logic;
11 rst : in std_logic;
12
13 -- Ready / Start
14 start : in std_logic;
15 ready : out std_logic;
16
17 -- Arguments / Result (2's complement)
18 A : in std_logic_vector(A_BITS-1 downto 0); -- Dividend
19 D : in std_logic_vector(D_BITS-1 downto 0); -- Divisor
20 Q : out std_logic_vector(A_BITS-1 downto 0); -- Quotient
21 R : out std_logic_vector(D_BITS-1 downto 0); -- Remainder
22 Z : out std_logic -- Division by Zero
23 );
24end entity arith_div;