如果一个输入与一个输出具有相同的值,如何编写 verilog 代码
How to write verilog code if one input has the same value as one output
我的输出是A,B,C,D,输入是x,y,z,其实table我刚弄出来发现A和x的值一样,怎么表达A 在编写verilog 描述模块时?
我从 C = x+y 知道我可以写
AND G1(C,x,y);
可是连门都不要了怎么办?我可以想到两种写法,哪一种更有意义?
module question1(B,C,x,y);
output B,C,x;
input x,y;
或
module question1(A,B,C,y);
output A,B,C;
input A,y;
我还想知道输出 D 是否与输出 C 具有相同的值,我怎么能在模块中提到 D?
一些工具需要一些端口之间的逻辑。您可以使用 buf
原语。
module question1(output A,B,C,D, input x,y,z);
buf (A,x);
...
endmodule
否则,您可以使用端口表达式
module question1(output A,B,C,D, input .x(A) ,y,z);
...
endmodule
我的输出是A,B,C,D,输入是x,y,z,其实table我刚弄出来发现A和x的值一样,怎么表达A 在编写verilog 描述模块时? 我从 C = x+y 知道我可以写
AND G1(C,x,y);
可是连门都不要了怎么办?我可以想到两种写法,哪一种更有意义?
module question1(B,C,x,y);
output B,C,x;
input x,y;
或
module question1(A,B,C,y);
output A,B,C;
input A,y;
我还想知道输出 D 是否与输出 C 具有相同的值,我怎么能在模块中提到 D?
一些工具需要一些端口之间的逻辑。您可以使用 buf
原语。
module question1(output A,B,C,D, input x,y,z);
buf (A,x);
...
endmodule
否则,您可以使用端口表达式
module question1(output A,B,C,D, input .x(A) ,y,z);
...
endmodule