Different Modeling Style VHDL Programs and Execution Steps in Xilinx ISE 9
Different Modeling Style VHDL Programs and Execution Steps in Xilinx ISE 9
1i
The objective of this paper is to understand the elsif (clk'event and clk='1') then
process of VHDL code implementation and
the related steps. To execute the program and if (mode='1') then
download it on the FPGA different simulating tmp <= tmp - 1;
software’s are available, we are going to use
Xilinx ISE 9.1i else
As an example will follow the steps to
tmp <= tmp + 1;
implement the code for Full adder in
behavioral Model end if;
end if;
VHDL code for 4 bit up /down synchronous
counter using Behavioral Modeling end process;
q <= tmp;
--------------------------------------------------------
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
VHDL code for 4:1 Multiplexer using
use IEEE.STD_LOGIC_ARITH.ALL; Dataflow Modeling
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Mode_control_counter is --------------------------------------------------------
Process conditions.
Figure 1 New Project Wizard - Device Properties Figure 3 Full Adder in the Define Module
settings. window.
Click “Next>” until the Summary window On the Summary window, click “Finish”.
appears, then click “Finish.” The FULL_ADDER1.vhd file will appear
in the ISE workspace along with a design
summary. Go ahead and close the design
2. Under the “Project” menu select “New summary by right clicking on the “Design
Source…” In the Select Source Type Summary” tab and selecting “Close”.
window, highlight “VHDL Module” and
enter the file name “counter”. Click
“Next>”. 4. There are three basic parts to a VHDL file.
i. library IEEE
This is where libraries are
declared. Libraries allow
the use of certain
commands and operators.
Architecture Behavioral of
Full_adder1 is
signal declarations
go here
begin
signalsignal name:type_name:=
“expression” ;
signaltemp_coun
t :std_logic_ve 6. In VHDL, the most common way to
ctor(3downto0)
:= “0000” ; implement sequential circuits is by
signal slow_clk using a process. There can be multiple
:std_logic; processes in a design. All processes will
signalclk_divider :std_logic execute concurrently. A process
_vector(1downto0) := “00”;
communicates with the rest of the
design using signals or ports declared
Checking syntax after each bit of outside of the process (this was done in
programming is a good habit to get into. It step 5). A process is activated when
is much easier to trouble shoot small there is a change in a signal that has
sections of code rather than writing the been predefined in a sensitivity list.
whole program and then going back to Two processes will define the behavior
find an error. To check syntax in ISE, of the counter.
expand the “Synthesize - XST” process in
the Processes window and double click on
the “Check Syntax” process. A green
checkmark will appear next to the process
icon if no errors are found. Errors that are
found will be displayed in the ISE
Transcript window along the bottom of
the screen. Save the changes in the VHDL
file and check the syntax before going on Below the signal declarations, the
command word ‘begin’ declares the -
beginning of ‘Behavioral’, which is the -
name that was given to the architecture. -
Below “begin”, enter the first process for -
the clock divider as shown below. -
-
-
-
-
process (a,b,c) -
-
begin -
-
if -
condition -
then -
-
-
end if; ;
e
end process; n
d
a. process (a,b,c) i
The process sensitivity list f
includes the ‘a,b,c’ input. The ;
process will run every time when
any one input mentioned in the
list shows the changes in its
value.
if (a='0' and b='0' and c='0' ) then
b.s <=
begin
'0';
cr<=This'0';begins the code that describes
the……………….next
elsif process. condition
end if ;
c. i
f In this case on the execution of
c if statement by checking values
o of a,b,c = 0 the output is a
n assigned to s as 0 and cr as 0 . if
d condition is not true it will go to
i next condition.
t
i Within this program the all
o conditions of a,b,c combinations
n are checked varing form 000 to
111 and according to
t functionality of the full adder it
h
e will assign output to s and cr.
n
- e. e
- n
- d
- n
- d
i Wizard will take care of the library
f declarations and the entity. The
; process will be designed to test the
counter.
e
n Under the “Project” menu select
d “New Source” or click on the New
Source button on the Project
i Navigator toolbar.
f
;
Each ‘if’ statement must be
closed with an ‘end if’. This can
get tricky when you have several
if statements inside of each other.
Indenting (tab) the text helps
keep track of the hierarchy of the
‘if’ statements. Figure 5 New Source Button.
End Behavioral;
Figure 8 initializing inputs in the .tbwfile . Figure 10 Pull-down menu in 'Sources' window.
Figure 9 synthesis/implementation