VHDL code PROBLEM ,how to create shift left operation without register in vhdl

Status
Not open for further replies.

shifter2013

Newbie level 4
Joined
Apr 14, 2013
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,319
Hi!
I have problem to create shift left operation with 4 bit input to 4bitni output?
So, I have to create shiftleft component for my ALU but that shifter must have 4bitni input and 4 bit output.
Does vhdl have some operation for shift ? I try to put sll operation but does not work.
I also try 4bit input to multiply with 2 but does not work correctly for all combinations.
I know that component can create with register but that does not work because i have to have 4 bit input and 4 output.
 

try this:
if A is your input and B your output:
B<='0' & A(3 downto 1) ;
 

Use SLL
I think your operands are "std_logic_vector"
SLL is defined for "bit" type
first convert your input to "bit" type and then use SLL
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…