FPGA VHDL tristate buffer for ram inout signal

In summary: Basically it is the same as I put above. The DQin is the data you want to write and then DQout is the data you want to read when en is '1'.
  • #1
bassplayer142
432
0
First off, this is not school related as my semester just ended and I've just been playing around with my fpga.

My problem is that I'm trying to write to the ram module then read from it. I understand a little of the tristate buffer and inout signal but we didn't really go over this in class and I don't know if what i have is right or wrong. Here is some of my code that should give an indication of everything. (Please note i took out a lot of irrelevant code below for space and simplicity.

EDIT: I forgot to mention that I read that tristate buffers can only be used with external pins (mine is external ram). Also I just realized that this should probably be better off in the programming section so moving it is no problem.

1. Is the inout signal correct for the data being sent in(writing ram) when en = '1' and data coming out (reading ram) at en = '0'?
2. Is the buffer below correct if DQout is the incoming data I want to write to ram, and DQ is the incoming data back (read) when en goes low the data out is DQ.

Thanks for any help!port(
DQ : inout std_logic_vector(15 downto 0);
A : out STD_LOGIC_VECTOR(22 downto 0);

FlashCE_L,CE_L,WE_L,LB_L,OE_L,UB_L,RamCLK,RamADV_L,RamCRE : out STD_LOGIC
);

--buffer
DQout <= DQin when en = '1' else (others => 'Z');

DQ <= DQin;
 
Engineering news on Phys.org
  • #2
Just figured it all out. Thanks anyway, feel free to close the thread or comment if interested.
 
  • #3
bassplayer142 said:
Just figured it all out. Thanks anyway, feel free to close the thread or comment if interested.

Please tell me how you did it because i have the same problem and can't figure it out. Have nice day
 
  • #4
valium2008 said:
Please tell me how you did it because i have the same problem and can't figure it out. Have nice day

Basically it is the same as I put above. The DQin is the data you want to write and then DQout is the data you want to read when en is '1'.
 

1. What is an FPGA VHDL tristate buffer?

An FPGA VHDL tristate buffer is a hardware component that allows for a three-state logic output, meaning it can take on three possible values: 0, 1, or high impedance. This allows for multiple components to share a single bus without interfering with each other's signals.

2. How does a tristate buffer work in VHDL?

In VHDL, a tristate buffer is typically implemented using an "inout" signal, which allows for both input and output functionality. When the signal is set to an output, the buffer drives the output signal based on its input. When the signal is set to an input, the buffer goes into high impedance mode, effectively disconnecting the output from the input.

3. Can a tristate buffer be used for RAM in an FPGA?

Yes, a tristate buffer can be used for RAM in an FPGA. In fact, it is a common method for connecting multiple memory modules to a single bus in order to increase memory capacity and efficiency.

4. What is the advantage of using a tristate buffer for RAM in an FPGA?

The main advantage of using a tristate buffer for RAM in an FPGA is that it allows for multiple memory modules to share a single bus without interfering with each other's signals. This can lead to a more efficient use of hardware resources and can also simplify the design process.

5. Are there any potential issues with using a tristate buffer for RAM in an FPGA?

One potential issue with using a tristate buffer for RAM in an FPGA is the possibility of bus contention. This occurs when two or more outputs are driving the same bus at the same time, causing conflicts and potentially damaging the hardware. To avoid this, designers must carefully manage the timing and control signals in their design and ensure that only one output is enabled at a time.

Similar threads

  • Electrical Engineering
Replies
3
Views
792
  • Engineering and Comp Sci Homework Help
Replies
1
Views
8K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • General Engineering
Replies
3
Views
3K
  • Electrical Engineering
Replies
6
Views
2K
  • Computing and Technology
Replies
14
Views
3K
  • Electrical Engineering
Replies
6
Views
4K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Replies
9
Views
2K
Back
Top