Question: What is wrong with the following code for a half adder that must add if add signal equals 1? always @(x) begin if (add ==

What is wrong with the following code for a half adder that must add if add signal equals 1?
always @(x)
begin
if (add == 1)
begin
sum = x ^ y;
carry = x & y;
end
else
begin
sum = 0;
carry = 0;
end
end

Step by Step Solution

3.40 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a y must be in the ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Digital Systems Design Questions!