[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
相关推荐
forgeda16 小时前
从Vivado集成Lint功能,看FPGA设计的日益ASIC化趋势
fpga开发·vivado·lint·eco·静态检查功能
hexiaoyan8271 天前
国产化FPGA开发板:2050-基于JFMK50T4(XC7A50T)的核心板
fpga开发·工业图像输出·vc709e板卡·zynq 通用计算平台·模拟型号处理
m0_575046341 天前
FPGA数据流分析
数据分析·fpga·数据流分析
雨洛lhw1 天前
The Xilinx 7 series FPGAs 设计PCB 该选择绑定哪个bank引脚,约束引脚时如何定义引脚电平标准?
fpga开发·bank·电平标准
红糖果仁沙琪玛1 天前
FPGA ad9248驱动
fpga开发
forgeda1 天前
半年报中的FPGA江湖:你打你的,我打我的
fpga·行业现状·竞争格局
minglie11 天前
XSCT/Vitis 裸机 JTAG 调试与常用命令
fpga开发
沐欣工作室_lvyiyi1 天前
基于FPGA的电梯控制系统设计(论文+源码)
单片机·fpga开发·毕业设计·计算机毕业设计·电子交易系统
阿sir1982 天前
ZYNQ PS XADC读取芯片内部温度值,电压值。
fpga开发
@晓凡2 天前
NIOS ii工程移植路径问题
fpga开发·nios ii