基于fpga数字电压表设计内容摘要:
1=39。 039。 then t:=t+1。 case t is when 1=cba=000。 dw1=1。 when 2=cba=001。 dw1=2。 when others=cba=000。 dw1=1。 end case。 end if。 end if。 end if。 end process。 end Behavioral。 15 显示; library IEEE。 use。 use。 use。 Unment the following lines to use the declarations that are provided for instantiating Xilinx primitive ponents. library UNISIM。 use。 entity lcd is generic(delay:integer:=100)。 类属说明 Port ( clk,reset:in std_logic。 dw1:in integer range 0 to 2。 v1,v2,v3,v4,v5:in integer range 0 to 9。 lcden:out std_logic。 接 LCD使能端 lcdda:out std_logic。 接 LCD_da信号输入端 lcdrw:out std_logic。 接 LCD读写信号输入端 lcddata:inout std_logic_vector(7 downto 0))。 接 LCD数据输入位 end lcd。 architecture Behavioral of lcd is signal clk_500hz:std_logic。 type state is (set_dlnf,clear_lcd,set_cursor,set_dcb,set_location,write_data)。 signal current_state:state。 type ram is array(0 to 9) of std_logic_vector(7 downto 0)。 signal dataram :ram。 signal x1,x2,xv1,xv2,xv3,xv4,xv5:std_logic_vector(7 downto 0)。 constant v:std_logic_vector(7 downto 0):=01010110。 F constant g:std_logic_vector(7 downto 0):=00101101。 横杠 constant k:std_logic_vector(7 downto 0):=00100000。 空格 constant d:std_logic_vector(7 downto 0):=00101110。 小数点 constantdw:std_logic_vector(7 downto 0):=01110110。 单位 v begin process(clk,reset,clk_500hz) variable t:integer range 0 to 5000。 1khz begin if reset=39。 039。 then t:=0。 clk_500hz=39。 039。 elsif clk39。 event and clk=39。 139。 then t:=t+1。 if t2500 then clk_500hz=39。 139。 16 elsif t5000 then clk_500hz=39。 039。 else t:=0。 clk_500hz=39。 039。 end if。 end if。 end process。 process(clk,dw1) begin if clk39。 event and clk=39。 139。 then case dw1 is when 1=x1=d。 x2=k。 1 档 when 2=x1=k。 x2=d。 10 档 when others=x1=00111111。 x2=00111111。 end case。 end if。 end process。 process(clk,v1,v2,v3,v4,v5) begin if clk39。 event and clk=39。 139。 then case v1 is when 0=xv1=00110000。 when 1=xv1=00110001。 when 2=xv1=00110010。 when 3=xv1=00110011。 when 4=xv1=00110100。 when 5=xv1=00110101。 when 6=xv1=00110110。 when 7=xv1=00110111。 when 8=xv1=00111000。 when 9=xv1=00111001。 when others=xv1=00111111。 end case。 case v2 is when 0=xv2=00110000。 when 1=xv2=00110001。 when 2=xv2=00110010。 when 3=xv2=00110011。 when 4=xv2=00110100。 when 5=xv2=00110101。 when 6=xv2=00110110。 when 7=xv2=00110111。 when 8=xv2=00111000。 17 when 9=xv2=00111001。 when others=xv2=00111111。 end case。 case v3 is when 0=xv3=00110000。 when 1=xv3=00110001。 when 2=xv3=00110010。 when 3=xv3=00110011。 when 4=xv3=00110100。 when 5=xv3=00110101。 when 6=xv3=00110110。 when 7=xv3=00110111。 when 8=xv3=00111000。 when 9=xv3=00111001。 when others=xv3=00111111。 end case。 case v4 is when 0=xv4=00110000。 when 1=xv4=00110001。 when 2=xv4=00110010。 when 3=xv4=00110011。 when 4=xv4=00110100。 when 5=xv4=00110101。 when 6=xv4=00110110。 when 7=xv4=00110111。 when 8=xv4=00111000。 when 9=xv4=00111001。 when others=xv4=00111111。 end case。 case v5 is when 0=xv5=00110000。 when 1=xv5=00110001。 when 2=xv5=00110010。 when 3=xv5=00110011。 when 4=xv5=00110100。 when 5=xv5=00110101。 when 6=xv5=00110110。 when 7=xv5=00110111。 when 8=xv5=00111000。 when 9=xv5=00111001。 when others=xv5=00111111。 18 end case。 end if。 end process。 process(clk,reset) begin if reset=39。 039。 then dataram=((00110000),(00110000),(00110000),(00110000), (00110000),(00110000),(00110000),(00110000), (00110000),(00110000))。 elsif rising_edge(clk)then dataram(0)=v。 dataram(1)=g。 dataram(2)=xv1。 dataram(3)=x1。 dataram(4)=xv2。 dataram(5)=x2。 dataram(6)=xv3。 dataram(7)=xv4。 dataram(8)=xv5。 dataram(9)=dw。 end if。 end process。 process(clk_500hz,reset,dataram) variable tt,t2:integer。 begin if reset=39。 039。 then current_state=set_dlnf。 tt:=0。 t2:=0。 elsif rising_edge(clk_500hz)then case current_state is when set_dlnf= lcden=39。 039。 lcdda=39。 039。 lcdrw=39。 039。 lcddata=00111100。 功能设置 tt:=tt+1。 if ttdelay and tt=delay*2 then lcden=39。 139。 else 19 lcden=39。 039。 end if。 if tt=delay*3 then current_state=clear_lcd。 tt:=0。 end if。 when clear_lcd= lcden=39。 039。 lcdda=39。 039。 lcdrw=39。 039。 lcddata=00000001。 清屏 tt:=tt+1。 if ttdelay and tt=delay*2 then lcden=39。 139。 else lcden=39。 039。 end if。 if tt=delay*3 then current_state=set_cursor。 tt:=0。 end if。 when set_cursor= lcden=39。 039。 lcdda=39。 039。 lcdrw=39。 039。 lcddata=00000110。 输。基于fpga数字电压表设计
相关推荐
对其编程。 第 3 页 西华大学 课程 设计说明书 2 智力抢答器设计方案 Verilog HDL 的设计流程 1)文本编辑:用任何文本编辑器都可以进行,也可以用专用的 HDL 编辑环境。 通常 Verilog HDL 文件保存 为 .v 文件。 2) 功能仿真:将文件调入 HDL 仿真软件进行功能仿真,检查逻辑功能是否正确(也叫前仿真,对简单的设计可以跳过这一步,只有在布线完成之后
器件通过硬件电路来实现所有的算法 ,提高 了 系统的可靠保密性。 FPGA 数 万 次的 重写 ,与 基于单片机的电子密码锁 相比, FPGA 构成系统设备 的可靠安全性得到提高 ,而且 更新 和升级 更加方便。 经过 设计 了解 FPGA 系统设计的 构想 ,并 学习 FPGA 设计 所用到的 软件 ,以及 Verilog 硬件语言的使用 ,掌握 电子密码 的设计步骤 ,增强 专业知识 ,
when 0111 =b:=0001110000010100。 when 1000 =b:=0001101000011110。 when 1001 =b:=0010100111110000。 when 1010 =b:=0010100000010000。 when 1011 =b:=0100100000010000。 when 1100 =b:=1000100000010000。 when
,所以能设计出一款方便安全操作的微波炉是非常有必要的。 南昌工程学院(本)毕业设计(论文) 3 第 二章 概述 VHDL简介 随着 VLSI、 EDA( Electronic Design Automation ) 工具的迅速发展,用户系统的设计从单纯的 ASIC( Application Specific Integrated Circuit) 设计向着系统单片化SOC( System On
大型设计,并对所做设计的逻辑电路进行严格的验证 [5]。 Verilog HDL 行为描述语言作为一种结构化和过程性的语言,其语法结构非常适合于算法级和 RTL级的模型设计。 这种行为描述语言具有以下功能: 1) 可描述顺序执行或并行执行的程序结构; 2) 用延迟表达式或事件表达式来明确地控制过程的启动时间; 3) 通过命名的事件来触发其它过程里的激活行为或停止行为; 4) 提供了条件如
可控制Flash 支持的输出格式,包括多版本的 HTML、压缩位图和新的 Quicktime。 FLASH 功能 Flash的编辑界面非常友好,并且提供非常详细和完整的教程,很多 基本的操作(比如画线、变形以及移动等)一看便会,而一些高级的技巧则可以通过附带的例子来学习。 只要细心,完全可以成为 Flash高手。 当然,这里所说的 “高手 ”只是初级水平的,想成为真正的高手,还要看创意和首发