[难题2] VHDL定义的信号/变量溢出了,FPGA会怎么处理 |
您所在的位置:网站首页 › fpga变量 › [难题2] VHDL定义的信号/变量溢出了,FPGA会怎么处理 |
Q/T/A/TC:Question/Thinks/Answer/Test Case Q:VHDL中,变量溢出fpga会怎么操作?? T:可以使用modesim仿真看看,或者在实际的fpga平台抓数据看 TC:test case1 tc1:使用modesim仿真integer类型变量,定义的时候规定integer取值范围,测试代码如下: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; library work; entity test is GENERIC( CIN: INTEGER:=80--1 ); port ( rst : in std_logic; clk_wramclk160Hz: in std_logic; catFreq : out integer ); end test; architecture arc_test of test is --constant define constant c_FreqGenrateNo:INTEGER range 0 to 128:= 40; signal s_wramaddr :integer range 1 to CIN:=1; begin process(rst,clk_wramclk160Hz) begin if(rst='1')then s_wramaddr =NumbersOfTc7050) then -- s_wramaddr |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |