- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been working on a version of the AES encryption algorithm, but the output waves are not matching up to what they should be i have included screenshot of the wave an the code, any help would be great as i have been stuck on this for a while the three modules byte substitution, row shifting and mixed columns are working correctly the issue seems to be lying with the state machine and key generator module. should i leave the load at one constantly? if i do it gives ten rounds out which is correct. But if i have it as a pulse it gives 40 outputs i am confused the code seems correct but it isn't functioning as so? Any help would be great. I have included a pdf with the code
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ControllingStateMachine: process(CLOCK)
begin
if rising_edge(CLOCK) then
--sets the round value to 11 so it will reset the counter.
if RESET = '1' then
RoundNum <= x"a" & "01";
else
--if it is round eleven then reset the round counter.
if RoundNum = (x"a" & "01") then
if LOAD = '1' then
RoundNum <= "000000";
end if;
--if the round number is not equal 11 then increment the counter
elsif RoundNum /= (x"a" & "01") then
RoundNum <= RoundNum + '1';
end if;
end if;
end if;
end process;
--Good shows when the 10th round has been iterated by the value 1 else it shows a 0.
GOOD <= '1' when RoundNum = x"a" & "00" else '0';
--Complete shows the value 1 after the 10th round is complete
Complete <= '1' when RoundNum = x"a" & "01" else '0';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just looking at your code, you have an if check on LOAD equal to 1 but you don't specify what to do if LOAD equals 0. That's going to create a latch and could be the cause of your issues.
You always want to have a final "else" clause to cover all cases.
#iwork4intel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF i leave load on one will it constantly stay on round one? I want it to stay on one but to then jump from that if statement and continue the round count? i have an endif straight after?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you try sstrell's suggestion?
Thanks.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page