并串转换设计源程序

并串转换设计源程序

ID:13913102

大小:406.50 KB

页数:4页

时间:2018-07-24

并串转换设计源程序_第1页
并串转换设计源程序_第2页
并串转换设计源程序_第3页
并串转换设计源程序_第4页
资源描述:

《并串转换设计源程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、1、常用经典电路设计——S2P输入串行数据流信息://************************//description//S2P//************************Modules2p(rst_n,clk,sdata_in,pdata_out);Inputrst_n,clk;Inputsdata_in;Outputreg[7:0]pdata_out;reg[2:0]count;always@(posedgeclkornegedgerst_n)beginif(~rst_n)count<=3’h00;elsecount<=cou

2、nt+1’b1;endregdiv8_clk;always@(posedgeclkornegedgerst_n)beginif(~rst_n)div8_clk<=1’h0;elseif(count==3’h3)div8_clk<=1’b1;elseif(count==3’h7)div8_clk<=1’b0;end//assigndiv8_clk=(count==3’h4)

3、(count==3’h5)

4、(count==3’h6)

5、(count==3’h7);//assigndiv8_clk=~(count==3’h0)

6、(count==3’h1)

7、(

8、count==3’h2)

9、(count==3’h3);//assigndiv8_clk=count[2];reg[7:0]shift_data;always@(posedgeclkornegedgerst_n)beginif(~rst_n)shift_data<=8’h00;elseshift_data<={shift_data[6:0],sdata_in};endalways@(posedgeclkornegedgerst_n)beginif(~rst_n)pdata_out<=8’h00;elseif(count==3’h0)pdata_out

10、<=shift_data;endEndmodule1、常用经典电路设计——P2S//************************//description//P2S//************************//************************//description//P2S//************************Modulep2s(rst_n,clk,div8_clk,pdata_in,sdata_out);Inputrst_n,clk,div8_clk;Input[7:0]pdata_in;Outpu

11、tsdata_out;reg[2:0]count;always@(posedgeclkornegedgerst_n)beginif(~rst_n)count<=3’h00;elsecount<=count+1’b1;endregdiv8_clk;always@(posedgeclkornegedgerst_n)beginif(~rst_n)div8_clk<=1’h0;elseif(count==3’h3)div8_clk<=1’b1;elseif(count==3’h7)div8_clk<=1’b0;end//assigndiv8_clk=(co

12、unt==3’h4)

13、(count==3’h5)

14、(count==3’h6)

15、(count==3’h7);//assigndiv8_clk=~(count==3’h0)

16、(count==3’h1)

17、(count==3’h2)

18、(count==3’h3);//assigndiv8_clk=count[2];reg[7:0]shift_data;always@(posedgeclkornegedgerst_n)beginif(~rst_n)pdata_out<=8’h00;elseif(count==3’h0)pdata_out<=pdata_in;e

19、lsepdata_out<={pdata_out[6:0],1’b0};endassignsdata_out=shift_data[7];Endmodule

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。