[HDLBits] Mt2015 lfsr

Taken from 2015 midterm question 5. See also the first part of this question: mt2015_muxdff

Write the Verilog code for this sequential circuit (Submodules are ok, but the top-level must be named top_module). Assume that you are going to implement the circuit on the DE1-SoC board. Connect the R inputs to the SW switches, connect Clock to KEY0, and L to KEY1. Connect the Q outputs to the red lights LEDR.

复制代码
module top_module (
	input [2:0] SW,      // R
	input [1:0] KEY,     // L and clk
	output [2:0] LEDR);  // Q
	wire result;
    parts part1(KEY[0],KEY[1],SW[0],LEDR[2],LEDR[0]);
    parts part2(KEY[0],KEY[1],SW[1],LEDR[0],LEDR[1]);
    assign result=LEDR[2]^LEDR[1];
    parts part3(KEY[0],KEY[1],SW[2],result,LEDR[2]);
endmodule
        
        
module parts(
	input clk,
	input l,
	input r,
    input q1,
    output Q);
    wire d;
    assign d=l?r:q1;
    always@(posedge clk) begin
        Q<=d;
    end
endmodule
相关推荐
幻智星科技10 小时前
树形架构破解FPGA扇出瓶颈
fpga开发·硬件架构
FPGA小迷弟13 小时前
FPGA开发Vivado Block Design/Vitis/SDK/xlinx/开发教程,保姆级别,一看就会!
网络协议·tcp/ip·fpga开发·verilog·fpga
FPGA小迷弟13 小时前
基于FPGA实现智能网卡的概念,什么是智能网卡
网络协议·tcp/ip·fpga开发·verilog·fpga
好焊孙辉15 小时前
螺柱焊机哪家质量好
python·fpga开发
XMAIPC_Robot20 小时前
基于 i.MX95 平台在新一代工业控制器中的应用 — 工业车载平板、半导体设备主控方案解析
arm开发·人工智能·机器学习·fpga开发·rk3588+fpga·i.mx95
szxinmai主板定制专家21 小时前
基于 AM62x + Artix-7 的低功耗 ARM+FPGA 平台在轨道交通车门控制中的应用
arm开发·人工智能·fpga开发·zynq·am62x
幻智星科技21 小时前
我砍掉了FPGA里的ARM核项目反而提前交付了
arm开发·网络协议·fpga开发·硬件架构
逐光者93321 小时前
Verilog 三段式状态机:原理、模板与实战
fpga开发
XMAIPC_Robot21 小时前
NXP i.MX95 + FPGA 异构计算平台 — 工业多域融合 AI 加速嵌入式控制解决方案
人工智能·分布式·fpga开发·能源·rk3576+fpga
hi冻鱼1 天前
PCIe + DDR架构(一):实测——块长从4 KiB 换 1 MiB,带宽从133 MB/s 涨到 3179 MB/s
性能测试·fpga·pcie·mig·xdma·1024程序员节·ddr3