0
\$\begingroup\$

Suppose there is a 'tri' data type variable A declared in a module m in verilog. A is connected to the output of another module n which is instantiated twice inside m, in both the instances. In one instance the value of A will be 1'bz and in another instance it will be 1'b1. What value will A take? Could you provide reference from any textbook like Samir Palnitkar or any other?

asked Mar 28, 2020 at 18:25
\$\endgroup\$
1
  • \$\begingroup\$ @KingDuken Verilog does indeed have primitives with three-state outputs. They are the bufif0, bufif1, notif0, and notif1. See section 7.4 of the 2005 IEEE Std 1364. The phrase "three-state" is a characteristic of the primitive rather than a state; the letter Z or z indicates a high-impedance state. \$\endgroup\$ Commented Mar 28, 2020 at 20:21

1 Answer 1

1
\$\begingroup\$

In SystemVerilog, wire and tri are aliases for identical net types. Section 6.6.1 Wire and tri nets in the IEEE 1800-2017 LRM explains that the driver with the strongest strength will use its value for resolution. There's no way for a net to have different values when connected through a port, but I assume you meant the driving value in each module. So the result is as defined in table 6-2, which is 1'b1.

answered Mar 28, 2020 at 20:10
\$\endgroup\$
1
  • \$\begingroup\$ Thank you. Yes, I meant the driving value of A in both the instances. \$\endgroup\$ Commented Mar 29, 2020 at 12:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.