OpenCores
URL https://opencores.org/ocsvn/fpuvhdl/fpuvhdl/trunk

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [adder/] [fpalign_struct.vhd] - Diff between revs 3 and 5

Only display areas with differences | Details | Blame | View Log

Rev 3 Rev 5
-- VHDL Entity HAVOC.FPalign.symbol
-- VHDL Entity HAVOC.FPalign.symbol
--
--
-- Created by
-- Created by
-- Guillermo Marcus, gmarcus@ieee.org
-- Guillermo Marcus, gmarcus@ieee.org
-- using Mentor Graphics FPGA Advantage tools.
-- using Mentor Graphics FPGA Advantage tools.
--
--
-- Visit "http://fpga.mty.itesm.mx" for more info.
-- Visit "http://fpga.mty.itesm.mx" for more info.
--
--
-- 2003-2004. V1.0
-- 2003-2004. V1.0
--
--
 
 
LIBRARY ieee;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
USE ieee.std_logic_arith.all;
 
 
ENTITY FPalign IS
ENTITY FPalign IS
   PORT(
   PORT(
      A_in  : IN     std_logic_vector (28 DOWNTO 0);
      A_in  : IN     std_logic_vector (28 DOWNTO 0);
      B_in  : IN     std_logic_vector (28 DOWNTO 0);
      B_in  : IN     std_logic_vector (28 DOWNTO 0);
      cin   : IN     std_logic;
      cin   : IN     std_logic;
      diff  : IN     std_logic_vector (8 DOWNTO 0);
      diff  : IN     std_logic_vector (8 DOWNTO 0);
      A_out : OUT    std_logic_vector (28 DOWNTO 0);
      A_out : OUT    std_logic_vector (28 DOWNTO 0);
      B_out : OUT    std_logic_vector (28 DOWNTO 0)
      B_out : OUT    std_logic_vector (28 DOWNTO 0)
   );
   );
 
 
-- Declarations
-- Declarations
 
 
END FPalign ;
END FPalign ;
 
 
--
--
-- VHDL Architecture HAVOC.FPalign.struct
-- VHDL Architecture HAVOC.FPalign.struct
--
--
-- Created by
-- Created by
-- Guillermo Marcus, gmarcus@ieee.org
-- Guillermo Marcus, gmarcus@ieee.org
-- using Mentor Graphics FPGA Advantage tools.
-- using Mentor Graphics FPGA Advantage tools.
--
--
-- Visit "http://fpga.mty.itesm.mx" for more info.
-- Visit "http://fpga.mty.itesm.mx" for more info.
--
--
-- Copyright 2003-2004. V1.0
-- Copyright 2003-2004. V1.0
--
--
 
 
 
 
LIBRARY ieee;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
USE ieee.std_logic_arith.all;
USE ieee.std_logic_unsigned.all;
USE ieee.std_logic_unsigned.all;
 
 
 
 
ARCHITECTURE struct OF FPalign IS
ARCHITECTURE struct OF FPalign IS
 
 
   -- Architecture declarations
   -- Architecture declarations
 
 
   -- Internal signal declarations
   -- Internal signal declarations
   SIGNAL B_shift  : std_logic_vector(28 DOWNTO 0);
   SIGNAL B_shift  : std_logic_vector(28 DOWNTO 0);
   SIGNAL diff_int : std_logic_vector(8 DOWNTO 0);
   SIGNAL diff_int : std_logic_vector(8 DOWNTO 0);
   SIGNAL shift_B  : std_logic_vector(5 DOWNTO 0);
   SIGNAL shift_B  : std_logic_vector(5 DOWNTO 0);
 
 
 
 
 
 
BEGIN
BEGIN
   -- Architecture concurrent statements
   -- Architecture concurrent statements
   -- HDL Embedded Text Block 1 eb1
   -- HDL Embedded Text Block 1 eb1
   -- eb1 1
   -- eb1 1
   PROCESS(diff_int, B_shift)
   PROCESS(diff_int, B_shift)
   BEGIN
   BEGIN
      IF (diff_int(8)='1') THEN
      IF (diff_int(8)='1') THEN
         IF (((NOT diff_int) + 1) > 28) THEN
         IF (((NOT diff_int) + 1) > 28) THEN
             B_out <= (OTHERS => '0');
             B_out <= (OTHERS => '0');
          ELSE
          ELSE
              B_out <= B_shift;
              B_out <= B_shift;
          END IF;
          END IF;
      ELSE
      ELSE
          IF (diff_int > 28) THEN
          IF (diff_int > 28) THEN
             B_out <= (OTHERS => '0');
             B_out <= (OTHERS => '0');
          ELSE
          ELSE
              B_out <= B_shift;
              B_out <= B_shift;
          END IF;
          END IF;
       END IF;
       END IF;
   END PROCESS;
   END PROCESS;
 
 
   -- HDL Embedded Text Block 2 eb2
   -- HDL Embedded Text Block 2 eb2
   -- eb2 2   
   -- eb2 2   
   PROCESS(diff_int)
   PROCESS(diff_int)
   BEGIN
   BEGIN
      IF (diff_int(8)='1') THEN
      IF (diff_int(8)='1') THEN
            shift_B <= (NOT diff_int(5 DOWNTO 0)) + 1;
            shift_B <= (NOT diff_int(5 DOWNTO 0)) + 1;
      ELSE
      ELSE
            shift_B <= diff_int(5 DOWNTO 0) ;
            shift_B <= diff_int(5 DOWNTO 0) ;
      END IF;
      END IF;
   END PROCESS;
   END PROCESS;
 
 
   -- HDL Embedded Text Block 3 eb3
   -- HDL Embedded Text Block 3 eb3
   -- eb3 3
   -- eb3 3
   PROCESS(cin,diff)
   PROCESS(cin,diff)
   BEGIN
   BEGIN
      IF ((cin='1') AND (diff(8)='1')) THEN
      IF ((cin='1') AND (diff(8)='1')) THEN
         diff_int <= diff + 2;
         diff_int <= diff + 2;
      ELSE
      ELSE
         diff_int <= diff;
         diff_int <= diff;
      END IF;
      END IF;
   END PROCESS;
   END PROCESS;
 
 
 
 
   -- ModuleWare code(v1.1) for instance 'I0' of 'assignment'
   -- ModuleWare code(v1.1) for instance 'I0' of 'assignment'
   A_out <= A_in;
   A_out <= A_in;
 
 
   -- ModuleWare code(v1.1) for instance 'I1' of 'rshift'
   -- ModuleWare code(v1.1) for instance 'I1' of 'rshift'
   I1combo : PROCESS (B_in, shift_B)
   I1combo : PROCESS (B_in, shift_B)
   VARIABLE stemp : std_logic_vector (5 DOWNTO 0);
   VARIABLE stemp : std_logic_vector (5 DOWNTO 0);
   VARIABLE dtemp : std_logic_vector (28 DOWNTO 0);
   VARIABLE dtemp : std_logic_vector (28 DOWNTO 0);
   VARIABLE temp : std_logic_vector (28 DOWNTO 0);
   VARIABLE temp : std_logic_vector (28 DOWNTO 0);
   BEGIN
   BEGIN
      temp := (OTHERS=> 'X');
      temp := (OTHERS=> 'X');
      stemp := shift_B;
      stemp := shift_B;
      temp := B_in;
      temp := B_in;
      FOR i IN 5 DOWNTO 0 LOOP
      FOR i IN 5 DOWNTO 0 LOOP
         IF (i < 5) THEN
         IF (i < 5) THEN
            IF (stemp(i) = '1' OR stemp(i) = 'H') THEN
            IF (stemp(i) = '1' OR stemp(i) = 'H') THEN
               dtemp := (OTHERS => '0');
               dtemp := (OTHERS => '0');
               dtemp(28 - 2**i DOWNTO 0) := temp(28 DOWNTO 2**i);
               dtemp(28 - 2**i DOWNTO 0) := temp(28 DOWNTO 2**i);
            ELSIF (stemp(i) = '0' OR stemp(i) = 'L') THEN
            ELSIF (stemp(i) = '0' OR stemp(i) = 'L') THEN
               dtemp := temp;
               dtemp := temp;
            ELSE
            ELSE
               dtemp := (OTHERS => 'X');
               dtemp := (OTHERS => 'X');
            END IF;
            END IF;
         ELSE
         ELSE
            IF (stemp(i) = '1' OR stemp(i) = 'H') THEN
            IF (stemp(i) = '1' OR stemp(i) = 'H') THEN
               dtemp := (OTHERS => '0');
               dtemp := (OTHERS => '0');
            ELSIF (stemp(i) = '0' OR stemp(i) = 'L') THEN
            ELSIF (stemp(i) = '0' OR stemp(i) = 'L') THEN
               dtemp := temp;
               dtemp := temp;
            ELSE
            ELSE
               dtemp := (OTHERS => 'X');
               dtemp := (OTHERS => 'X');
            END IF;
            END IF;
         END IF;
         END IF;
         temp := dtemp;
         temp := dtemp;
      END LOOP;
      END LOOP;
      B_shift <= dtemp;
      B_shift <= dtemp;
   END PROCESS I1combo;
   END PROCESS I1combo;
 
 
   -- Instance port mappings.
   -- Instance port mappings.
 
 
END struct;
END struct;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.