Реферат: Устройство преобразования цифровой информации с ее шифрованием
variable res2,tt1: integer;
begin
function toreal (X
:STD_LOGIC_VECTOR(31 downto 0))
return real is
variable result,res1,myn: real;
variable res2: integer;
begin
res1:= real(CONV_INTEGER(X(20 downto 1)));
M1: while res1 >=1.0 loop res1:= res1/10.0;
end loop M1;
if X(0)= '1' then res1:=-res1;
end if;
res2:= CONV_INTEGER(X(31 downto 22));
if X(20)= '1' then res2:=-res2;
end if;
myn := 2.0**res2;
result:= mut(res1,myn) ;
return result;
end toreal;
function fakt (n :real) return real is variable rr : real;
variable result: real;
begin
if n =1.0 then result :=n;
elsif n = 0.0 then result :=0.0;
elsif n < 0.0 then
result := 0.0;
else
rr :=n -1.0;