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

Subversion Repositories aes_decry_ip_128bit

[/] [aes_decry_ip_128bit/] [trunk/] [rtl/] [gf_mul.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 ghegde
--************************************************************
2
--Copyright 2015, Ganesh Hegde < ghegde@opencores.org >      
3
--                                                           
4
--This source file may be used and distributed without  
5
--restriction provided that this copyright statement is not 
6
--removed from the file and that any derivative work contains
7
--the original copyright notice and the associated disclaimer.
8
--
9
--This source is distributed in the hope that it will be
10
--useful, but WITHOUT ANY WARRANTY; without even the implied
11
--warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
--PURPOSE.  See the GNU Lesser General Public License for more
13
--details.
14
--
15
--You should have received a copy of the GNU Lesser General
16
--Public License along with this source; if not, download it
17
--from http://www.opencores.org/lgpl.shtml
18
--
19
--*************************************************************
20
 
21
--*************************************************************
22
-- Multiply given word with 0x0E,0x09,0x0D and 0x0B
23
-- This module does the job of GF multiplication of a given byte.
24
-- The output is a 32bit word such that MSByte to LSByte are 
25
-- product(GF) of 0x0E,0x09,0x0D and 0x0B with input byte.
26
--
27
--Logic type : Combinational
28
--*************************************************************
29
 
30
library ieee;
31
use ieee.std_logic_1164.all;
32
 
33
entity GF_mul is
34
   port(
35
        in_byte: in std_logic_vector(7 downto 0);
36
                out_word: out std_logic_vector(31 downto 0)--0x0E,0x09,0x0D,0x0B
37
        );
38
end GF_mul;
39
 
40
architecture beh_GF_mul of GF_mul is
41
 
42
    component xE
43
    port (
44
        --clk,reset : in std_logic;
45
        data_in: in std_logic_vector(7 downto 0);
46
        data_out:out std_logic_vector(7 downto 0)
47
    );
48
    end component;
49
 
50
    component x9
51
    port (
52
        --clk,reset : in std_logic;
53
        data_in: in std_logic_vector(7 downto 0);
54
        data_out:out std_logic_vector(7 downto 0)
55
    );
56
    end component;
57
 
58
    component xD
59
    port (
60
        --clk,reset : in std_logic;
61
        data_in: in std_logic_vector(7 downto 0);
62
        data_out:out std_logic_vector(7 downto 0)
63
    );
64
    end component;
65
 
66
    component xB
67
    port (
68
        --clk,reset : in std_logic;
69
        data_in: in std_logic_vector(7 downto 0);
70
        data_out:out std_logic_vector(7 downto 0)
71
    );
72
    end component;
73
 
74
        signal b0,b1,b2,b3:std_logic_vector(7 downto 0);
75
begin
76
   xD_inst:xD
77
   port map(data_in=>in_byte,data_out=>b2);
78
 
79
   xE_inst:xE
80
   port map(data_in=>in_byte,data_out=>b0);
81
 
82
   x9_inst:x9
83
   port map(data_in=>in_byte,data_out=>b1);
84
 
85
   xB_inst:xB
86
   port map(data_in=>in_byte,data_out=>b3);
87
 
88
   out_word <= b0&b1&b2&b3;--0x0E,0x09,0x0D,0x0B
89
 
90
end beh_GF_mul;

powered by: WebSVN 2.1.0

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