HDLbits——Exams/2014 q4b
题目要求
使用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原理图

HDLbits——Exams/2014 q4b的更多相关文章
- HDLBits答案——Circuits
1 Combinational Logic 1.1 Basic Gates 1.1.1 Exams/m2014 q4h module top_module ( input in, output out ...
- 2014 Super Training #3 H Tmutarakan Exams --容斥原理
原题: URAL 1091 http://acm.timus.ru/problem.aspx?space=1&num=1091 题意:要求找出K个不同的数字使他们有一个大于1的公约数,且所有 ...
- 看完SQL Server 2014 Q/A答疑集锦:想不升级都难!
看完SQL Server 2014 Q/A答疑集锦:想不升级都难! 转载自:http://mp.weixin.qq.com/s/5rZCgnMKmJqeC7hbe4CZ_g 本期嘉宾为微软技术中心技术 ...
- SQL Server 2014 新特性——内存数据库
SQL Server 2014 新特性——内存数据库 目录 SQL Server 2014 新特性——内存数据库 简介: 设计目的和原因: 专业名词 In-Memory OLTP不同之处 内存优化表 ...
- 2014年暑假c#学习笔记目录
2014年暑假c#学习笔记 一.C#编程基础 1. c#编程基础之枚举 2. c#编程基础之函数可变参数 3. c#编程基础之字符串基础 4. c#编程基础之字符串函数 5.c#编程基础之ref.ou ...
- SQL Server 2014聚集列存储索引
转发请注明引用和原文博客(http://www.cnblogs.com/wenBlog) 简介 之前已经写过两篇介绍列存储索引的文章,但是只有非聚集列存储索引,今天再来简单介绍一下聚集的列存储索引,也 ...
- Web 前端攻防(2014版)
在百度 FEX 团队时写的.有次让我写点前端开发中注意的安全规范,结果写着写着就跑题了,写了一堆纯前端实现的攻击方式...当然还有防范措施. 文章就懒得粘过来了~ 直接贴个地址算了:) http:// ...
- 谈谈我的微软特约稿:《SQL Server 2014 新特性:IO资源调控》
一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 撰写经历(Experience) 特约稿正文(Content-body) 第一部分:生活中资源 ...
- Windows 10 安装 Sql Server 2014 反复提示需要安装 .NET Framework 3.5 SP1 的解决方案
一.首先安装.NET Framework 3.5: 离线安装方式: 1.装载相对应的系统安装盘,我是Windows 10 x64 企业版,所以装载Windows 10 x64 企业版安装镜像ISO,盘 ...
- ERDAS 2014安装破解及汉化图文教程
关于ERDAS 2014 的安装破解及其汉化过程: 说明:汉化只是之针对英语能力不能正常满足使用软件的朋友们.如果英语过专八,完全没有必要汉化!在此之前查了好多关于ERDAS汉化的文档,可惜只是简单的 ...
随机推荐
- pnpm 中无法使用 patch-package 打补丁
原文:https://lwebapp.com/zh/post/pnpm-patch-package 介绍 前端开发过程中,经常会遇到第三方开源库有 BUG 的情况,通常我们有以下处理方式 自己 for ...
- 设计模式 > 单一职责原则
SOLID原则并非单纯的1个原则,而是由5个设计原则组成的,它们分别是单一职责原则,开闭原则,里氏替换原则,接口隔离原则和依赖反转原则. 单一职责原则(SRP) 定义:一个类或者模块只负责完成一个职责 ...
- 查询redis路径,清除redis缓存
查询redis路径 1.执行ps -ef | grep redis 命令,结果如下(记住PID) 2.执行ps -u 系统用户名,进一步确定进程id, 我这里的系统用户名是root,执行ps -u r ...
- Jest - Configuring Jest
Jest is a delightful JavaScript Testing Framework with a focus on simplicity. It works with projects ...
- Docker 对于容器的增删查命令
列出所有容器 ID 1 docker ps -aq 停止所有容器 1 docker stop $(docker ps -aq) 停止单个容器 1 docker stop 要停止的容器名 删除所有容器 ...
- Fiddler 抓包转成*.har文件在httprunner执行
1.Fiddler 抓包转成*.har 参考:https://blog.csdn.net/hou_angela/article/details/91837007 2.生成httprunner项目结构 ...
- 反射的学习笔记--sql语句生成
学生实体类 public class Student { public int Id { get; set; } public string Name { get; set; } public int ...
- 数位dp( tzoj6061:Bomb-求49个数;tzoj1427: 不要62)
6061:http://www.tzcoder.cn/acmhome/problemdetail.do?method=showdetail&id=6061 dfs记忆化搜索 #include& ...
- U盘启动安装 Centos 出错记录(Reached target Basic System)
背景 在实体机上使用U盘安装CentOS7.0操作系统,U盘刻成引导盘,BIOS调成U盘启动,选择Install CentOS 7,系统安装卡在Reached target Basic System界 ...
- es实现规格分组分析
es里面的规格是重复的,页面显示则是不重复