參數(shù)資料
型號: CY3120R62
英文描述: Programmable Logic
中文描述: 可編程邏輯
文件頁數(shù): 3/8頁
文件大小: 67K
代理商: CY3120R62
CY3120
Document #: 38-03049 Rev. *C
Page 3 of 8
in VHDL often includes well known constructs such as
If...Then...Else, and Case statements. Here is a code
segment from a simple state machine design (soda
vending machine) that uses behavioral VHDL to implement
the design:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY drink IS
PORT (nickel,dime,quarter,clock:#in
std_logic;
returnDime,returnNickel,giveDrink:out
std_logic);
END drink;
ARCHITECTURE fsm OF drink IS
TYPE drinkState IS (zero,five,ten,fifteen,
twenty,twentyfive,owedime);
SIGNAL drinkstatus:drinkState;
BEGIN
PROCESS BEGIN
WAIT UNTIL clock = ’1’;
giveDrink <= ’0’;
returnDime <= ’0’;
returnNickel <= ’0’;
CASE drinkStatus IS
WHEN zero =>
IF (nickel = ’1’) THEN
drinkStatus <= five;
ELSIF (dime = ’1’) THEN
drinkStatus <= Ten;
ELSIF (quarter = ’1’) THEN
drinkStatus <= twentyfive;
END IF;
WHEN five =>
IF (nickel = ’1’) THEN
drinkStatus <= ten;
ELSIF (dime = ’1’) THEN
drinkStatus <= fifteen;
ELSIF (quarter = ’1’) THEN
giveDrink <= ’1’;
drinkStatus <= zero
END IF;
-- Several states are omitted in this
-- example. The omitted states are ten,
-- fifteen, twenty, and twentyfive.
WHEN owedime =>
returnDime <= ’1’;
drinkStatus <= zero;
when others =>
-- This makes sure that the state
-- machine resets itself if
-- it somehow gets into an undefined state.
drinkStatus <= zero;
END CASE;
END PROCESS;
END FSM;
VHDL is a strongly typed language. It comes with several
predefined operators, such as + and /= (add, not-equal-to).
VHDL offers the capability of defining multiple meanings for
operators (such as +), which results in simplification of the
code written. For example, the following code segment shows
that “count <= count +1” can be written such that count is a
std_logic_vector, and 1 is an integer.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE work.std_arith.all;
ENTITY sequence IS
port (clk: in std_logic;
s : inout std_logic);
end sequence;
ARCHITECTURE fsm OF sequence IS
SIGNAL count: std_logic_vector(3 downto 0);
BEGIN
PROCESS BEGIN
WAIT UNTIL clk = ’1’;
CASE count IS
WHEN x“0” | x“1” | x“2” | x“3” =>
s <= ’1’;
count <= count + 1;
WHEN x“4” | x“5” | x“6” | x“7” =>
s <= ’0’;
count <= count + 1;
WHEN x“8” | x“9” =>
s <= ’1’;
count <= count + 1;
WHEN others =>
s <= ’0’;
count <= (others => ’0’);
END CASE;
END PROCESS;
END FSM;
In this example, the + operator is overloaded to accept both
integer and std_logic arguments.
Warp
supports overloading
operators.
Functions
A major advantage of VHDL is the ability to implement
functions. The support of functions allows designs to be
reused by simply specifying a function and passing the appro-
priate parameters.
Warp
features some built-in functions
such as truth-table function (ttf). The ttf is particularly useful
for state machine or look-up table designs. The following
code describes a seven-segment display decoder imple-
mented with the ttf :
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE work.table_std.all;
相關(guān)PDF資料
PDF描述
CY3125R62 Programmable Logic
CY3128R62 Programmable Logic
CY3130R62 Programmable Logic
CY3138R62 Programmable Logic
CY325B LCD Controller
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
CY3121-ADAPTER 功能描述:插座和適配器 Eval Kit Adapter RoHS:否 制造商:Silicon Labs 產(chǎn)品:Adapter 用于:EM35x
CY3121-CUSTOMER 功能描述:開發(fā)軟件 WARP2 VHDL COMPILER PLD/CPLD ONLY-PC VER RoHS:否 制造商:Atollic Inc. 產(chǎn)品:Compilers/Debuggers 用于:ARM7, ARM9, Cortex-A, Cortex-M, Cortex-R Processors
CY3125 制造商:CYPRESS 制造商全稱:Cypress Semiconductor 功能描述:Warp CPLD Development Tool for UNIX
CY3125R62 功能描述:TOOL DEVELOPMENT CPLD FOR UNIX RoHS:否 類別:編程器,開發(fā)系統(tǒng) >> 軟件 系列:- 標準包裝:1 系列:ISE® 設(shè)計套件 類型:訂閱 適用于相關(guān)產(chǎn)品:Xilinx FPGAs 其它名稱:Q4986209T1081384
CY3128 制造商:CYPRESS 制造商全稱:Cypress Semiconductor 功能描述:Warp Professional CPLD Software