六、FPGA设计之并转串设计
来源:互联网 发布:linux 查看文本命令 编辑:程序博客网 时间:2024/06/07 00:02
module p_to_s(clk,rst_n,din,dout);
input clk;
input rst_n;
input[7:0]din;
output dout;
reg[3:0]counter;
reg[7:0]buff;
reg dout;
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
counter<=4'd0;
else if(counter==8'd8)
counter<=4'd0;
else
counter<=counter+1;
always@(posedge clk or negedge rst_n)
begin
if(rst_n==1'b0)
buff<=8'd0;
else
begin
if(counter==4'd0)
buff<=din;
else
buff<=(buff<<1);
end
end
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
dout<=1'b0;
else
dout<=buff[7];
input clk;
input rst_n;
input[7:0]din;
output dout;
reg[3:0]counter;
reg[7:0]buff;
reg dout;
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
counter<=4'd0;
else if(counter==8'd8)
counter<=4'd0;
else
counter<=counter+1;
always@(posedge clk or negedge rst_n)
begin
if(rst_n==1'b0)
buff<=8'd0;
else
begin
if(counter==4'd0)
buff<=din;
else
buff<=(buff<<1);
end
end
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
dout<=1'b0;
else
dout<=buff[7];
endmodule
0 0
- 六、FPGA设计之并转串设计
- 五、FPGA设计之8比特串并转换设计
- FPGA之基于FPGA的SPARK多核处理器设计(六)
- 七、FPGA设计之RAM
- 八、FPGA设计之FIFO
- FPGA设计之时序约束
- FPGA设计之硬件篇(一)
- FPGA设计之硬件篇(二)
- FPGA开发之Tcl项目设计一
- FPGA之FIFO设计(一)
- FPGA之FIFO设计(二)
- 二、FPGA之模71计数器设计
- 三、FPGA之8位全加器设计
- FPGA设计之常用Verilog语法
- FPGA系统设计之设计前的思考
- 乱砍设计模式之六
- 【设计模式】之六Interpreter
- 设计模式之六原则
- 四十六、多态性:运算符重载为类的成员函数
- 黑马程序员——IOS基础---标识符、常量和变量(C语言)
- partition分区
- 【vb.net机房收费系统】之sqlhelper
- Spring MVC基础知识及实例
- 六、FPGA设计之并转串设计
- uva 11995 I Can Guess the Data Structure 数据结构
- suffix_array(后缀数组)
- Linux下jdk环境配置
- 搜狐博客登录js加密算法
- 提高第26课时,实践1,项目1-有序数组中插入数据(函数版)
- 常用查看Linux系统信息命令
- static_cast, dynamic_cast, reinterpret_cast, const_cast区别比较
- 第八周项目4-String类的构造