+ Post New Thread
Results 1 to 11 of 11

12th May 2019, 17:02 #1
 Join Date
 Jun 2015
 Posts
 75
 Helped
 0 / 0
 Points
 1,095
 Level
 7
VHDL modulo 2^64 addition
I'm working on SHA512 VHDL implementation and i need to perform (addition mod 2^64)
How can i make the following addition as (modulo 2^64 addition)
Code:a(i) <= std_logic_vector(unsigned(h(i1)) +unsigned(f3(i)) + unsigned(f0(i)) +unsigned(k(i)) + unsigned(w(i)) + unsigned(f2(i)) + unsigned(f1(i)));

12th May 2019, 18:40 #2
 Join Date
 Feb 2015
 Posts
 979
 Helped
 280 / 280
 Points
 5,972
 Level
 18
Re: VHDL modulo 2^64 addition
make a(i) 64 bits.
1 members found this post helpful.

Advertisment

12th May 2019, 19:41 #3
 Join Date
 Jun 2015
 Posts
 75
 Helped
 0 / 0
 Points
 1,095
 Level
 7

12th May 2019, 20:05 #4
 Join Date
 Aug 2016
 Posts
 369
 Helped
 55 / 55
 Points
 2,170
 Level
 10
Re: VHDL modulo 2^64 addition
Hi,
I noticed that you used this: std_logic_vector(unsigned(h(i1))
Why not try this: std_logic_vector(unsigned(h(i)1)
I don't quite understand what you're doing though but if you show your code, then I can follow.
Akanimo.
1 members found this post helpful.

12th May 2019, 22:03 #5
Awards:
 Join Date
 Apr 2014
 Posts
 14,978
 Helped
 3412 / 3412
 Points
 73,838
 Level
 66
Re: VHDL modulo 2^64 addition
Hi,
Signed or unsigned values?
KlausPlease don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.

Advertisment

13th May 2019, 05:17 #6
 Join Date
 Feb 2015
 Posts
 979
 Helped
 280 / 280
 Points
 5,972
 Level
 18

13th May 2019, 16:58 #7

13th May 2019, 18:39 #8
Awards:
 Join Date
 Apr 2014
 Posts
 14,978
 Helped
 3412 / 3412
 Points
 73,838
 Level
 66
Re: VHDL modulo 2^64 addition
Hi,
Since every quantity in the equation is specified as unsigned, then surely it's unsigned ?
KlausPlease don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.

Advertisment

13th May 2019, 21:23 #9
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 44,445
 Helped
 13540 / 13540
 Points
 255,078
 Level
 100
Re: VHDL modulo 2^64 addition
Also, I did not understand the symbol " <= ". Is this a qualifier equation or is it an inequality ??
1 members found this post helpful.

14th May 2019, 12:42 #10
 Join Date
 Jun 2015
 Posts
 75
 Helped
 0 / 0
 Points
 1,095
 Level
 7

14th May 2019, 17:08 #11
 Join Date
 Feb 2015
 Posts
 979
 Helped
 280 / 280
 Points
 5,972
 Level
 18
Re: VHDL modulo 2^64 addition
The code shown looks correct for this problem. My guess is that one or more of the terms is incorrect.
For any encryption core, you really need to get detailed test vectors. Not just input and final output, but all intermediate terms for every iteration. when everything looks random by design it is harder to intuitively trace the problem to a source.
+ Post New Thread
Please login