1 / 7

Cascading 1-Bit Comparators

Cascading 1-Bit Comparators. Discussion D7.0. A 1-Bit Comparator. The variable Gout is 1 if Gin = 1 or if Ein = 1 and x > y . The variable Eout is 1 if Ein = 1 and x = y . . module comp4 ( x, y, gt, eq, lt ); input [3:0] x ; wire [3:0] x ; input [3:0] y ;

cissy
Download Presentation

Cascading 1-Bit Comparators

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. Cascading 1-Bit Comparators Discussion D7.0

  2. A 1-Bit Comparator The variable Gout is 1 if Gin = 1 or if Ein = 1 andx > y. The variable Eout is 1 if Ein = 1 andx = y.

  3. module comp4 ( x, y, gt, eq, lt ); input [3:0] x ; wire [3:0] x ; input [3:0] y ; wire [3:0] y ; output lt ; wire lt ; output gt ; wire gt ; output eq ; wire eq ; A 4-Bit Comparator x 1 1 0 1 y 1 0 1 1 lt

  4. A 4-Bit Comparator lt wire [4:0] G; wire [4:0] E; assign G[4] = 0; assign E[4] = 1; assign gt = G[0]; assign eq = E[0]; assign lt = ~(G[0] | E[0]);

  5. comp1bit U3(.xi(x[3]) ,.yi(y[3]) ,.Ein(E[4]) , .Eout(E[3]) ,.Gin(G[4]) ,.Gout(G[3]) );

  6. comp1bit U3(.xi(x[3]) ,.yi(y[3]) ,.Ein(E[4]) , .Eout(E[3]) ,.Gin(G[4]) ,.Gout(G[3]) );

  7. comp1bit U3(.xi(x[3]) ,.yi(y[3]) ,.Ein(E[4]) ,.Eout(E[3]) , .Gin(G[4]) ,.Gout(G[3]) ); comp1bit U2(.xi(x[2]) ,.yi(y[2]) ,.Ein(E[3]) ,.Eout(E[2]) , .Gin(G[3]) ,.Gout(G[2]) ); comp1bit U1(.xi(x[1]) ,.yi(y[1]) ,.Ein(E[2]) ,.Eout(E[1]) , .Gin(G[2]) ,.Gout(G[1]) ); comp1bit U0(.xi(x[0]) ,.yi(y[0]) ,.Ein(E[1]) ,.Eout(E[0]) , .Gin(G[1]) ,.Gout(G[0]) ); endmodule

More Related