0
X: std_logic_vector(3 down to 0);
c : Std_logic;
d : bit;
s : std_logic_vector(1 down to 0);

In architecture

x <= c&d&s;

so is this signal assignment in Architecture is correct or wrong

IS bit and std_logic having same condition and is it possible to assign the same to std_logic_vector as in assignment?

TonyM
  • 22,898
  • 4
  • 39
  • 64
  • 1
  • Please use the preview before posting, especially for code. 2. Does the value of the question increase for every question mark added?
  • – pipe Feb 13 '18 at 11:49
  • 2
    This looks like homework so I'm not going to write an answer. It's incorrect, you need to convert at least one of the types. I have also edited the code to look nicer. In the future, remember to add four spaces on to the beginning of the parts that are code. – stanri Feb 13 '18 at 11:56
  • Also have a look here: https://electronics.stackexchange.com/questions/51848/when-to-use-std-logic-over-bit-in-vhdl – Oldfart Feb 13 '18 at 11:57
  • @stanri, indentation advice is subjective but since we're here: I recommend to OP use 2 spaces, not 4. Avoids wasting line width. – TonyM Feb 13 '18 at 12:21
  • 3
    @TonyM the four spaces are defined by the markup. If you use two it doesn't put the code in a code block. See https://electronics.stackexchange.com/editing-help: "Indent four spaces to create an escaped
      block"
    
    – stanri Feb 13 '18 at 12:22
  • Sorry @stanri, read yours as what you thought OP should put in their VHDL source. Understand your point, you meant "that are code when posting on SE". – TonyM Feb 13 '18 at 12:38
  • Type BIT defined in package std.standard and type std_ulogic (the base type of std_logic) defined in package ieee.std_logic_1164 are both scalar types - character enumerated types. There is no implicit type conversion for scalar types that are not numeric types. Package std_logic_1164 contains a conversion routine To_StdULogic to convert a value of type bit to a value of std_ulogic. –  Feb 13 '18 at 19:29