D
dm
Guest
Hello, dear All!
Consider following cases with negation, please.
1) Bit-wise
--- 8< ---
module top (in, out);
input [1:0] in;
output [3:0] out;
assign out = ~in; // synthesis tools assign "1" to upper bit (2) of
out
endmodule
--- >8 ---
2) logical
--- 8< ---
module top (in, out);
input [1:0] in;
output [3:0] out;
assign out = !in; // synthesis tools assign "0" to upper bit (2) of
out
endmodule
--- >8 ---
as bit width of LHS)
- negation is performed
But I couldn't understand why? Before investigating this fact, I
believed that such behavior is OK only for simulator. What is the
reason for synthesis tool to work in such way -- common practice is to
fill up with zeroes all unused ports.
Any suggestions?
Thanks for the attention and kind regards!
dm
Consider following cases with negation, please.
1) Bit-wise
--- 8< ---
module top (in, out);
input [1:0] in;
output [3:0] out;
assign out = ~in; // synthesis tools assign "1" to upper bit (2) of
out
endmodule
--- >8 ---
2) logical
--- 8< ---
module top (in, out);
input [1:0] in;
output [3:0] out;
assign out = !in; // synthesis tools assign "0" to upper bit (2) of
out
endmodule
--- >8 ---
- bit width of RHS is changed (filled up with zeroes -- to be the sameFrom behavior of synthesis tools, we can see that negation is
synthesized in following way:
as bit width of LHS)
- negation is performed
But I couldn't understand why? Before investigating this fact, I
believed that such behavior is OK only for simulator. What is the
reason for synthesis tool to work in such way -- common practice is to
fill up with zeroes all unused ports.
Any suggestions?
Thanks for the attention and kind regards!
dm