题目要求

使用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的更多相关文章

  1. HDLBits答案——Circuits

    1 Combinational Logic 1.1 Basic Gates 1.1.1 Exams/m2014 q4h module top_module ( input in, output out ...

  2. 2014 Super Training #3 H Tmutarakan Exams --容斥原理

    原题: URAL 1091  http://acm.timus.ru/problem.aspx?space=1&num=1091 题意:要求找出K个不同的数字使他们有一个大于1的公约数,且所有 ...

  3. 看完SQL Server 2014 Q/A答疑集锦:想不升级都难!

    看完SQL Server 2014 Q/A答疑集锦:想不升级都难! 转载自:http://mp.weixin.qq.com/s/5rZCgnMKmJqeC7hbe4CZ_g 本期嘉宾为微软技术中心技术 ...

  4. SQL Server 2014 新特性——内存数据库

    SQL Server 2014 新特性——内存数据库 目录 SQL Server 2014 新特性——内存数据库 简介: 设计目的和原因: 专业名词 In-Memory OLTP不同之处 内存优化表 ...

  5. 2014年暑假c#学习笔记目录

    2014年暑假c#学习笔记 一.C#编程基础 1. c#编程基础之枚举 2. c#编程基础之函数可变参数 3. c#编程基础之字符串基础 4. c#编程基础之字符串函数 5.c#编程基础之ref.ou ...

  6. SQL Server 2014聚集列存储索引

    转发请注明引用和原文博客(http://www.cnblogs.com/wenBlog) 简介 之前已经写过两篇介绍列存储索引的文章,但是只有非聚集列存储索引,今天再来简单介绍一下聚集的列存储索引,也 ...

  7. Web 前端攻防(2014版)

    在百度 FEX 团队时写的.有次让我写点前端开发中注意的安全规范,结果写着写着就跑题了,写了一堆纯前端实现的攻击方式...当然还有防范措施. 文章就懒得粘过来了~ 直接贴个地址算了:) http:// ...

  8. 谈谈我的微软特约稿:《SQL Server 2014 新特性:IO资源调控》

    一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 撰写经历(Experience) 特约稿正文(Content-body) 第一部分:生活中资源 ...

  9. Windows 10 安装 Sql Server 2014 反复提示需要安装 .NET Framework 3.5 SP1 的解决方案

    一.首先安装.NET Framework 3.5: 离线安装方式: 1.装载相对应的系统安装盘,我是Windows 10 x64 企业版,所以装载Windows 10 x64 企业版安装镜像ISO,盘 ...

  10. ERDAS 2014安装破解及汉化图文教程

    关于ERDAS 2014 的安装破解及其汉化过程: 说明:汉化只是之针对英语能力不能正常满足使用软件的朋友们.如果英语过专八,完全没有必要汉化!在此之前查了好多关于ERDAS汉化的文档,可惜只是简单的 ...

随机推荐

  1. postman连接mysql数据库

    转载:https://www.cnblogs.com/pengxiaojie/p/13495237.html 1.安装 2.启动服务 3.执行sql语句 安装: 想要postman连接mysql,需要 ...

  2. Spring oauth2 ,Spring security, Session,Cookie,token,SSO 是什么,解决什么问题,如何集成?

    背景假设就是一个多个域名web系统需要SSO单点登陆 什么Session? 2.什么是Token? 3.什么是Cookie? 4.Spring security? 5.Spring oauth2?

  3. Unity 使用IO流获取PNG/JPG/GIF/BMP的宽高【转】

    原文链接:https://blog.csdn.net/flj135792468/article/details/107963280?utm_medium=distribute.pc_relevant. ...

  4. JavaSE——==与.equal()方法

    ==号的作用 比较基本数据类型:比较的是具体的值 比较引用数据类型:比较的是对象地址值 package com.zhao.stringdemo; public class StringDemo2 { ...

  5. 8.class 类

    一.基础语法 class 类名 { } 二.类的属性 基础语法: class 类名 { 属性名: 数据类型 = 属性值; contructor(形参名: 数据类型) { this.属性名 = 属性值; ...

  6. nacos服务端和客户端版本不一致的时候,客户端无限刷日志

    解决方法: logging: level: com: alibaba: nacos: client: error

  7. Excel怎么把公式转成数值并复制

    直接选中复制,粘贴时选择选择性粘贴,选择数值确认

  8. jenkins构建触发器定时任务Build periodically和Poll SCM 后续研究

    https://www.cnblogs.com/caoj/p/7815820.html

  9. props其他-混入mixin-插件-elementui使用-localStorage系列-vueRouter-vuex

    目录 props其他-混入mixin-插件-elementui使用-localStorage系列-vueRouter-vuex 今日内容概要 今日内容详细 1 props其他 2 混入mixin 3 ...

  10. socket简记-消息格式

    1 原理 1.1 数据格式 Packet header + Application body + Packet Tail 本协议中数据字节序为Little endian(超过一个字节的数据类型在内存中 ...