- Using Any Instantiation Of The Below Comparator And Adder Subtractor Modules And Any Number Of Logic Gates Make A Circu 1 (44.14 KiB) Viewed 36 times
Using any instantiation of the below comparator and adder-subtractor modules and any number of logic gates, make a circu
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Using any instantiation of the below comparator and adder-subtractor modules and any number of logic gates, make a circu
Using any instantiation of the below comparator and adder-subtractor modules and any number of logic gates, make a circuit with four-bit A and B inputs. If ASB is, output y is equal to A + B, and otherwise output y be equal to A - B. Describe the gates with logical operators and assign statements. 2.5 module addsub input [3:0] A, input (3:0) B input cin, input m, output reg (3:0) s, output reg cout ); module comp (A, B, GTI, EQ, LT); always @ (A,B,cin,m) parameter tplh=3, tphl=5, m=3; begin input [m-1:0] A, B; output GTh, EQ, LT: (cout, 3)=A-B-cin; if (m) (cout, 3)=A+B+cin; end assign # (tplh, tphl) GTh=AB, EQ=A===B, LT=A<B; endmodule endmodule