Legal Assignments Vs Illegal Assignments Confirm that the statements below are l
ID: 2989776 • Letter: L
Question
Legal Assignments Vs Illegal Assignments
Confirm that the statements below are legal (see main causes of mistakes in section 3.19).
a) s2(7) <= s1;
b) s3 <= s4(0);
c) s2 <= v1 XOR "10001000";
d) s5 <= v2/2;
e) s3 <= 'Z';
f) s2 <= (OTHERS=>'0');
g) v2 := 35;
h) v1 := "11110000";
And Explain why the assignments below are illegal (see main causes of mistakes in section 3.19).
a) s1(0) <= s2(0);
b) s3 <= s1 OR s2(2);
c) s2 <= (8=>'0', OTHERS=>'Z'); d) v2 <= -35;
e) s3 := 'Z';
f) s2(7 DOWNTO 5) <= v1(3 DONWTO 0) OR "1000";
g) v1(7) <= s1 AND s2(0);
h) s4(0) <= s2(0);
Explanation / Answer
Confirm that the statements below are legal (see main causes of mistakes in section 3.19).
a) s2(7) <= s1;its legal
b) s3 <= s4(0);its legal
c) s2 <= v1 XOR "10001000";its legal
d) s5 <= v2/2;its legal
e) s3 <= 'Z';its legal
f) s2 <= (OTHERS=>'0');its illegal;
g) v2 := 35;its legal
h) v1 := "11110000";its legal
And Explain why the assignments below are illegal (see main causes of mistakes in section 3.19).
a) s1(0) <= s2(0);illegal due to invalid representation(ie) s1 cannot be represent by array
b) s3 <= s1 OR s2(2); Type mismatch
c) s2 <= (8=>'0', OTHERS=>'Z'); invalid representation
d) v2 <= -35;Incorrect assignment oprator
e) s3 := 'Z';Incorrect assignment oprator
f) s2(7 DOWNTO 5) <= v1(3 DONWTO 0) OR "1000";size mismatch;
g) v1(7) <= s1 AND s2(0);;Incorrect assignment oprator
h) s4(0) <= s2(0);type mismatch;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.