Exercises 1
Exercises 1
1. Copy the project folder of the previous Tutorial and rename the copy as
exercises_1
2. Go to the new created folder, and open the ISE project file. It should show
you the same files and design hierarchy that you have created during the
Tutorial
Exercise 1
1. Edit the top2.vhd file, copying the architecture arch or top2 and paste it
bellow
3. Comment all the code of the architecture arch1 (select the lines of the code
you want to comment, press right button of the mouse in order to present a
contextual menu, and click on Comment>Line(s) )
5. Synthetize the circuit top2(arch2) and view the synthesized result on View
RTL Schematic
6. Implement the layout of the circuit and view it on View/Edit Routed Design.
7. Briefly comment the main difference of the arch2 when compared with arch,
in the synthesised circuit and in the layout due to the change done in the
process. Justify the results.
Exercise 2
1. Uncomment the architecture arch (select the lines of the code you want to
uncomment, press right button of the mouse in order to present a contextual
menu, and click on Uncomment>Line(s) )
2. Copy again arch and paste it bellow arch2 and comment the arch2 again.
Rename the new copy of arch to arch3, and modify it as:
3. Since the new description uses the unsigned type to perform the subtraction
and comparators on the signal cnt, include the library ieee.std_logic_arith at
the top of the top2.vhdl file
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_arith.all;
4. Create a testbench to perform the functional simulation of the VHDL code for
arch and arch3. You can write it at the bottom of the top2.vhd file
--synthesis translate_off
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity tb_top2 is
end entity;
5. In order to get a faster simulation, change the ps0 generic value (from
10e+6) to a much lower value (for instance 5) in both architectures (arch and
arch3)
6. Simulate the testbench and compare the simulation differences between the
led_0 (output for arch) and led_1 (output for arch3). Justify the results
8. Change the prescaler number of counts (as it was at the beginning) in arch
and arch3
9. Synthetize the circuit top2(arch3) and view the synthesized result on View
RTL Schematic
10. Implement the layout of the circuit and view it on View/Edit Routed Design.
11. Briefly comment the main difference of the arch3 when compared with arch,
in the synthesised circuit and in the layout due to the change done in the
process. Justify the results.
Exercise 3
2. Modify the entity top2, in order to parametrize the number of leds to control
(with the generic NLED) among with the number of counts of the prescaler
(PSCOUNTS) as:
entity top2 is
generic(
PSCOUNTS: integer:=10e+6;
NLED: integer:=4 );
port(
clk,rst: in std_logic;
led: out std_logic_vector(0 to NLED-1) );
end entity;
3. Uncomment arch, and modify it in order it will work with an arbitrary number
for NLED (complete the following code and report it)
5. Since the arch3 uses the function F_NBITS defined in the package
pack_pract, include this package at the top of the top2.vhd file
library IEEE;
...
use work.pack_pract.all;
6. Modify the testhench tb_top2 (complete the following code and report it) in
order to perform simulation with an arbitrary number for the parameter NLED
and check that the new architectures arch and arch3 will work as expected.
for several values of NLED, such as 4, 8 and 10
8. Synthetize and implement the new architecture arch (comment the arch3).
Briefly comment the results when compared with the solutions for the arch
obtained in the previous exercises. Justify the results
9. Synthesize and implement the new architecture arch3 (comment the arch),
Briefly comment the results when compared with the solutions for the arch3
obtained in the previous exercises. Justify the results
Exercise 4
1. Comment all the architectures, except the last architecture arch (which uses
the generic NLED)
3. Synthetize and implement the layout. View the synthetized result with ‘View
Technology Schematic’
4. Go to the synthesis options, but set ‘Yes’ to the ‘Pack I/O Registers into
IOBs’
5. Synthetize and implement the layout. View the synthetized result with ‘View
Technology Schematic’
6. Compare the synthesis result and layout in the both cases (Packing or not
I/O registers into IOBs). Briefly comment the differences in both cases.
Justify the results.