-- ############################################################################ -- # Project : Leonardo CBT-Kernel # -- # # -- # Filename : increments_decrements.vhd # -- # # -- # Component : incN : N-bit incrementer # -- # # -- # Model : rtl # -- # # -- # Designer : S. Theoharis,N. Zervas # -- # Institute : VLSI Design Lab., University of Patras # -- # Date : 01.05.1999 # -- ############################################################################ library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use work.useful_functions.all; -- incN Entity Description entity incN is generic(N: INTEGER := 4); port( A: in unsigned(N-1 downto 0); D: out unsigned(N-1 downto 0); UP: in std_ulogic; COUT,ZERO: out std_ulogic ); end incN; -- incN Architecture Description architecture rtl of incN is signal extended : unsigned(N downto 0); begin INCREMENTER_Process: process(A,UP) begin if (UP = '1') then extended <= ('0' & A) + "01"; else extended <= ('0' & A); end if; end process INCREMENTER_Process; -- Assign output values D <= extended(N-1 downto 0); COUT <= extended(N); ZERO <= '1' when vector_eq_zero(extended(N-1 downto 0)) else '0'; end rtl;