OpenCores
URL https://opencores.org/ocsvn/aes-128_pipelined_encryption/aes-128_pipelined_encryption/trunk

Subversion Repositories aes-128_pipelined_encryption

[/] [aes-128_pipelined_encryption/] [trunk/] [rtl/] [SubBytes.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 Amr_Salah
/*
2
Project        : AES
3
Standard doc.  : FIPS 197
4
Module name    : SubBytes block
5
Dependancy     :
6
Design doc.    :
7
References     :
8
Description    : uses SBox module to substitute every bytein the 128bit data
9
Owner          : Amr Salah
10
*/
11
 
12
`timescale 1 ns/1 ps
13
 
14
module SubBytes
15
#
16
(
17
 parameter DATA_W = 128,       //data width
18
 parameter NO_BYTES = DATA_W >> 3  //no of bytes = data width / 8
19
)
20
(
21
input clk,                     //system clock
22
input reset,                   //asynch active low reset
23
input valid_in,                //input valid signal  
24
input [DATA_W-1:0] data_in,    //input data
25
output reg valid_out,          //output valid signal
26
output [DATA_W-1:0] data_out   //output data
27
)
28
;
29
 
30
genvar i;
31
generate                      //generating sbox roms 
32
for (i=0; i< NO_BYTES ; i=i+1) begin : ROM
33
  SBox ROM(clk,reset,valid_in,data_in[(i*8)+7:(i*8)],data_out[(i*8)+7:(i*8)]);
34
end
35
endgenerate
36
 
37
always@(posedge clk or negedge reset)   //valid out register
38
if(!reset)begin
39
    valid_out <= 1'b0;
40
end else begin
41
    valid_out <= valid_in;
42
  end
43
endmodule
44
 
45
 
46
 
47
 

powered by: WebSVN 2.1.0

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