完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
这里找到了一个SPI slave verilog模块
在代码开始时,autthor使用传输SCK与FPGA时钟同步 //使用3位移位寄存器将SCK同步到FPGA时钟 reg [2:0] SCKr; 总是@(posedge clk)SCKr 但是我似乎无法理解上述代码中这一行的作用 SCKr 花括号的语法有什么作用? 以上来自于谷歌翻译 以下为原文 Found a SPI slave verilog module here At the start of the code the autthor syncs the incoming SCK with the FPGA clock using // sync SCK to the FPGA clock using a 3-bits shift registerreg [2:0] SCKr; always @(posedge clk) SCKr <= {SCKr[1:0], SCK};wire SCK_risingedge = (SCKr[2:1]==2'b01); // now we can detect SCK rising edgeswire SCK_fallingedge = (SCKr[2:1]==2'b10); // and falling edges however I seemingly fail to understand what this line does in the above code SCKr <= {SCKr[1:0], SCK}; what does the syntax with the curly braces do? |
|
相关推荐
10个回答
|
|
SCKr
完全等同于以下内容: SCKr [0] SCKr [1] SCKr [2] 卷曲括号用于连接。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 在原帖中查看解决方案 以上来自于谷歌翻译 以下为原文 SCKr <= {SCKr[1:0], SCK}; is entirely equivalent to the following: SCKr[0] <= SCK; SCKr[1] <= SCKr[0]; SCKr[2] <= SCKr[1]; Curly braces are used for concatenation. -- Bob Elkind SIGNATURE: README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369 Summary: 1. Read the manual or user guide. Have you read the manual? Can you find the manual? 2. Search the forums (and search the web) for similar topics. 3. Do not post the same question on multiple forums. 4. Do not post a new topic or question on someone else's thread, start a new thread! 5. Students: Copying code is not the same as learning to design. 6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please). 7. You are not charged extra fees for comments in your code. 8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.View solution in original post |
|
|
|
SCKr
完全等同于以下内容: SCKr [0] SCKr [1] SCKr [2] 卷曲括号用于连接。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 SCKr <= {SCKr[1:0], SCK}; is entirely equivalent to the following: SCKr[0] <= SCK; SCKr[1] <= SCKr[0]; SCKr[2] <= SCKr[1]; Curly braces are used for concatenation. -- Bob Elkind SIGNATURE: README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369 Summary: 1. Read the manual or user guide. Have you read the manual? Can you find the manual? 2. Search the forums (and search the web) for similar topics. 3. Do not post the same question on multiple forums. 4. Do not post a new topic or question on someone else's thread, start a new thread! 5. Students: Copying code is not the same as learning to design. 6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please). 7. You are not charged extra fees for comments in your code. 8. I am not paid for forum posts. If I write a good post, then I have been good for nothing. |
|
|
|
我认为是时候花一些钱来制作一个好的Verilog文本了。
你的问题是基本的。 ----------------------------是的,我这样做是为了谋生。 以上来自于谷歌翻译 以下为原文 I think it's time you spent a few bucks on a good Verilog text. Your question is as basic as it gets. ----------------------------Yes, I do this for a living. |
|
|
|
eteam00写道:
SCKr 完全等同于以下内容: SCKr [0] SCKr [1] SCKr [2] 卷曲括号用于连接。 - 鲍勃埃尔金德 你好Bobs谢谢你的解释。 我在声明中看到了这一点 SCKr 作者只提到了SCKr的低2位 为什么不 SCKr 要么 SCKr 以上来自于谷歌翻译 以下为原文 eteam00 wrote:Hello Bobs thanks for the kind explanation. I see that in the statement SCKr <= {SCKr[1:0], SCK}; the author mentions only the lower 2 bits of SCKr why not SCKr <= {SCKr, SCK}; or SCKr <= {SCKr[2:0], SCK}; |
|
|
|
bassman59写道:
我认为是时候花一些钱来制作一个好的Verilog文本了。 你的问题是基本的。 我更新的真的是书,也许这就是为什么我问天真或愚蠢的问题。 如果给出人与书的选项,我会选择人。 不过我认为我需要改变这种观点如果你推荐一本好的Verilog书,那会很好吗? 以上来自于谷歌翻译 以下为原文 bassman59 wrote: I newer really was into books, maybe that's why I ask naive or stupid questions. If given an option of people vs books I would choose people. Nevertheless I think I need to change that point of view It would kind if you recommend a good Verilog book? |
|
|
|
你可以无限期地把书放在你的桌子上,他们从不会被问到天真或愚蠢的问题而感到厌倦。不像我们很多人,他们离线,或假装他们没有看到问题......
------------------------------------------“如果它不起作用 模拟,它不会在板上工作。“ 以上来自于谷歌翻译 以下为原文 You can keep books on your desk indefinitely, and they never get bored with being asked naive or stupid questions. Unlike a lot of us people, who go off-line, or pretend they didn't see the question... ------------------------------------------ "If it don't work in simulation, it won't work on the board." |
|
|
|
我在声明中看到了这一点
SCKr 作者只提到了SCKr的低2位 你错了。 在赋值的右侧,仅提到SCKr的两个低位。 但是在赋值的左侧,提到了SCKr的所有3位。 为什么不 SCKr 要么 SCKr 在这两个例子中,这将分配一个4位值(在右侧)到3位寄存器(在左侧)。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 I see that in the statement SCKr <= {SCKr[1:0], SCK}; the author mentions only the lower 2 bits of SCKr You are incorrect. On the right-hand side of the assignment, only the two lower bits of SCKr are mentioned. But on the left-hand side of the assignment, all 3 bits of SCKr are mentioned. why not SCKr <= {SCKr, SCK}; or SCKr <= {SCKr[2:0], SCK}; In both of these examples, this would be assigning a 4-bit value (on the right) to a 3-bit register (on the left). -- Bob Elkind SIGNATURE: README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369 Summary: 1. Read the manual or user guide. Have you read the manual? Can you find the manual? 2. Search the forums (and search the web) for similar topics. 3. Do not post the same question on multiple forums. 4. Do not post a new topic or question on someone else's thread, start a new thread! 5. Students: Copying code is not the same as learning to design. 6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please). 7. You are not charged extra fees for comments in your code. 8. I am not paid for forum posts. If I write a good post, then I have been good for nothing. |
|
|
|
rcingham写道:你可以无限期地把书放在你的桌子上,而且他们从不会被问到天真或愚蠢的问题而感到厌倦。不像我们很多人,他们离线,或假装他们没有看到问题......
那是一个很好的! 以上来自于谷歌翻译 以下为原文 rcingham wrote: That's a good one! |
|
|
|
eteam00写道:
你错了。 在赋值的右侧,仅提到SCKr的两个低位。 但是在赋值的左侧,提到了SCKr的所有3位。 - 鲍勃埃尔金德 SCKr 你好鲍勃,我想我终于明白,如果我错了,请帮助我。 那个陈述实际上就像左移一样? 所以SCKr的m***蒸发,新的l*** SCK进入位置0。 在微控制器中通常有一个ROL或ROR(向左或向右旋转)操作码,所以我猜这是类似的工作。 以上来自于谷歌翻译 以下为原文 eteam00 wrote: SCKr <= {SCKr[1:0], SCK}; Hello Bob, I think I finally understood it kindly correct me if I'm wrong. That statement actually acts like a left shift right? so the m*** of SCKr evaporates and a new l*** SCK comes in at position 0. In microcontrollers there is generally a ROL or ROR (rotate left or right) opcode, so I guess this does the similar job. |
|
|
|
SCKr
那个陈述实际上就像左移一样? 是。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 SCKr <= {SCKr[1:0], SCK}; That statement actually acts like a left shift right? Yes. -- Bob Elkind SIGNATURE: README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369 Summary: 1. Read the manual or user guide. Have you read the manual? Can you find the manual? 2. Search the forums (and search the web) for similar topics. 3. Do not post the same question on multiple forums. 4. Do not post a new topic or question on someone else's thread, start a new thread! 5. Students: Copying code is not the same as learning to design. 6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please). 7. You are not charged extra fees for comments in your code. 8. I am not paid for forum posts. If I write a good post, then I have been good for nothing. |
|
|
|
只有小组成员才能发言,加入小组>>
2360 浏览 7 评论
2780 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2247 浏览 9 评论
3324 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2413 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
729浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
524浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
336浏览 1评论
742浏览 0评论
1935浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-8 01:33 , Processed in 1.535748 second(s), Total 95, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号