HELP ! WHY doesn't SHL multiply by two ??

J

Jam

I don't get it:

I use the libraries:
Library IEEE;
Use IEEE.Std_logic_1164.all;
Use IEEE.Std_logic_unsigned.all;

I have a one compl ADC

temp(11 downto 0) <= (not FOCADCd(11) & FOCADCd(10 downto 0));

SAin(11 downto 0) <= SHL(temp,"10");

should this do the same as SAin(11 downto 0) <= SAin(11 downto 0) <=
(Temp(10 downto 0) & '0');
 
R

rickman

Jam said:
I don't get it:

I use the libraries:
Library IEEE;
Use IEEE.Std_logic_1164.all;
Use IEEE.Std_logic_unsigned.all;

I have a one compl ADC

temp(11 downto 0) <= (not FOCADCd(11) & FOCADCd(10 downto 0));

SAin(11 downto 0) <= SHL(temp,"10");

should this do the same as SAin(11 downto 0) <= SAin(11 downto 0) <=
(Temp(10 downto 0) & '0');

I am not totally clear on what you want to do in the above code. You
invert the msbit of your ADC input and then shift it left by two in the
same size word. This drops the top two bits of the original data.
Perhaps you need to define temp as 14 bits before you do the shift?
Also, it seems you think you are shifting by 1 bit while "10" specifies
two bit positions for the shift. I would do it this way.

temp(13 downto 0) <= (not FOCADCd(11) & FOCADCd(10 downto 0) & "00");

--

Rick "rickman" Collins

(e-mail address removed)
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX
 
A

anupam

Hi Pl tell me what do u want to do with this line

SAin(11 downto 0) <= SHL(temp,"10");

Anupam
 
M

Martin Thompson

anupam said:
Hi Pl tell me what do u want to do with this line

SAin(11 downto 0) <= SHL(temp,"10");

Are you trying to do
SAin(11 downto 0) <= temp(10 downto 0) & '0';

?

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top