第一范文网 - 专业文章范例文档资料分享平台

基于FPGA的数字电压表设计

来源:用户分享 时间:2025/6/3 15:44:50 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

end if;

end case;

end if;

end process; end Behavioral;

adc0809: library IEEE;

use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

-- Uncomment the following lines to use the declarations that are -- provided for instantiating Xilinx primitive components. --library UNISIM;

--use UNISIM.VComponents.all;

entity ad0809 is

Port ( clk,reset:in std_logic; eoc:in std_logic;

D:in std_logic_vector(7 downto 0); ale,start,oe,clk500k:out std_logic; xs:out std_logic_vector(8 downto 0);

Q:out std_logic_vector(7 downto 0));

end ad0809;

architecture Behavioral of ad0809 is

type state is (st0,st1,st2,st3,st4,st5,st6); signal x:std_logic_vector(8 downto 0); signal current_state,next_state: state ; signal clk500,lock:std_logic;

signal regl:std_logic_vector(7 downto 0); begin

process(clk,reset,clk500) variable count2: integer; variable clk0: std_logic; begin if reset='0' then count2:=0; clk0:='0'; elsif clk'event and clk='1' then count2:=count2+1;

if count2=50 then

21

clk0:='1';

elsif count2=100 then count2:=0;clk0:='0';

end if;

end if;

clk500<=clk0; clk500k<=clk0; end process;

process(current_state,eoc) begin

case current_state is

when st0 =>ale<='0';start<='0';oe<='0';lock<='0';x<=\ next_state<=st1;

when st1 =>ale<='1';start<='0';oe<='0';lock<='0';x<=\ next_state<=st2;

when st2 =>ale<='0';start<='1';oe<='0';lock<='0';x<=\ next_state<=st3;

when st3 =>ale<='0';start<='0';oe<='0';lock<='0';x<=\ if eoc='1' then next_state<=st3; else next_state<=st4;

end if;

when st4 =>ale<='0';start<='0';oe<='0';lock<='0';x<=\

if eoc='0' then next_state<=st4; else next_state<=st5;

end if;

when st5 =>ale<='0';start<='0';oe<='1';lock<='0';x<=\ next_state<=st6;

when st6 =>ale<='0';start<='0';oe<='1';lock<='1';x<=\ next_state<=st0;

when others =>ale<='0';start<='0';oe<='0';lock<='0';x<=\ next_state<=st0; end case; end process ;

process(clk500) begin

if rising_edge(clk500) then current_state<=next_state; end if; end process;

process(lock,x) begin

22

if lock'event and lock='1'then regl<=D; end if; end process; Q<=regl; xs<=x; end Behavioral;

ym_translate;

-- Xilinx Vhdl produced by program ngd2vhdl F.28

-- Command: -quiet -rpw 100 -tpw 0 -ar Structure -xon true -w -log __projnav/ngd2vhdl.log ym.ngd ym_translate.vhd -- Input file: ym.ngd

-- Output file: ym_translate.vhd -- Design name: ym -- Xilinx: E:/ISE5.2 -- # of Entities: 1 -- Device: 2s100epq208-6

-- The output of ngd2vhdl is a simulation model. This file cannot be synthesized, -- or used in any other manner other than simulation. This netlist uses simulation -- primitives which may not represent the true implementation of the device, however -- the netlist is functionally correct. Do not modify this file.

-- Model for ROC (Reset-On-Configuration) Cell library IEEE;

use IEEE.std_logic_1164.all; use IEEE.VITAL_Timing.all; entity ROC is

generic (InstancePath: STRING := \ WIDTH : Time := 100 ns); port(O : out std_ulogic := '1') ;

attribute VITAL_LEVEL0 of ROC : entity is TRUE; end ROC;

architecture ROC_V of ROC is

attribute VITAL_LEVEL0 of ROC_V : architecture is TRUE; begin

ONE_SHOT : process begin

if (WIDTH <= 0 ns) then assert FALSE report

\ severity failure; else

23

wait for WIDTH; O <= '0'; end if; wait;

end process ONE_SHOT; end ROC_V;

-- Model for TOC (Tristate-On-Configuration) Cell library IEEE;

use IEEE.std_logic_1164.all; use IEEE.VITAL_Timing.all; entity TOC is

generic (InstancePath: STRING := \ WIDTH : Time := 0 ns); port(O : out std_ulogic := '0');

attribute VITAL_LEVEL0 of TOC : entity is TRUE; end TOC;

architecture TOC_V of TOC is

attribute VITAL_LEVEL0 of TOC_V : architecture is TRUE; begin

ONE_SHOT : process begin O <= '1';

if (WIDTH <= 0 ns) then O <= '0'; else

wait for WIDTH; O <= '0'; end if; wait;

end process ONE_SHOT; end TOC_V;

library IEEE;

use IEEE.STD_LOGIC_1164.ALL; library SIMPRIM;

use SIMPRIM.VCOMPONENTS.ALL; use SIMPRIM.VPACKAGE.ALL; entity ym is port (

clk : in STD_LOGIC := 'X'; reset : in STD_LOGIC := 'X';

q : in STD_LOGIC_VECTOR ( 7 downto 0 );

24

搜索更多关于: 基于FPGA的数字电压表设计 的文档
基于FPGA的数字电压表设计.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c68r2f2b6gb6tzp833x78_6.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top