DE2之7-segment displays
以前课题用的是友晶的DE2-70,现在重拾FPGA,选了一款性价比高的DE2。恰逢闲来无事,于是尝试将各个Verilog模块翻译成VHDL,半算回顾以前的知识,半算练习VHDL。
Verilog 01
module SEG7_LUT ( oSEG,iDIG );
input [:] iDIG;
output [:] oSEG;
reg [:] oSEG; always @(iDIG)
begin
case(iDIG)
'h1: oSEG = 7'b1111001; // ---t----
'h2: oSEG = 7'b0100100; // | |
'h3: oSEG = 7'b0110000; // lt rt
'h4: oSEG = 7'b0011001; // | |
'h5: oSEG = 7'b0010010; // ---m----
'h6: oSEG = 7'b0000010; // | |
'h7: oSEG = 7'b1111000; // lb rb
'h8: oSEG = 7'b0000000; // | |
'h9: oSEG = 7'b0011000; // ---b----
'ha: oSEG = 7'b0001000;
'hb: oSEG = 7'b0000011;
'hc: oSEG = 7'b1000110;
'hd: oSEG = 7'b0100001;
'he: oSEG = 7'b0000110;
'hf: oSEG = 7'b0001110;
'h0: oSEG = 7'b1000000;
endcase
end endmodule
VHDL 01
library IEEE;
use ieee.std_logic_1164.all; 4 --! 7-segment displays
entity SEG7_LUT is
port
(
iDIG : in std_logic_vector( downto );
oSEG : out std_logic_vector ( downto )
);
end SEG7_LUT; architecture fpga of SEG7_LUT is begin pseg: process(iDIG)
begin
case iDIG is
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= "";
when "" =>
oSEG <= ""; end case; end process; end fpga;
Verilog 02
module SEG7_LUT_8 (oSEG0,oSEG1,oSEG2,oSEG3,oSEG4,oSEG5,oSEG6,oSEG7,iDIG );
input [:] iDIG;
output [:] oSEG0,oSEG1,oSEG2,oSEG3,oSEG4,oSEG5,oSEG6,oSEG7; SEG7_LUT u0 ( oSEG0,iDIG[:] );
SEG7_LUT u1 ( oSEG1,iDIG[:] );
SEG7_LUT u2 ( oSEG2,iDIG[:] );
SEG7_LUT u3 ( oSEG3,iDIG[:] );
SEG7_LUT u4 ( oSEG4,iDIG[:] );
SEG7_LUT u5 ( oSEG5,iDIG[:] );
SEG7_LUT u6 ( oSEG6,iDIG[:] );
SEG7_LUT u7 ( oSEG7,iDIG[:] ); endmodule
VHDL 02
library IEEE;
use ieee.std_logic_1164.all; 4 --! oSEG0 ~ oSEG7
entity SEG7_LUT_8 is
port
(
iDIG : in std_logic_vector( downto );
oSEG0 : out std_logic_vector ( downto );
oSEG1 : out std_logic_vector ( downto );
oSEG2 : out std_logic_vector ( downto );
oSEG3 : out std_logic_vector ( downto );
oSEG4 : out std_logic_vector ( downto );
oSEG5 : out std_logic_vector ( downto );
oSEG6 : out std_logic_vector ( downto );
oSEG7 : out std_logic_vector ( downto )
);
end SEG7_LUT_8; --! architecture
architecture fpga of SEG7_LUT_8 is begin U0 : entity SEG7_LUT port map(oSEG => oSEG0,iDIG => iDIG( downto ));
U1 : entity SEG7_LUT port map(oSEG => oSEG1,iDIG => iDIG( downto ));
U2 : entity SEG7_LUT port map(oSEG => oSEG2,iDIG => iDIG( downto ));
U3 : entity SEG7_LUT port map(oSEG => oSEG3,iDIG => iDIG( downto ));
U4 : entity SEG7_LUT port map(oSEG => oSEG4,iDIG => iDIG( downto ));
U5 : entity SEG7_LUT port map(oSEG => oSEG5,iDIG => iDIG( downto ));
U6 : entity SEG7_LUT port map(oSEG => oSEG6,iDIG => iDIG( downto ));
U7 : entity SEG7_LUT port map(oSEG => oSEG7,iDIG => iDIG( downto )); end fpga;
DE2之7-segment displays的更多相关文章
- (2017浙江省赛E)Seven Segment Display
Seven Segment Display Time Limit: 2 Seconds Memory Limit: 65536 KB A seven segment display, or ...
- 2017浙江省赛 E - Seven Segment Display ZOJ - 3962
地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3962 题目: A seven segment display, or ...
- ZOJ 3962 Seven Segment Display 16进制的八位数加n。求加的过程中所有的花费。显示[0,F]有相应花费。
Seven Segment Display Time Limit: Seconds Memory Limit: KB A seven segment display, or seven segment ...
- ZOJ 3962 E.Seven Segment Display / The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple E.数位dp
Seven Segment Display Time Limit: 1 Second Memory Limit: 65536 KB A seven segment display, or s ...
- [转]oracle EBS 基础100问
from:http://www.cnblogs.com/xiaoL/p/3593691.html http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...
- zoj3954 详细讲解 排序比较单词法
Seven-Segment Display Time Limit: 1 Second Memory Limit:65536 KB A seven segment display, or se ...
- [笔记]学习EBS建议有的知识
http://f.dataguru.cn/thread-51057-1-1.html ORACLE EBS学习的其他资源有哪四个? ORACLE OPEN WORLD大会是不是一个市场营销活动? Or ...
- kafka的log存储解析——topic的分区partition分段segment以及索引等
转自:http://blog.csdn.net/jewes/article/details/42970799 引言 Kafka中的Message是以topic为基本单位组织的,不同的topic之间是相 ...
- ORA-10635: Invalid segment or tablespace type
上周星期天在迁移数据时,碰到了ORA-10635: Invalid segment or tablespace type 错误,当时的操作环境如下: 操作系统版本: [oracle@xxxxx scr ...
随机推荐
- Pyhon信息采集 - 喜马拉雅专辑歌曲
目录 Pyhon信息采集 - 喜马拉雅专辑歌曲 Pyhon信息采集 - 喜马拉雅专辑歌曲 setting.py # 喜马拉雅URL XMLY_URL = "https://www.ximal ...
- hdu 5171 GTY's birthday gift
GTY's birthday gift 问题描述 GTY的朋友ZZF的生日要来了,GTY问他的基友送什么礼物比较好,他的一个基友说送一个可重集吧!于是GTY找到了一个可重集S,GTY能使用神犇魔法k次 ...
- springcloud(七): 使用Feign调用Eureka Server客户端服务
当我们通过RestTemplate调用其它服务的API时,所需要的参数须在请求的URL中进行拼接,如果参数少的话或许我们还可以忍受,一旦有多个参数的话,这时拼接请求字符串就会效率低下,并且显得好傻. ...
- 个人学习记录--取表中Name相同的最大值,非Group By,可延伸
), qy ), je INT); INSERT INTO @t SELECT '产品一', '北京', UNION ALL SELECT '产品一', '上海', UNION ALL SELECT ...
- 【codeforces 767A】Snacktower
[题目链接]:http://codeforces.com/contest/767/problem/A [题意] 每天掉一个盘子下来;盘子有大小从1..n依次增大n个盘子; 然后让你叠盘子; 最底层为n ...
- Maven学习总结(28)——Maven+Nexus+Myeclipse集成
Maven简介 Maven 是一个基于项目对象模型(POM)的,提倡约定优于配置(ConventionOver Configuration)的,跨平台的项目管理和构建自动化工具. 首先它是一个优秀的构 ...
- [luoguP1993] 小 K 的农场(差分约束 + spfa 判断负环)
传送门 差分约束系统..找负环用spfa就行 ——代码 #include <cstdio> #include <cstring> #include <iostream&g ...
- [POJ1456]Supermarket(贪心 + 优先队列 || 并查集)
传送门 1.贪心 + 优先队列 按照时间排序从前往后 很简单不多说 ——代码 #include <queue> #include <cstdio> #include <i ...
- c++ 双冒号的作用
转:原文:http://www.cnblogs.com/charley_yang/archive/2011/02/24/1964217.html #define FLY 10 #line 100 &q ...
- apache zookeeper的安装
original article:http://zookeeper.praveendeshmane.co.in/zookeeper/zookeeper-3-4-6-single-server-setu ...