UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer farhathsuj
Observer
112 Views
Registered: ‎12-06-2018

vhdl coding

Jump to solution

What is the meaning VHDL code line is ,Signal temp: std_LOGIC_VECTOR (31 downto 0) := (others => '0'); as iam new to VHDL programming…

0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor
101 Views
Registered: ‎04-06-2018

Re: vhdl coding

Jump to solution

you are just initializing the signal with 0 , zeros.

others=>'0' , say all vetor is filled with zeros.

2 Replies
Contributor
Contributor
102 Views
Registered: ‎04-06-2018

Re: vhdl coding

Jump to solution

you are just initializing the signal with 0 , zeros.

others=>'0' , say all vetor is filled with zeros.

Observer farhathsuj
Observer
62 Views
Registered: ‎12-06-2018

Re: vhdl coding

Jump to solution

tq or the reply,

function quantization_sgn(nbit : integer; max_abs : real; dval : real) return std_logic_vector is
variable temp : std_logic_vector(nbit-1 downto 0):=(others=>'0');
constant scale : real :=(2.0**(real(nbit-1)))/max_abs;
constant minq : integer := -(2**(nbit-1));
constant maxq : integer := +(2**(nbit-1))-1;
variable itemp : integer := 0;
begin
if(nbit>0) then
if (dval>=0.0) then
itemp := +(integer(+dval*scale+0.49));
else
itemp := -(integer(-dval*scale+0.49));
end if;
if(itemp<minq) then itemp := minq; end if;
if(itemp>maxq) then itemp := maxq; end if;
end if;
temp := std_logic_vector(to_signed(itemp,nbit));
return temp;

why 0.49 is used here..in this code ???
end quantization_sgn;

0 Kudos