humairalis
Newbie level 6
- Joined
- Dec 22, 2009
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- khi
- Activity points
- 1,468
i am working on AES 32 bit
just implementing the vector part for LUT saving
can you please help me out with this
module AES(In, clk, reset, Key, Out);
input [127:0] In;
input clk,reset;
input [127:0] Key;
output reg [127:0] Out;
reg [4:0] i;
initial
begin
if (reset)
begin
for (i=0;i<=3;i=i+1)
AddRoundKey ark(In[i*32+:32], clk, Key[i*32+:32], Out[i*32+:32]);
end
else;
end
endmodule
module AddRoundKey(In, clk, Key, Out, reset);
input [32:0] In;
input clk,reset;
input [32:0] Key;
output reg [32:0] Out;
always@(posedge clk)
begin
if (reset)
begin
Out=32'h0000;
Out = In ^ Key;
end
else;
end
endmodule
i want to instantiate this module 10 times as aes have 10 rounds
pls help !
just implementing the vector part for LUT saving
can you please help me out with this
module AES(In, clk, reset, Key, Out);
input [127:0] In;
input clk,reset;
input [127:0] Key;
output reg [127:0] Out;
reg [4:0] i;
initial
begin
if (reset)
begin
for (i=0;i<=3;i=i+1)
AddRoundKey ark(In[i*32+:32], clk, Key[i*32+:32], Out[i*32+:32]);
end
else;
end
endmodule
module AddRoundKey(In, clk, Key, Out, reset);
input [32:0] In;
input clk,reset;
input [32:0] Key;
output reg [32:0] Out;
always@(posedge clk)
begin
if (reset)
begin
Out=32'h0000;
Out = In ^ Key;
end
else;
end
endmodule
i want to instantiate this module 10 times as aes have 10 rounds
pls help !