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汉化的文档,可惜只是简单的 ...
随机推荐
- 2.4 在DispatcherServlet的service方法中,通过ServletPath获取对应的Controller对象
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws Se ...
- Appium元素选择 滑动 通知栏
一.根据ID 包名可省略 1.元素的resource id属性 2.唯一标志该元素的值 3.一般最优先根据它来定位 driver.find_element_by_id('io.manong.deve ...
- Win10中找回曾复制过的东西
按Win+V,如果弹出的"剪贴板历史"设置已经打开,那么就可以找回.建议大家打开这项设置以防万一.
- VUE学习-条件渲染
条件渲染 v-if & v-else-if & v-else <div id="app"> <h1 v-if="type == 'VUE ...
- disabled属性的简介和使用
一.disabled属性的简介和使用 Html中的input元素.button元素.option元素等都具有一个disabled属性. disabled对a标签不起作用当赋予该属性时该元素将变得不可交 ...
- oracle通过计划任务备份表
1.先手动创建表 create table user01_backup_20210204 select * from user01 commit; 2.清空表 truncate table user0 ...
- 安全测试-WEB安全渗透测试基础知识(三)
1.3. 域名系统 1.3.1. 域名系统工作原理 DNS解析过程是递归查询的,具体过程如下: 用户要访问域名www.example.com时,先查看本机hosts是否有记录或者本机是否有DNS缓存, ...
- Tech&W_STU_Resource_bookmark
整合资料 1 architecture: Enterprise integration patterns : https://www.enterpriseintegrationpatterns.com ...
- java传递参数调用python完成剪切多个视频最终拼接成一个
需求如题,综合考虑之后我选择python去做视频处理,最终结果也让我非常满意. 我是windows 环境,安装的python3.8和moviepy模块 第一步:安装python3.8 第二步:修改py ...
- C# 读取电脑CPU、主板、硬盘序列号等信息
ManagementObjectSearcher 解析不到头文件,需要手动 Add Referance 需要添加引用:System.Management,然后引入命名空间:using System.M ...