I want to store compliment of array b in array temp ( structural verilog) . But when i use display command to check final value of temp , it is showing x (don't care). Infact when i display array b's value , it also showed x (don't care). When i declare temp of type net it showed same result !
`include "PARALLEL_ADDER.v"
module subtract(a,b,ans) ;
input [3:0] a,b ;
output [4:0] ans ;
wire carry ;
reg [3:0] temp ;
integer i ;
initial begin
for(i=0;i<=3;i=i+1)
temp[i] = 1 - b[i] ;
end
Parallel_adder P1(ans,carry,4'b0001,temp) ;
endmodule
Ps Parallel adder is ruing absolutely fine !
