简体   繁体   English

如何在verilog中将变量作为二维数组中的参数传递

[英]how to pass variables as arguments in two dimensional array in verilog

How to pass variables as arguments array in Verilog because in a 48 bit array?由于在 48 位数组中,如何在 Verilog 中将变量作为参数数组传递? I want an array of 23 bits from the first MSB 1. Can someone say me the method or give program for this condition?我想要第一个 MSB 1 的 23 位数组。有人可以告诉我这种情况的方法或程序吗?

For example, if I give an input like:例如,如果我给出如下输入:
001010101010111000100010010100100110001101010101 001010101010111000100010010100100110001101010101
the output should be:输出应该是:
01010101011100010001001. 01010101011100010001001。

Basically, you need to perform slicing of packed array.基本上,您需要对压缩数组执行切片。

There can be many methods for doing this, for example streaming operators operators etc.可以有很多方法来做到这一点,例如流运营运营商等。

I've provided a couple of methods here .我在这里提供了几种方法。 Using for loops and the -: operator .使用for循环和-: 运算符 If you are using system-verilog, then the use of -: operator is preferred.如果您使用 system-verilog,则首选使用 -: 运算符。

PS : I still don't get why did you mention two dimensional array . PS:我还是不明白你为什么提到二维数组

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM