Which of the following line of the code contains an error? [code]L1: ARCHITECTURE mux1 OF mux IS L2: BEGIN L3: y<= x0 WHEN x = ‘0’ ELSE L4:

Kim Thu Đoàn

New member
Which of the following line of the code contains an error?
Code:
L1: ARCHITECTURE mux1 OF mux IS
L2: BEGIN
L3: y<= x0 WHEN x = ‘0’ ELSE
L4:   <= x1 WHEN x = ‘1’;
L5: END mux1;
A. L2
B. L3
C. L4
D. No error
 
Answer: d
Explanation: There is no error in the given piece of the code. However, there was no need to use WHEN in the line L4 because there is no other case to be selected from many inputs. Last case can be directly expressed without any use of WHEN.
 

Tìm kiếm

Back
Top