How Do You Represent High Impedance States in Verilog?

  • Thread starter asd1249jf
  • Start date
  • Tags
    Impedance
In summary, high impedance states can be declared in Verilog using the symbols '?' or 'z', and unsized hex numbers are automatically sized as 32 bits by default.
  • #1
asd1249jf
High Impedance in Verilog?

Homework Statement



Provide the correct Verilog text for encoding the following numerical values:

A) A 16 bit hexadecimal with all positions in the high impedance state:

B) An unsized hex number BEEF

Homework Equations



Verilog Problem. There is no relavant equation to be used.

The Attempt at a Solution



What the.. I didn't even know a variable can literally be declared as high impedance. I thought high impedance state occurs when the variable is neither off or on.

Also, I thought the variables you declare in verilog MUST be sized.

How are these accomplished?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
l46kok said:

Homework Statement



Provide the correct Verilog text for encoding the following numerical values:

A) A 16 bit hexadecimal with all positions in the high impedance state:

B) An unsized hex number BEEF

Homework Equations



Verilog Problem. There is no relavant equation to be used.

The Attempt at a Solution



What the.. I didn't even know a variable can literally be declared as high impedance. I thought high impedance state occurs when the variable is neither off or on.

Also, I thought the variables you declare in verilog MUST be sized.

How are these accomplished?

You actually can have the states as high-impedance. In your case, it would be

16'h?
or
16'hz

would work.

There is no such thing as unsized hex number. Even if you forget to declare the size, by default, verilog would size it as 32 bit.
 
  • #3


I can provide some clarification on high impedance in Verilog. In Verilog, high impedance is represented by the letter "z" or "Z". It is used to represent a floating or undefined state, where the value of the variable is not known. This can occur when multiple drivers are trying to drive a signal, or when a signal is not being driven by any driver.

To encode a 16-bit hexadecimal with all positions in the high impedance state, you can use the following Verilog text:

reg [15:0] my_var; // declare a 16-bit register
assign my_var = 16'hz; // assign the value of the register to be all high impedance

To encode an unsized hex number BEEF, you can use the following Verilog text:

reg [3:0] my_var; // declare a 4-bit register
assign my_var = 'hBEEF; // assign the value of the register to be unsized hex number BEEF
 

1. What is high impedance in Verilog?

High impedance, also known as Hi-Z, is a state in Verilog where a signal is not driven by any source and is left floating. In this state, the signal has a very high resistance and does not have a defined value.

2. Why does high impedance occur in Verilog?

High impedance occurs in Verilog when a signal is not driven by any source or when multiple sources are driving a signal with different values. This can happen due to errors in the code or incorrect usage of tri-state buffers.

3. How does high impedance affect the simulation results?

High impedance can cause unexpected behavior in simulation results as the floating signals can interact with other signals and change their values. This can lead to incorrect logic or timing in the design and can be difficult to debug.

4. How can high impedance be avoided in Verilog?

To avoid high impedance in Verilog, it is important to ensure that all signals have a defined value and are not left floating. This can be achieved by properly assigning values to signals, using tri-state buffers when necessary, and avoiding multiple drivers for a signal.

5. How is high impedance handled in hardware implementation?

In hardware, high impedance is handled by using pull-up or pull-down resistors to give the floating signal a defined value. This ensures that the signal does not interact with other signals and helps maintain the stability of the circuit.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Quantum Physics
2
Replies
47
Views
4K
  • High Energy, Nuclear, Particle Physics
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
3K
  • STEM Academic Advising
Replies
13
Views
2K
  • Introductory Physics Homework Help
Replies
13
Views
6K
  • Introductory Physics Homework Help
Replies
5
Views
3K
Back
Top