完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我在我的一个项目中使用PRS 2组件来生成一步一步的伪随机值。 该组件被配置为具有单周期和单步API模式的种子值0xFFFFFFF的32位分辨率(32, 30, 26,25)。 初始化是通过以下方式完成的: 下面的代码行是一步一步迭代的: (sBuffer-[0])(Unti8)(SnBuffel&App:0x000),SunButo[[ 2 ] ]=(UTIN 8)((BNPCR>GT;8)和0x000×0.00 FF);SeNdBuff[1 ]=(UTIN 8)((BNPCR>GT;16)和0x000 000 FFF);SeNdBuff[0 ]=(UITN8)((BNPCR>GT;24)和0x000×00 FFF);UIT32 32 BNPCR= PRSY1I读数4); 因此,我从USB发送的移位寄存器中得到二进制值。然后在二进制编码中显示值(每行4字节,左MSB): (1):10111001111111111111111111α(2):0101011111111111111111111(3):010101111111111111111111110,4:110 1011111111111111111111100,5:111010011111111111111111111001,6:100101111111111111111111110011α7:011011111111111111111100100111 8α0:11111111111111111111111111111111011011111111111111111111001110 #九:11110001111111111111111110011101 #十:10100101111111111111111100111011 # 11: 00001101111111111111111001110111 # 12: 00011011111111111111110011101110 # 13: 00110111111111111111100111011100 #十四:15:11011111111111111110011101110000 01101111111111111111001110111000 ## 16:17:11111 001111111111100111011100001 # 10110101111111111001110111000011 # 18:00101101111111100011101110000111 # 19:01011011111111000111011100001110 # 20:10110111111110011110111000011100… 在我的理解看来,每一步,一位是从转移到LSB的一面。但是MSB部分的5…7比特是什么??伪随机值应该从一个到下一步的shiftet新位相等呢? 有人能帮助我吗?) 拜伊 弗兰兹 以上来自于百度翻译 以下为原文 Hello, i'am using the prs 2.0 component in one of my projects to generate step by step pseudo random values. The component is configured as 32bit Resolution (32, 30, 26, 25) with seed value 0xFFFFFFFF in single cycle and single step API mode. Initialization is done trough: PRS_1_Start(); An following lines of code are step by step iterated: uint32 binprc = PRS_1_Read(); SendBuffer[3] = (uint8)(binprc & 0x000000FF); SendBuffer[2] = (uint8)((binprc>>8) & 0x000000FF); SendBuffer[1] = (uint8)((binprc>>16) & 0x000000FF); SendBuffer[0] = (uint8)((binprc>>24) & 0x000000FF); USBUART_1_Write(SendBuffer, 4); PRS_1_Step(); So I get the binary values from the shift register sent through u***. The values are then displayed in binary coding (each line a step of 4 bytes, left MSB): #0: 11111111111111111111111111111111 #1: 10111001111111111111111111111111 #2: 00110101111111111111111111111111 #3: 01101011111111111111111111111110 #4: 11010111111111111111111111111100 #5: 11101001111111111111111111111001 #6: 10010101111111111111111111110011 #7: 01101101111111111111111111100111 #8: 11011011111111111111111111001110 #9: 11110001111111111111111110011101 #10: 10100101111111111111111100111011 #11: 00001101111111111111111001110111 #12: 00011011111111111111110011101110 #13: 00110111111111111111100111011100 #14: 01101111111111111111001110111000 #15: 11011111111111111110011101110000 #16: 11111001111111111100111011100001 #17: 10110101111111111001110111000011 #18: 00101101111111100011101110000111 #19: 01011011111111000111011100001110 #20: 10110111111110011110111000011100 ... For my understanding it looks like that with each step one bit comes shifted in from the l*** side. But what are the 5..7 Bits in the MSB part?? Pseudo random values should be equal from one to the next step up to the shiftet in new bit? Can anybody help me :) Bye Franz |
|
相关推荐
8个回答
|
|
嗨,弗兰兹,
对我们来说,看看整个项目(或一个工作实例)总是比较容易的。 你介意吗? 第一清洁工程 第二档案(最小和压缩) 第三上传到这里 我来看看。 鲍勃 以上来自于百度翻译 以下为原文 Hi Franz, it is always easier for us to have a look at the complete project (or a working example). Would you mind to 1st Clean project 2nd Archive (minimal and compressed) 3rd upload here I'll have a look at it. Bob |
|
|
|
和
所观察到的行为(从MSB到LSB的比特移位)是定义这些伪随机数序列的算法的一部分。 这意味着: 数字不是随机数 数字序列满足随机数序列的数学测试。 当显示为二进制值时,移位变得明显,但是当显示为小数时,“伪”会被隐藏。 所以我的问题是:你想用那个数字序列做什么? 或者你只需要一个(一些)随机数? 鲍勃 以上来自于百度翻译 以下为原文 and the watched behaveour (shifting in bits from MSB into LSB) is part of the defined algorithm to generate those Pseudo-Randomnumber-Sequence. That implies: The numbers are not random-numbers The sequence of the numbers fulfills a math test for a random-number sequence. When displayed as binary values, the shifts become obvious, but when displayed as decimals, the "pseudo" gets a bit hidden. So my question is: What do you want to do with that Sequence of numbers? Or do you just need a (some) Random-number(s)? Bob |
|
|
|
好吧,好像误解了…
从右侧移位(LSB侧)是正确的行为(典型的LFSR)。我的问题是左边的5个.7位(MSB边)没有正确的移位。我不知道他们是从哪里来的。 我期待: α0:11111111 α1:1111111 N α2:111111 α3:11111 NNN α3:1111NNNN “N”是一个伪随机移位在新的位每次。每次MSB位移出MSB侧。 我需要这个来解码一个提取的序列。也许我可以打包一个剥离版本的项目,并上传到这里。 谢谢你的帮助。 以上来自于百度翻译 以下为原文 Ok it seems to missunderstood... The shifted in bit from the right side (l*** side) is the correct behaviour (typical LFSR). My Problem is the 5..7Bits on the left side (m*** side) that doesn't shift correctly. I do not know where they come from. I expect: #0: 11111111 #1: 1111111n #2: 111111nn #3: 11111nnn #3: 1111nnnn ...and so on with "n" is one pseudo random shifted in new bit each time. Ane each time a MSB bit is shifted out on the MSB side. I need this for decoding a fetched sequence. Maybe I can pack a stripped version of the project and upload it here. Thanks for your help. |
|
|
|
或者上面的例子:
(1):11111111111111111111111111(2):11111111111111111111111111,3:11111111111111111111111111 0,0:4:11111111111111111111111111 00 00α:111111111111111111111111111 001 6 6:111111111111111111111111110011 0011 7:11111111111111111111111111占星虫:α0:111111111111111111111111111111111111111111111111111111 001110α9(1111111111111111111111 0011101 0011101):1111111111111111111111 00111011α11:1111111111111111111111 001110111 001110111 12:1111111111111111111111 0011101110 13 13:11111111111111111111 00111011100 00111011100 14:11111111111111111111 00111011100α(16):111111111111111111,00111011100001,17:11111111111111111,001110111000011,18,111111111111111,00011101110000111,19,11111111111111,000111011100001110,000111011100001110:希望对我有帮助。谢谢。 以上来自于百度翻译 以下为原文 Or with the example above: #0: 11111111111111111111111111111111 #1: 11111111111111111111111111111111 #2: 11111111111111111111111111111111 #3: 11111111111111111111111111111110 #4: 11111111111111111111111111111100 #5: 11111111111111111111111111111001 #6: 11111111111111111111111111110011 #7: 11111111111111111111111111100111 #8: 11111111111111111111111111001110 #9: 11111111111111111111111110011101 #10: 11111111111111111111111100111011 #11: 11111111111111111111111001110111 #12: 11111111111111111111110011101110 #13: 11111111111111111111100111011100 #14: 11111111111111111111001110111000 #15: 11111111111111111110011101110000 #16: 11111111111111111100111011100001 #17: 11111111111111111001110111000011 #18: 11111111111111100011101110000111 #19: 11111111111111000111011100001110 #20: 11111111111110011110111000011100 I hope will help. Thanks. |
|
|
|
再次好:
α0:111111111111111111111111111111 α1:111111111111111111111111111111 α2:111111111111111111111111111111 α3:11111111111111111111111111111 0 α4:1111111111111111111111111111 00 α5:111111111111111111111111111 001 α6:11111111111111111111111111 0011 α7:1111111111111111111111111 00111 α8:11111111111111111111111111 001110 α9:111111111111111111111111 0011101 α10:111111111111111111111111 00111011 α11:11111111111111111111111 001110111 α12:1111111111111111111111 0011101110 α13:111111111111111111111 00111011100 α14:11111111111111111111 001110111000 “15”:111111111111111111“0011101110000” “16”:111111111111111111“00111011100001” “17”:11111111111111111“001110111000011” “18”:111111111111111“00011101110000111” “19”:11111111111111“000111011100001110” “20”:1111111111111“001111011100001110” 以上来自于百度翻译 以下为原文 okay again :-) #0: 11111111111111111111111111111111 #1: 11111111111111111111111111111111 #2: 11111111111111111111111111111111 #3: 11111111111111111111111111111110 #4: 11111111111111111111111111111100 #5: 11111111111111111111111111111001 #6: 11111111111111111111111111110011 #7: 11111111111111111111111111100111 #8: 11111111111111111111111111001110 #9: 11111111111111111111111110011101 #10: 11111111111111111111111100111011 #11: 11111111111111111111111001110111 #12: 11111111111111111111110011101110 #13: 11111111111111111111100111011100 #14: 11111111111111111111001110111000 #15: 11111111111111111110011101110000 #16: 11111111111111111100111011100001 #17: 11111111111111111001110111000011 #18: 11111111111111100011101110000111 #19: 11111111111111000111011100001110 #20: 11111111111110011110111000011100 |
|
|
|
产生伪随机数的算法不只是将MSB移入LSB。名为“PulmiOm”的参数给出了与前面的位置相加的位位置。并非所有的多项式都保证提供一个最佳长度序列(2 ^比特数),但是默认的多项式是。
当你看一下你的32位PSR的PulmiMod时,你会发现它只是使用了一些上面的位,你可以观察到输出中突然的位变化。 种子值提供了2个比特- 1个不同序列(序列的起始序列)的机会,只有零(0)的种子值不会产生序列。 以上来自于百度翻译 以下为原文 The algorithm for generating pseudo-random numbers is not only shifting in of the m*** into the l***. The parameter named "Polynome" gives the bit-positions which are to be XORed with theit previous positions. Not all polynomes guarantee to deliver a sequence of optimal length (2^bitnumber) but the default polynom is. When you look at the polynome for your 32-bit PSR, you see that it just uses a few upper-bits where you observe the sudden bit-changes in your output. The seed - value gives the opportunity to have 2^bits -1 different sequences (start pooints of the sequence) only the seed-value of zero (0) will not generate a sequence. |
|
|
|
是的,昨天注意到,所实现的LFSR算法是伽罗瓦算法,而不是FibBnNaCi,这是我所期望的。
我用这种方法解决了,我在另一个普通移位寄存器中获取比特流输出,因此得到了在我的模拟中计算出的随机值。 谢谢你的帮助! 弗兰兹 以上来自于百度翻译 以下为原文 Yes a noticed yesterday, that the implemented LFSR algorithm is the galois one and not fibbonnaci, that I expect. I solved it this way, that I fetch the bitstream output in another ordinary shift register and so get my random values as calculated in my simulations. Thank you for your help! Franz |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2106 浏览 1 评论
1853 浏览 1 评论
3672 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1788 浏览 6 评论
1536 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
573浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
426浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
439浏览 2评论
389浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
919浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 00:57 , Processed in 1.176566 second(s), Total 92, Slave 75 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号