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
相关推荐
tju新生代魔迷2 小时前
Verilog HDL 学习笔记(十八)| 附录C:关键字、系统任务和编译指令
fpga开发
free-elcmacom5 小时前
FPGA学习笔记<1>FPGA的开发流程
fpga开发·硬件工程·hdl
明德扬6 小时前
AD9653单通道波形怎么看?幅度、频率与基础测量入门
学习·fpga开发·fpga
ERROR:997 小时前
GPT Images 2.5将手稿转时序图效果不佳
fpga开发
尤老师FPGA7 小时前
声学相机介绍
fpga开发
科恒盛远14 小时前
ZU902 FMC194 可编程宽带信号源实测
fpga开发·硬件工程·信号处理
大盛供应链·卢生17 小时前
哪些国产芯片可以替代进口芯片,哪些替代不了
fpga开发·容器
ALINX技术博客1 天前
跨越 1819 公里,ALINX 携 AI 异构平台、电子后视镜及 HIL 仿真方案亮相深圳国际电子展
ai·fpga开发·汽车
Enclustra_China1 天前
FMC为何成为FPGA生态的“万能扩展接口”?
fpga开发·fpga解决方案
tju新生代魔迷1 天前
Verilog HDL 学习笔记(十七)| 附录B:PLI子程序清单
fpga开发