Forum: FPGA, VHDL & Verilog vivado width mismatch error in synthesis

von Stefania M. (val_1010)

Rate this post
0 useful
not useful
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 :
if leds = led_left then
         direction <='1';
         leds <= "0" & leds(length-1 to 1);
the leds vector and the main constants are defined in this way :
kc: out STD_LOGIC_VECTOR(LENGTH-1 downto 0)
length : integer :=16;

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

constant led_left : std_logic_vector(LENGTH-1 downto 0) :=
signal leds : STD_LOGIC_VECTOR(length-1 downto 0):=kc_in;
Where is the problem?
thank you very much

: Edited by Moderator
von Lothar M. (lkmiller) (Moderator)

Rate this post
1 useful
not useful
Stefania M. wrote:
> leds <= "0" & leds(length-1 to 1);
Try that instead:
  leds <= '0' & leds(length-1 to 1);

: Edited by Moderator
von Christoph Z. (christophz)

Rate this post
2 useful
not useful
Lothar M. wrote:
> Try that instead:  leds <= '0' & leds(length-1 to 1);

I think, it also needs to be "downto" instead of "to".

von Stefania M. (val_1010)

Rate this post
0 useful
not useful
I put downto and it worked!! thank you very much I really didn't notice!

: Edited by User


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig