discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] sign_extend.v !!!!


From: Josh Blum
Subject: Re: [Discuss-gnuradio] sign_extend.v !!!!
Date: Sun, 13 Mar 2011 19:52:49 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

http://en.wikipedia.org/wiki/Sign_extension

On 03/13/2011 07:47 PM, Alaa Salaheldin wrote:
> Can anyone please help me to understand what's going on in sign_extend.v ,
> this macro is initiated in the cic_decim.v
> 
> sign_extend #(bw,bw+maxbitgain)
>       ext_input (.in(signal_in),.out(signal_in_ext));
> 
> 
> when i opened the macro i couldn't understand it's function
> 
> // Sign extension "macro"
> // bits_out should be greater than bits_in
> 
> module sign_extend (in,out);
> parameter bits_in=0;  // FIXME Quartus insists on a default
> parameter bits_out=0;
>  input [bits_in-1:0] in;
> output [bits_out-1:0] out;
>  assign out = {{(bits_out-bits_in){in[bits_in-1]}},in};
> endmodule
> 
> Thanks in advance.
> 
> 
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]