以前课题用的是友晶的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的更多相关文章

  1. (2017浙江省赛E)Seven Segment Display

    Seven Segment Display Time Limit: 2 Seconds      Memory Limit: 65536 KB A seven segment display, or ...

  2. 2017浙江省赛 E - Seven Segment Display ZOJ - 3962

    地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3962 题目: A seven segment display, or ...

  3. 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 ...

  4. 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 ...

  5. [转]oracle EBS 基础100问

    from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...

  6. zoj3954 详细讲解 排序比较单词法

    Seven-Segment Display Time Limit: 1 Second      Memory Limit:65536 KB A seven segment display, or se ...

  7. [笔记]学习EBS建议有的知识

    http://f.dataguru.cn/thread-51057-1-1.html ORACLE EBS学习的其他资源有哪四个? ORACLE OPEN WORLD大会是不是一个市场营销活动? Or ...

  8. kafka的log存储解析——topic的分区partition分段segment以及索引等

    转自:http://blog.csdn.net/jewes/article/details/42970799 引言 Kafka中的Message是以topic为基本单位组织的,不同的topic之间是相 ...

  9. ORA-10635: Invalid segment or tablespace type

    上周星期天在迁移数据时,碰到了ORA-10635: Invalid segment or tablespace type 错误,当时的操作环境如下: 操作系统版本: [oracle@xxxxx scr ...

随机推荐

  1. 大专生自学Python到找到工作的心得

    先做个自我介绍,我13年考上一所很烂专科民办的学校,学的是生物专业,具体的学校名称我就不说出来献丑了.13年我就辍学了,我在那样的学校,一年学费要1万多,但是根本没有人学习,我实在看不到希望,我就退学 ...

  2. 【Codeforces 478C】Table Decorations

    [链接] 我是链接,点我呀:) [题意] 给你r,g,b三种颜色的气球 每张桌子要放3个气球 但是3个气球的颜色不能全都一样 (允许两个一样,或者全都不一样) 问你最多能装饰多少张桌子 [题解] 先把 ...

  3. JavaWeb+MySql分页封装

    前段时间因为需要所以写一个JavaWeb+MySql的分页封装类,附上代码.技术有限写得不好请多多指教. 1.首先贴上Eneity类 package com.zx.pageUtil; import j ...

  4. systemtap dtrace与 oracle

    https://fritshoogland.wordpress.com/page/3/ http://externaltable.blogspot.com/2013/06/dtrace-explora ...

  5. iOS: 导航栏显示默认后退按钮

    要显示系统默认的后退按钮(非自定义)的语句如下: [[self navigationController] setNavigationBarHidden:NO animated:YES];self.n ...

  6. maven install:install出现的错误提示

    maven install:install出现的错误提示 [INFO] --- maven-install-plugin:2.4:install (default-cli) @ maven028 -- ...

  7. gradle配置国内的镜像

    gradle配置国内的镜像 学习了:http://blog.csdn.net/stdupanda/article/details/72724181 http://blog.csdn.net/lj402 ...

  8. 2014.8.12-AKKA和Actor model 分布式开发环境学习小结

    学习使用AKKA 断断续续有一年了. 眼下还是习惯用java来写akka以下的程序.对于原生的scala还是没有时间和兴趣去学习它. 毕竟学习一门语言须要兴趣和时间的. AKKA学习资源还是不算丰富. ...

  9. 学习笔记—— 一些UPDATE语句

    UPDATE语句原来还有许多种写法,有的还很复杂,孤陋寡闻的我甚至闻所未闻.幸甚至哉,记而志之. 0.UPDATE 表名 SET 字段... FROM ...的方式 USE AdventureWork ...

  10. [RK3288][Android6.0] 调试笔记 --- 系统第一次开机进入Recovery模式原因【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/53464461 latform: ROCKCHIPOS: Android 6.0Kernel: ...