Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `timescale 1ns / 1ps
- module lab1_3_1_source(
- input x,
- input y, //x and y are the two inputs to the MUX
- input s, //s is the switch that determines the output
- output reg m //output is a reg as we wish the LED to hold its' state
- );
- always @ (x or y or s) //sensitivity list contains x, y, and s as they are the operators that determine the output
- if(s==0)
- m=x; //if switch is in position 0 then take value of x to determine m
- else
- m=y; //if switch is in position 1 then take value of y to determine m
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement