Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Serial loading into an array (VHDL)

Status
Not open for further replies.

REIGN_

Newbie level 3
Joined
Dec 9, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
Is it possible to load data from a pin in a serial way and put it into an array in VHDL?

What i want to accomplish is for the data to be put through one pin and for each clock signal the data to be saved in a different cell of the array.

For example:

T1 -> Data_in : 10 to be put in Array(0,0)
T2 -> Data_in : 30 to be put in Array(0,1)
T3 -> Data_in : 25 to be put in Array(0,2)

So that in the end the array looks like this

Array {10, 30, 25}

The problem is that i want to use only one pin and not load the data parallel.

Thanks in advance
 

Thank you very much for your reply.

Unfortunately what i want to do is take input data from one pin and store it in an array internally. I could use a shift register but my problem is not creating the input as well as storing the input in the array.
 

Get data from the pin in each clock cycle and put it in a array. This can be done by changing the index of the array using a counter. The counter value should increment at every clock cycle.

if(rising_edge(clk)) then

count <= count + 1;
array(count) <= data_from_pin;
if(count = array_size) then
count = 0;
end if;
end if;
 

you want to store 10, 30, 25 in one cell, 30 if it hex number is a 6 bits long value, if it dec 5 bits, so you memory will be 2^address X 6bit size. If you use hex, you should create 6 bit shift register, after 6 clock cycles register assert signal "ready to store". then array(address) <= data_from_shift_register
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top