Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*module decoder (
- input [1:0]s,
- input enable,
- output [3:0]o );
- always @ (*) begin
- if (enable)
- begin
- case ( s )
- 2'b00:
- o <= 4b'0001;
- 2'b01:
- o <= 4b'0010;
- 2'b10:
- o <= 4b'0100;
- 2'b11:
- o <= 4b'1000;
- endcase
- end
- end
- endmodule*/
- module decoder(
- input e,
- input [1:0] s,
- output o0,o1,o2,o3);
- assign o0=(e&(~s[0])&(~s[1]));
- assign o1=(e&(s[0])&(~s[1]));
- assign o2=(e&(~s[0])&(s[1]));
- assign o3=(e&(s[0])&(s[1]));
- endmodule
Add Comment
Please, Sign In to add comment