gnrbyrm
Newbie level 5
- Joined
- Nov 12, 2012
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,366
Hello everybody , i am doing a shift register project that operates "n x m" bit . Here "m" is bitwith, "n" is number of "m's". I handled my projeck by sampling register using Flipflops and achieved it. Register section works well. Now i have to multiply register "n" times . here i have some difficulties and i have two subtle erros . What could be solution. thnks for replies
here they are:
1. Near Din_in_unit type conversion doesnt match type std_logic_vector
2. Actual of formal output DOUT_reg cannot be expression
here is the code
here they are:
1. Near Din_in_unit type conversion doesnt match type std_logic_vector
2. Actual of formal output DOUT_reg cannot be expression
here is the code
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity nxmBitShiftReg is generic (n : integer:=4; m : integer:=8 ); Port ( CLK : in STD_LOGIC; CE : in STD_LOGIC; SR : in STD_LOGIC; OPMODE : in STD_LOGIC_VECTOR (1 downto 0); SRINIT : out STD_LOGIC_VECTOR ( m*n-1 downto 0); DIN : in STD_LOGIC_VECTOR (m-1 downto 0); DOUT_mreg : out STD_LOGIC_VECTOR (m-1 downto 0); -- output of multiplied registers DOUT_f : out STD_LOGIC_VECTOR (m*n-1 downto 0) ); end nxmBitShiftReg; architecture Behavioral of nxmBitShiftReg is type DIN_in_unit is array ( n-1 downto 0 ) of STD_LOGIC_VECTOR ( m-1 downto 0 ) ; type DOUT_out_unit is array ( n-1 downto 0 ) of STD_LOGIC_VECTOR ( m-1 downto 0 ) ; signal i : integer; component m_bit_register Port ( CLK : in STD_LOGIC; SR : in STD_LOGIC; DIN_reg : in STD_LOGIC_VECTOR (m-1 downto 0); DOUT_reg : out STD_LOGIC_VECTOR (m-1 downto 0) ); end component; begin multiple_registers : for i in 0 to n-1 generate --register instantiation n times begin --"begin" statement for "generate" Registr : m_bit_register PORT MAP ( CLK => CLK ,SR=>SR , DIN_reg=>DIN_in_unit(i), DOUT_reg =>DOUT_out_unit(i) ); end generate multiple_registers; end Behavioral;
Last edited by a moderator: