vivado width mismatch error in synthesis

OP #6305818
Rate this post
• ▲ useful
▼ not useful
Hi!
vivado gives me this error :
[Synth 8-690] width mismatch in assignment; target has 16 bits, source 
has 1 bits  for this line :  leds <= "0" & leds(length-1 to 1);
which is inserted in this contest :
1
if leds = led_left then
2
         direction <='1';
3
         leds <= "0" & leds(length-1 to 1);
the leds vector and the main constants are defined in this way :
1
kc: out STD_LOGIC_VECTOR(LENGTH-1 downto 0)
2
length : integer :=16;
3

4
constant kc_in : std_logic_vector(LENGTH-1 downto 0):=std_logic_vector(to_unsigned(2**kc'RIGHT,LENGTH));
5

6
constant led_left : std_logic_vector(LENGTH-1 downto 0) :=
7
std_logic_vector(to_unsigned(2**kc'LEFT,LENGTH));
8
signal leds : STD_LOGIC_VECTOR(length-1 downto 0):=kc_in;
Where is the problem?
thank you very much

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.