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.

Accessing range of array elements VHDL

Status
Not open for further replies.

Curios_Eng

Newbie level 3
Joined
Nov 23, 2015
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
45
Hey Guys,

I have a serializer which I am using as an transmitter, the data set i will transmit I define it in the beginning. Then by using every clock cycle i am reading it from the array and sending it to serializer. Is there a better way to read the array or is there any disadvantages of using it in this way ?


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
type data_array is array (0 to 479999) of integer range 0 to 1;
constant data :data_array:=(1,0,0,1,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,1,0,0,1,0,0);
 
tx_parallel_data(0)<=to_unsigned(data(0+counter),1)(0);
    tx_parallel_data(1)<=to_unsigned(data(1+counter),1)(0);
    tx_parallel_data(2)<=to_unsigned(data(2+counter),1)(0);
    tx_parallel_data(3)<=to_unsigned(data(3+counter),1)(0);
    tx_parallel_data(4)<=to_unsigned(data(4+counter),1)(0);
    tx_parallel_data(5)<=to_unsigned(data(5+counter),1)(0);
    tx_parallel_data(6)<=to_unsigned(data(6+counter),1)(0);
    tx_parallel_data(7)<=to_unsigned(data(7+counter),1)(0);
    tx_parallel_data(8)<=to_unsigned(data(8+counter),1)(0);
    tx_parallel_data(9)<=to_unsigned(data(9+counter),1)(0);
    tx_parallel_data(10)<=to_unsigned(data(10+counter),1)(0);
    tx_parallel_data(11)<=to_unsigned(data(11+counter),1)(0);
    tx_parallel_data(12)<=to_unsigned(data(12+counter),1)(0);
    tx_parallel_data(13)<=to_unsigned(data(13+counter),1)(0);
    tx_parallel_data(14)<=to_unsigned(data(14+counter),1)(0);
    tx_parallel_data(15)<=to_unsigned(data(15+counter),1)(0);
    tx_parallel_data(16)<=to_unsigned(data(16+counter),1)(0);
    tx_parallel_data(17)<=to_unsigned(data(17+counter),1)(0);
    tx_parallel_data(18)<=to_unsigned(data(18+counter),1)(0);
    tx_parallel_data(19)<=to_unsigned(data(19+counter),1)(0);
    tx_parallel_data(20)<=to_unsigned(data(20+counter),1)(0);
    tx_parallel_data(21)<=to_unsigned(data(21+counter),1)(0);
    tx_parallel_data(22)<=to_unsigned(data(22+counter),1)(0);
    tx_parallel_data(23)<=to_unsigned(data(23+counter),1)(0);
    tx_parallel_data(24)<=to_unsigned(data(24+counter),1)(0);
    tx_parallel_data(25)<=to_unsigned(data(25+counter),1)(0);
    tx_parallel_data(26)<=to_unsigned(data(26+counter),1)(0);
    tx_parallel_data(27)<=to_unsigned(data(27+counter),1)(0);
    tx_parallel_data(28)<=to_unsigned(data(28+counter),1)(0);
    tx_parallel_data(29)<=to_unsigned(data(29+counter),1)(0);
    tx_parallel_data(30)<=to_unsigned(data(30+counter),1)(0);
    tx_parallel_data(31)<=to_unsigned(data(31+counter),1)(0);
 
counter:=counter+32;
    if counter> limitforData then
        counter:=0;
    end if;



Thank you!
 
Last edited by a moderator:

Wow - this appears to be one of the more overcomplicated solutions to something I think Ive seen in 15 years.
From reading your (syntactically incorrect example), you're trying to use a ROM to store a set of values you want to send out over some serial interface? why store so many idividual bits as integers (constrained to the size of 1 bit?)
Why not just store the array as a set of 32 bit values, then load them from the rom and then shift the output?
Could you please elaborate on these questions:
there is no serialiser in your code - is that some other block? is tx_parallel_data the input to the serialiser?
Can you post the actual code? have you got a testbench?
 
Wow - this appears to be one of the more overcomplicated solutions to something I think Ive seen in 15 years.
From reading your (syntactically incorrect example), you're trying to use a ROM to store a set of values you want to send out over some serial interface? why store so many idividual bits as integers (constrained to the size of 1 bit?)
Why not just store the array as a set of 32 bit values, then load them from the rom and then shift the output?
Could you please elaborate on these questions:
there is no serialiser in your code - is that some other block? is tx_parallel_data the input to the serialiser?
Can you post the actual code? have you got a testbench?

Actually, you have helped me with you suggestion of 32 bit values. It has solved my problem!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top