Altera_Forum
Honored Contributor
8 years agobbs prng simulation done, but no result waveform
currently i am using Cyclone II family libraries to implement a bbs prng
i have insert a coding that i copy from internet, but i quite confuse on understanding the coding the coding i'm using to make modification: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity bbs is Port ( p : in integer; q : in integer; s : in integer; b : out STD_LOGIC_VECTOR(7 downto 0) ); end bbs; architecture Behavioral of bbs is begin process(p,q,s) variable x0,x1,s1,x_0:integer; constant p:integer:=11; constant q:integer:=19; constant n:integer:=551; variable b1:integer ; variable b2:std_logic; variable r:std_logic_vector(7 downto 0); begin s1:=s*s; x0:=s1 mod 1024; for i in 0 to 7 loop x_0:=x0*x0; x1:=x_0 mod 1024; b1:=x1 mod 2; if b1=1 then b2:='1'; else b2:='0'; end if; r(6):=r(7); r(5):=r(6); r(4):=r(5); r(3):=r(4); r(2):=r(3); r(1):=r(2); r(0):=r(1); r(7):=b2;--so it will be serially transmitted but parallelly observed x0:=x1; b<=r; end loop; end process; end Behavioral; please if there is someone can help me on explaining the coding?