# How to access the dynamic array bit by bit ex bit \[15:0\]array\[variable\_length\]

**URL:** <https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989>\
**Category:** SystemVerilog\
**Tags:** dynamic-arrays, SystemVerilog\
**Created:** [March 22, 2017, 12:44pm UTC](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989 "2017-03-22T12:44:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanajirao](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/e95f7d/32.png) [@Tanajirao](https://verificationacademy.com/forums/u/Tanajirao)\
**Post date:** [March 22, 2017, 12:44pm UTC](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989/1 "2017-03-22T12:44:28Z")

</div>

Hello every one there,  
I have a dynamic array bit [15:0]data[variable\_length\_for\_example\_say10],

now I want to break the dynamic array into [15:0]data[0],[15:0]data[1],[15:0]data[2]…[15:0]data[10],

my goal is to send the dynamic array data bit by bit ie serially. first data[0] bits and the data[1] bits and so on.

could you help me how to access the dynamic array data in a loop;

Regards  
Tanajirao

---

<div class="post-metadata">

**Author:** ![sunils](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@sunils](https://verificationacademy.com/forums/u/sunils)\
**Post date:** [March 22, 2017, 1:14pm UTC](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989/2 "2017-03-22T13:14:36Z")

</div>

_In reply to [Tanajirao](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989):_

Hello Rao,  
Please try with for loop and collect the individual array elements into another array. And create the sequence with it.

Thanks.

---

<div class="post-metadata">

**Author:** ![jlivermore](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/j/3d9bf3/32.png) [@jlivermore](https://verificationacademy.com/forums/u/jlivermore)\
**Post date:** [March 22, 2017, 1:50pm UTC](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989/3 "2017-03-22T13:50:36Z")

</div>

_In reply to [sunils](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989/2):_

Streaming operator makes it very simple to pack bytes.

```verilog
bit serial_data [];
serial_data = { >> 8 {data} };

```

---

<div class="post-metadata">

**Author:** ![Tanajirao](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/e95f7d/32.png) [@Tanajirao](https://verificationacademy.com/forums/u/Tanajirao)\
**Post date:** [March 23, 2017, 12:40pm UTC](https://verificationacademy.com/forums/t/how-to-access-the-dynamic-array-bit-by-bit-ex-bit-15-0-array-variable-length/32989/4 "2017-03-23T12:40:29Z")

</div>

Thanks Sunil,  
thanks Jlivermore
