题目要求

使用verilog描述如图所示得移位寄存器:

Write a top-level Verilog module (named top_module) for the shift register, assuming that n = 4. Instantiate four copies of your MUXDFF subcircuit in your top-level module. Assume that you are going to implement the circuit on the DE2 board.

Connect the R inputs to the SW switches,

  • clk to KEY[0],
  • E to KEY[1],
  • L to KEY[2], and
  • w to KEY[3].

    Connect the outputs to the red lights LEDR[3:0].

// Write a top-level Verilog module (named top_module) for the shift register, assuming that n = 4. Instantiate four copies of your MUXDFF subcircuit in your top-level module. Assume that you are going to implement the circuit on the DE2 board. // Connect the R inputs to the SW switches,
// clk to KEY[0],
// E to KEY[1],
// L to KEY[2], and
// w to KEY[3].
// Connect the outputs to the red lights LEDR[3:0]. module top_module (
input [3:0] SW,
input [3:0] KEY,
output [3:0] LEDR
); // MUXDFF ins3_MUXDFF(.clk(KEY[0]), .R(SW[3]),.E(KEY[1]),.L(KEY[2]),.w(KEY[3]), .Q(LEDR[3])); MUXDFF ins2_MUXDFF(.clk(KEY[0]),.R(SW[2]),.E(KEY[1]),.L(KEY[2]),.w(LEDR[3]),.Q(LEDR[2])); MUXDFF ins1_MUXDFF(.clk(KEY[0]),.R(SW[1]),.E(KEY[1]),.L(KEY[2]),.w(LEDR[2]),.Q(LEDR[1])); MUXDFF ins0_MUXDFF(.clk(KEY[0]),.R(SW[0]),.E(KEY[1]),.L(KEY[2]),.w(LEDR[1]),.Q(LEDR[0])); endmodule module MUXDFF (
input clk,
input w, R, E, L,
output reg Q
); wire D_i;
assign D_i = L?R:(E?w:Q);
always @(posedge clk) begin
Q <= D_i;
end endmodule

RTL原理图

最新文章

  1. SqlServer环境配置和卸载
  2. Git TortoiseGit SSH设置
  3. this面试题
  4. yum安装mysql后没有mysqld
  5. iOS 9.0中UIAlertController的用法
  6. iOS执行时工具-cycript
  7. pl/sql tutorial
  8. opencv 在工业中的应用:二维标定
  9. Chapter 1 First Sight——3
  10. Android代码资源的国际化
  11. Python之路-Linux命令基础(6)
  12. 使用EF连接Postgresql
  13. 知名渗透测试利器分享 - Appscan下载
  14. 基于Python玩转人工智能最火框架 TensorFlow应用实践
  15. 第一弹:超全Python学习资源整理(入门系列)
  16. PDF文档导出
  17. Android 设备,如何root,执行adb shell,查看设备中的数据库信息等【转】
  18. SSIS 学习之旅 数据同步
  19. dmesg命令的使用
  20. [失败]SystemTap和火焰图(Flame Graph)

热门文章

  1. Gameframework之微信小游戏
  2. 关于vscode 一些配置
  3. 快捷方法1:csdn如何不登录复制代码
  4. Ubuntu安装系统监视器system-monitor并显示在状态栏(火狐浏览器)
  5. Nginx njs模块注入js
  6. Unity3D中实现按资源名称自动化命名打包AssetBundle
  7. 学习lua-06,异常提示,错误处理
  8. VS+QT创建的项目 UI界面更新控件,代码里识别不到
  9. python 通过win32com操作vcf到outlook中,同时解决乱码问题
  10. JAVA查漏补缺 2