Académique Documents
Professionnel Documents
Culture Documents
Part 2
Structural Model
Figure 2 below shows the structural model for the circuit of the example lab report.
The circuit consists of a process, My_proc, that handles selecting what data to be
displayed, the component, sseg_dec, which acts as a binary to seven segment
decoder, and a mux, which selects whether or not the seven segment display
should be on or off.
Lab Partner 1
Lab Partner 2
CPE 133-80
Summer 2014
iSim Testing
Table 1 shows the test cases used to test the operation of our Lab 0 circuit. Test
cases 2->5 show the testing of each individual button without changing the input
and test cases 1 and 8 show the result of no button pressed. Test case 6 shows the
result of changing the input while the same button is held. Test case 7 shows
button 2 has precedence over button 3 if both buttons are pushed. Additional test
cases could be used to show correct button precedence for all buttons. These test
cases were not included in the iSim test, but were tested visually on the board.
Figure 3 shows the isim output of all test cases showing the outputs, display_en and
data match those expected outputs in Table 1. Because the iSim output matches
the expected output and because our demo on the board also matched the
expected output, we feel our circuit is working properly.
Table 1: Test Cases for Lab0
Test
Case
1
2
3
4
5
6
7
8
Time
INPUTS
A
Buttons
0ns
20ns
40ns
60ns
80ns
100ns
120ns
140ns
0000
1100
1100
1100
1100
1100
1100
1100
0000
0101
0101
0101
0101
1111
1111
1111
0000
0001
0010
0100
1000
1000
1100
0000
EXPECTED OUTPUTS
Data
Display_En
(decimal)
0
0
4
1
13
1
9
1
6
1
12
1
3
1
0
0
Lab Partner 1
Lab Partner 2
CPE 133-80
Summer 2014
Conclusion
Lab Partner 1
In this weeks lab, I gained an appreciation of using structural modeling. It is super
cool to be able to make use of modules already made (either by me or someone
else) and connect them together, with some added functionality, into a new circuit.
I can appreciate the technique of modular and hierarchical design because I see
how having a toolbox of simple modules makes designing larger and more complex
modules more feasible. I am also now feeling much more comfortable with using
the Xilinx design suite and the VHDL language. Finally, I was able to practice my
understanding of bit operations (and, or, xor, and xnor) and my ability to convert
binary to decimal.
Lab Partner 2
Insert conclusion here.
Answers to Questions
Code
----------------------------------------------------------------------------------- Engineer: Bridget Benson
-- Create Date:
14:26:39 06/13/2014
-- Target Devices: Digilent Nexys 2
-- Description: This module is a dummy module for use int he lab report template.
-- It reads the status of four buttons and 8 switches, the
-- left four switches being called 'A', and the right four switches called 'B'
-If no buttons are pressed, nothing is shown on the SSEG display
-If button 1 is pressed, the result of A and B is shown
Lab Partner 1
Lab Partner 2
CPE 133-80
Summer 2014
begin
-------------------------------------------------------------------------- Port Maps
------------------------------------------------------------------------sd1: sseg_dec port map (
ALU_VAL
=> data,
SIGN
=> '0', --no signed numbers
VALID
=> '1', --always valid
CLK
=> CLK,
DISP_EN
=> disp_en_sseg,
SEGMENTS
=> SSEG);
-------------------------------------------------------------------------- Logic
------------------------------------------------------------------------process (A, B, Buttons)
begin
if (Buttons(0) = '1') then
data <= "0000" & (A and B);
display_en <= '1';
elsif (Buttons(1) = '1') then
data <= "0000" & (A or B);
display_en <= '1';
elsif (Buttons(2) = '1') then
Lab Partner 1
Lab Partner 2
CPE 133-80
Summer 2014
Lab Partner 1
Lab Partner 2
CPE 133-80
Summer 2014
--expecting "1101" or 13
--expecting "1001" or 9
--expecting "0110" or 6
B <= "1111";
wait for 20 ns;
--expecting "1100" or 12
Buttons <="1100";
wait for 20 ns;
Buttons <= "0000";
wait;
end process;
END;
--expecting "0011" or 3
--expecting no display and value zero