1 / 3

Behavioral

Behavioral. module MUX4_to_1(y, x, s); input x[3:0], s[1:0]; output y; reg y; always @(x or s) begin if (s == 0) y=x[0]; else if …; end endmodule. Continuous Assignment. module MUX4_to_1(y, x, s); input x[3:0], s[1:0]; output y;

luke-jensen
Download Presentation

Behavioral

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Behavioral module MUX4_to_1(y, x, s); input x[3:0], s[1:0]; output y; reg y; always @(x or s) begin if (s == 0) y=x[0]; else if …; end endmodule

  2. Continuous Assignment module MUX4_to_1(y, x, s); input x[3:0], s[1:0]; output y; assign y = (!s[0]&!s[1]&x[0]) | (!s[1]&s[0]&x[1]) | (s[0]&!s[1]&x[2]) | (s[1]&s[0]&x[3]); endmodule

  3. Structure module MUX4_to_1(y, x, s); input x[3:0], s[1:0]; output y; wire s1_, s0_, y0, y1, y2, y3; // optional not(s1_, s1); not(s0_, s0); and(y0, s1_, s0_, x[0]); and(y1, s1_, s0, x[1]); … or (y, y0, y1, y2, y3); endmodule

More Related