[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 KEY[0], and L to KEY[1]. 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
相关推荐
liuluyang5306 小时前
SV主要关键词详解
fpga开发·uvm·sv
happyDogg_9 小时前
验证环境采样rtl时序数据遇到的问题
fpga开发
unicrom_深圳市由你创科技11 小时前
项目分析和FPGA器件选型外包服务包括哪些内容?别让选错芯片毁了整个项目
fpga开发
Aaron158811 小时前
27DR/47DR/67DR技术对比及应用分析
人工智能·算法·fpga开发·硬件架构·硬件工程·信息与通信·基带工程
my_daling12 小时前
DSMC通信协议理解,以及如何在FPGA上实现DSMC从设备(2)
学习·fpga开发
珞光电子USRP SDR软件无线电平台1 天前
打破通用瓶颈:珞光电子发布 Luowave Driver V2 定制化驱动方案
fpga开发
9527华安1 天前
FPGA实现PCIe数据通信培训课程,提供工程源码+视频教程+FPGA开发板
fpga开发·pcie·视频教程·培训
my_daling1 天前
FPGA实现IIC主机读写,以及部分IIC传感器控制流程
fpga开发
乌恩大侠1 天前
【AI-RAN】在空ubuntu服务器安装环境和生成TV,高达430G文件
服务器·人工智能·ubuntu·fpga开发·o-ru
qq_150841991 天前
高云FPGA固件下载速成
fpga开发