A VARIABLE y is declared of STD_LOGIC_VECTOR type of 4 bits, if you want to assign 1001 to y, then what is the write assignment statement?

Thu Ha

New member
A VARIABLE y is declared of STD_LOGIC_VECTOR type of 4 bits, if you want to assign 1001 to y, then what is the write assignment statement?
A. y <= “1001”
B. y := “1001”
C. y <= ‘1’, ‘0’, ‘0’, ‘1’
D. y => “1001”
 
Answer: b
Explanation: To assign values to any variable, the := operator is used. Since, y is a VARIABLE STD_LOGIC_VECTOR type, we can only use := operator and not <= operator. => can be used, but while assigning individual elements of a vector.
 

Tìm kiếm

Back
Top