Simple ALU Implementation

Discussion in 'VHDL' started by andrew_ross, Nov 13, 2008.

  1. andrew_ross

    andrew_ross

    Joined:
    Nov 6, 2008
    Messages:
    6
    Hi guys,
    I have to implement a simple ALU of a 32bit mips..I have already implemented many submodules (adder,multipliers,shifter...) ,that I have to instantiate in the top level module "ALU_TOP". This module receives as input 2 op. (a , b) and a 6bit signal OPCODE on which basis the differents modules are instantiates.

    My problem is checking the signal OPCODE directly in the architecture (not in a process , and after begin of arch.). I used that solution because using a process returned me errors reusing the components (and portamaps...)
    But now I cannot even check the OPCODE ("If not allowed..")..(I double checked parenthesis or typos..)...

    what should I do? Do I have to use a process? But how to use different modules within a process?

    I paste the simple part of the code .. and this not work..
    Code:
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.STD_LOGIC_ARITH.ALL;
    use IEEE.STD_LOGIC_UNSIGNED.ALL;
    
    entity alu_top is
    	
    generic (N:integer:=32);
    		
        Port ( A : in  STD_LOGIC_VECTOR(N-1 downto 0);
               B : in  STD_LOGIC_VECTOR(N-1 downto 0);
               OPCODE : in  STD_LOGIC_VECTOR(5 downto 0);
               FUNCT : in  STD_LOGIC_VECTOR(5 downto 0);
               COND : out  STD_LOGIC;
               ALUOut : out  STD_LOGIC_VECTOR(N-1 downto 0)
    			  );
    end alu_top;
    
    architecture Behavioral of alu_top is
    
    component multiplier_s_u is
    
    	 generic(N:integer:=16);
    
        Port ( A : in  STD_LOGIC_VECTOR(N-1 downto 0);
               B : in  STD_LOGIC_VECTOR(N-1 downto 0);
               SIGN : in  STD_LOGIC;--signed/unsigned selector
               M : out  STD_LOGIC_VECTOR((2*N)-1 downto 0));--output da 32 bit
    end component multiplier_s_u;
    
    
    begin
    
    
    if OPCODE="000000"  then
    cond<='0';
    		
    end if;
    
    end Behavioral;
    ERROR:HDLParsers:164 - "F:/Poli/SDSS/MyProjects/MIPS/alu_top.vhd" Line 50. parse error, unexpected IF

    Thanks in advance
    andrew_ross, Nov 13, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manuel

    alu implementation

    Manuel, Feb 3, 2004, in forum: VHDL
    Replies:
    3
    Views:
    5,193
    Manuelll
    Feb 6, 2004
  2. Lily

    need help with ALU 8 BIT

    Lily, Apr 6, 2004, in forum: VHDL
    Replies:
    0
    Views:
    979
  3. Lily
    Replies:
    16
    Views:
    1,324
    Bob Jenkins
    May 10, 2004
  4. coldplay112
    Replies:
    12
    Views:
    33,014
    etokcan
    Apr 16, 2009
  5. andrezz

    Simple ALU Implementation

    andrezz, Nov 13, 2008, in forum: VHDL
    Replies:
    3
    Views:
    2,586
    andrew_ross
    Nov 14, 2008
Loading...

Share This Page