Write a verilog code to swap contents of two registers with and without a temporary register?

| Tuesday, September 29, 2009
With temp reg ;

always @ (posedge clock)
begin
temp=b;
b=a;
a=temp;
end

Without temp reg;

always @ (posedge clock)
begin
a <= b;
b <= a;
end

1 comments:

Unknown said...

error occurs at above code,,because of same variable using for input and also output,a<=b;b<=a; here how to declare output port variable to see result of a,b

Post a Comment