The following program shouls be implemented by the software package introduced t
ID: 656192 • Letter: T
Question
The following program shouls be implemented by the software package introduced to you. (Software: ModelSim PE Student Edition).
The uploaded data must include HDL codes, logic schematics, test bench, and output timing diagram
Use HDL to design a binary half adder then using it to design a binary full adder. After that, the designed binary full adders are used to implement a 4-bt binary adder/subtractor. Use the designed 4-bit binary adder/subtractor to build a one digit decimal adder/subtractor. you also encouraged extendig it to form a two digit decimal adder/subtractor.
Explanation / Answer
HDL for Half Adder
module hadd(ss,coo,a,b);
output ss,coo;
input a,b;
xor1 u1(ss,a,b);
and1 u2 (coo,a,b);
endmodule
HDL for Full Adder
module fadd(ss,coo,a,b,ci);
output ss,coo;
input a,b,ci;
xor1 u1(ss,a,b,ci);
and1 u2(n1,a,b);
and1 u3(n2,b,ci);
and1 u4(n3,a,ci);
or1 u5(coo,n1,n2,n3);
endmodule
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.