Plecto
Full Member level 5
- Joined
- Jan 4, 2012
- Messages
- 315
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,298
- Activity points
- 4,979
I'm trying to implement a UART on a FPGA. The data that are coming in are saved in 32-bit registers, but I'm having trouble accessing each individual bit in these registers. I would like to implement somthing like this:
This is just a part of the code, I'm only trying to emphasize having a signal inside the parantheis of another signal (D_OUT(bitnumber)), but this is not possible. I don't want to make 32 if statements to be able to access each of the 32 bits, there has to be a way to do this more easily?
signal bitnumber : STD_LOGIC_VECTOR(4 DOWNTO 0);
signal D_OUT : STD_LOGIC_VECTOR(31 DOWNTO 0);
signal RX : ST_LOGIC;
process (clock)
begin
if rising_edge (clock) then
bitnumber <= bitnumber + 1;
D_OUT(bitnumber) <= RX;
end if;
end process;
This is just a part of the code, I'm only trying to emphasize having a signal inside the parantheis of another signal (D_OUT(bitnumber)), but this is not possible. I don't want to make 32 if statements to be able to access each of the 32 bits, there has to be a way to do this more easily?