# VHDL signal assignments

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?

• 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
• 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: electronics.stackexchange.com/questions/51848/… – 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
• @TonyM the four spaces are defined by the markup. If you use two it doesn't put the code in a code block. See electronics.stackexchange.com/editing-help: "Indent four spaces to create an escaped <pre> <code> block" – stanri Feb 13 '18 at 12:22

VHDL is a strongly typed language. All vectors which you concatanate on the right side should be of same data type. And the data type of the result of the right side expression should match with the data type of the left side expression. In VHDL, "bit" is a 2-valued data type and "std_logic" is an 8-valued data type. They both are different.

• std_logic is a resolved std_ulogic which is a character enumerated type having 9 values ('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-') count 'em. Enumerated means the values are named, character means at least some names are character literals. The value is positional (which doesn't correspond between the two types). Those 'vectors' are single dimensional array types with an element type that is a character enumerated type. The concatenation operator is predefined for all single dimensional array types. – user8352 Feb 13 '18 at 19:35