HDLbits:Dff16e

Create 16 D flip-flops. It's sometimes useful to only modify parts of a group of flip-flops. The byte-enable inputs control whether each byte of the 16 registers should be written to on that cycle. byteena1 controls the upper byte d15:8, while byteena0 controls the lower byte d7:0.

resetn is a synchronous, active-low reset.

All DFFs should be triggered by the positive edge of clk.

创建 16 D flip-flops。有时只修改一组触发器的一部分很有用。使能字节的输入控制是否应在该周期内写入 16 个寄存器中的每个字节。byteena1 控制上字节 d15:8,而 byteena0 控制下字节 d7:0

cs 复制代码
module top_module (
    input clk,
    input resetn,
    input [1:0] byteena,
    input [15:0] d,
    output [15:0] q
);
    always@(posedge clk)
        begin
            if(~resetn)
                q <= 0;
            else if(byteena[0])     //从这里开始错误!!!
                q[7:0] <= d[7:0];  
            else if(byteena[1])
                q[15:8] <= d[15:8];  
        end
endmodule
相关推荐
Szime1 小时前
深智微40Gsps高速数据采集系统进入工程化阶段
科技·单片机·嵌入式硬件·fpga开发
2601_9618454218 小时前
2027考研数学大纲|数一数二数三
考研·fpga开发·ar·vr·mr·oneflow
X_xcccc21 小时前
2026年嵌入式智能核心,从异构计算到敏捷开发的硬核指南
fpga开发·敏捷流程·zynq-7000·fpga板卡定制
9527华安1 天前
FPGA实现GTX Transceivers Wizard传输2路视频,基于aurora 8b10b编解码架构,提供4套工程源码和技术支持
fpga开发·aurora·gtx·高速接口·高速收发器·transceivers
ALINX技术博客1 天前
【黑金云课堂】FPGA技术教程Linux开发:摄像头GPU渲染显示/Qt OpenGLES使用
linux·qt·fpga开发·gpu
S&Z34631 天前
SZ901下载器烧写国产Flash指南
fpga开发
liuluyang5301 天前
Verilog-1995风格,reg变量声明两次
fpga开发
cjie2211 天前
安路好用的调试工具VPI
fpga开发
chenlance2 天前
基于FPGA的激光器多通道数据采集与波形控制系统设计
fpga开发
9527华安2 天前
FPGA实现GTP高速收发器2路视频传输,基于aurora 8b10b编解码架构,提供4套工程源码和技术支持
图像处理·fpga开发·aurora·高速收发器·8b10b·derdes