--- Quote Start ---
hi guys I just purchased the DE2-115 board and embarrassingly I have run into an error into the first lab itself:
We are supposed to implement a multiplexor so that the green LEDs mimic the input of either switches 0 - 7 or 8 - 15 based on the select input on switch 17. Heres my code; please tell me why only the x input is being passed perfectly to the green LEDs but when s is high only SW[8] is passed to the green LEDS from y inputs. Thanks!!!
:
Module TrialTwo (SW, LEDG, LEDR);
Input [17:0] SW;
Output [17:0] LEDR;
Output [7:0] LEDG;
Wire [7:0] x;
Wire [7:0] y;
Wire [7:0] m;
Wire s;
Assign x[7:0] = SW[7:0];
Assign x[7:0] = SW[15:8];
Assign s = SW[17];
Assign m = (~s&x) | (s&y);
Assign LEDG = m;
Assign LEDR = SW;
endmodule
--- Quote End ---
you are not driving y but x is driven twice?