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. byteena[1] controls the upper byte d[15:8], while byteena[0] controls the lower byte d[7:0].

resetn is a synchronous, active-low reset.

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

创建 16 D flip-flops。有时只修改一组触发器的一部分很有用。使能字节的输入控制是否应在该周期内写入 16 个寄存器中的每个字节。byteena[1] 控制上字节 d[15:8],而 byteena[0] 控制下字节 d[7: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
相关推荐
嵌入式软硬件攻城狮42 分钟前
2.FPGA板卡通过电脑映射连接上网
fpga开发·电脑
brave and determined2 小时前
可编程逻辑器件学习(day22):“让ARM穿上FPGA的马甲“:赛灵思Zynq的命名哲学与技术革命
arm开发·嵌入式硬件·fpga开发·zynq·fpga设计·嵌入式设计·fpga开发流程
FPGA_小田老师20 小时前
FPGA语法基础(二):SystemVerilog 数组清零方法详解
fpga开发·systemverilog·数组清零·systemverilog数组·systemverilog语法
jiushun_suanli21 小时前
FPGA(现场可编程门阵列)详解
经验分享·学习·fpga开发
Terasic友晶科技1 天前
1-串行通信基础知识
fpga开发·串口通信·异步通信·串行通信·同步通信·并行通信·单工
FPGA_小田老师1 天前
Xilinx Aurora 8B/10B IP核(2):Shared Logic的选择
fpga开发·aurora 8b/10b·share logic·aurora接口
嵌入式软硬件攻城狮1 天前
4.FPGA字符格式
fpga开发
Terasic友晶科技1 天前
2-基于FPGA开发板DE23-Lite的串口通信设计 (FT2232H)
fpga开发·串口·uart·de23-lite
第二层皮-合肥1 天前
FPGA工程师12实战项目-基于PCIe的高速ADC采集项目
fpga开发
第二层皮-合肥2 天前
USB3.0PHY介绍
fpga开发