7
1 Last updated on 23 rd January 2014 EXPERIMENT D5: VHDL SCHEMATIC DESIGN USING ALTERA Related course: KEEE2232 (Digital Design) OBJECTIVES: 1. To use VHDL language to display hexadecimal digit through MAX+Plus JI software 2. To use ALTERA board to display hexadecimal digit on 7-segment LED EQUIPMENT: MAX+Plus II software and ALTERA Program Board (EPM 7128LS) PREPARATIONS: Students need to learn and understand the MAX+Plus II software, ALTERA University Program board and VHDL before starting the experiments REFERENCE(S): Refer to the main references of KEEE2232 (Digital Design) TESTS: TEST 1: USE VHDL TO DISPLAY HEXADECIMAL DIGIT ON ALTERA BOARD TEST 2: USE THE VHDL FILE AND GRAPHIC EDITOR TO PRODUCE BINARY TO HEXADECIMAL CONVERTER DESIGN ON ALTERA BOARD TEST 1: USE VHDL TO DISPLAY HEXADECIMAL DIGIT ON ALTERA BOARD 1. By using Max Plus II software, write the VHDL language as shown below in the TEXT EDITOR File. Save the file as LED.vhd in the folder C: MAKMALSISTEM DIGITAL. 2. Compile the files and corrected all the errors (if any). To compile, go to COMPILER in Max PLUS II menu. 3. Please make sure the project name is same with the file name. Library IEEE; Use IEEE.std_logic_1164.all; Entity LED is Port(I: in std_logic_vector(3 downto 0); O: out std_logic_vector(6 downto 0)); End LED; Architecture LED_arch of LED is begin with I select O<= "1000000" when "0000", "1111001" when "0001", "0100100" when "0010", "0110000" when "0011", "0011001" when "0100", "0010010" when "0101", "0000010" when "0110", "1111000" when "0111", "0000000" when "1000", "0011000" when "1001", "0001000" when "1010", "0000011" when "1011", "1000110" when "1100", "0100001" when "1101", "0000110" when "1110", "0001110" when "1111", "0000000" when others; End LED_arch; Notes : O is alphabet : 0 is numerical DETERMINE THE TYPE AND PIN LOCATIONS OF THE DEVICE 1. Click Assign Device display menu. Choose MAX7000s device for Device Family. Under Devices List, choose EPM7128SLC84-6. Click OK. 2. Click Assign Pin/Location/Chip display menu. Key in the node’s name under NODE NAME and pin locations under Chip Resources-Pin. Click ADD and repeat for

01 Schematic Design and Vhdl Using Altera

Embed Size (px)

DESCRIPTION

lab

Citation preview

  • 1 Last updated on 23rd January 2014

    EXPERIMENT D5: VHDL SCHEMATIC DESIGN USING ALTERA

    Related course: KEEE2232 (Digital Design)

    OBJECTIVES: 1. To use VHDL language to display hexadecimal digit through MAX+Plus JI software 2. To use ALTERA board to display hexadecimal digit on 7-segment LED

    EQUIPMENT: MAX+Plus II software and ALTERA Program Board (EPM 7128LS)

    PREPARATIONS: Students need to learn and understand the MAX+Plus II software, ALTERA University Program board and VHDL before starting the experiments

    REFERENCE(S): Refer to the main references of KEEE2232 (Digital Design)

    TESTS: TEST 1: USE VHDL TO DISPLAY HEXADECIMAL DIGIT ON ALTERA BOARD TEST 2: USE THE VHDL FILE AND GRAPHIC EDITOR TO PRODUCE BINARY TO HEXADECIMAL CONVERTER DESIGN ON ALTERA BOARD

    TEST 1: USE VHDL TO DISPLAY HEXADECIMAL DIGIT ON ALTERA BOARD

    1. By using Max Plus II software, write the VHDL language as shown below in the TEXT EDITOR File. Save the file as LED.vhd in the folder C: MAKMALSISTEM DIGITAL.

    2. Compile the files and corrected all the errors (if any). To compile, go to COMPILER in Max PLUS II menu.

    3. Please make sure the project name is same with the file name.

    Library IEEE; Use IEEE.std_logic_1164.all; Entity LED is Port(I: in std_logic_vector(3 downto 0); O: out std_logic_vector(6 downto 0)); End LED; Architecture LED_arch of LED is begin with I select O

  • 2 Last updated on 23rd January 2014

    all the below pin. Please refer to the attachment on the Pin Configurations of EPM7128SLC84-6.

    Table 1 Node Name Pin Locations Node Name Pin Locations

    I0 I1 I2 I3

    I/O pin I/O pin I/O pin I/O pin

    O0 O1 O2 O3 O4 O5 O6

    LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin

    3. Save and compile the file again. File => Create Default Symbol. Symbol file for LED will be produced.

    4. After the file is compiled, run the simulation operation. Open the Waveform Editor file at the menu of MAX Plus II and get the input and output nodes at the Node =>Enter Node from SNF menu.

    5. Set the value for I0-I3. Make sure the value for IO-l3 and O0-O6 is Hexadecimal first. After that, the values for I0-l3 are input by right-clicking the mouse at the alphabet r. Get the input value from Overwrite => Count Value. Click OK. Display value of 0-F will be shown at I0-I3.

    6. Save the file by using the file name given above. Simulate the signal by using the Simulator located at the menu of MAX +Plus II.

    7. Check the output at O0-O6. Make sure the output is same as the output obtained by using the VHDL in the previous experiment.

    INPUT VHDL PROGRAM INTO EPM7128SLC84-7 DEVICE

    1. Before making any connection, make sure the switch is turned off first. To use the MAX7000s, the following configuration has to be done on the ALTERA board first.

    2. Make sure the ALTERA board is connected to power supply between 7 -12V DC. 3. Click at the MAX PLUS 11 => Programmer menu. Check the screen display as

    shown in Figure 1. 4. Click at the Program, and the VHDL data will be input in EPM7128SLC84-6

    Figure 1

  • 3 Last updated on 23rd January 2014

    EXERCISE:

    Use DIP switch (S1-S4) as input I0-I3 and connect to the I/O pins from ALTERA EPM7128SLC84-6 which had been defined in previous stated. Change the input value by toggling the switch and record down all the combinations as in Table 2.

    Table 2 Switch combinations (I0-I3) 7 segment LED display Hexadecimal

    value S1 S2 S3 S4 g f e d c b a 0 0 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0 1 0 1 0 1 1 1 0

    Notes: LED 7 segment is active low device

    Which of the switches (S1-S4) represents the LSB and MSB?

    TEST 2: USE THE VHDL FILE AND GRAPHIC EDITOR TO PRODUCE BINARY TO HEXADECIMAL CONVERTER DESIGN ON ALTERA BOARD

    1. Open a new Graphic editor file, draw the schematics as shown in Figure 2. Save the file as Bintohex in C: Makmal Digital. Please ensure the project name is same with the file name by clicking Set the project to current file in File menu.

    2. At the 4count symbol, right click to get Edit Port/Parameters menu. At the Name Box, get QA and set ALL in the Inversion Box. Repeat for QB-QD.

    3. At the LPM counter symbol, right click to get Edit Port/Parameters menu and set all the pins to UNUSED in the Status box except pin clock and q[LPM_WIDTH1..0]. After that, at the Parameter box, set the LPM_DIRECTION to UP and LPM_WIDTH to 32 at the Parameter Value Box.

    4. Draw a wire at CLK pin in 4-Count symbol, right click and get into Edit Node/Bus Name. Type Q24 for it. Repeat the step for all the buses and nodes.

    5. Insert the LED symbol by double click the gdf file to get into ENTER SYMBOL from Symbol Files menu.

    6. Save and Compile the file and make sure all the errors (if any) are corrected.

    DETERMINED DEVICE TYPE AND PIN LOCATION

    1. Click at the Assign => Device display menu. Get the MAX7000s device at Device Family. Under the Device list, get EPM7128SLC84-6 device. Click OK.

    2. Click Assign Pin/Location/Chip display menu. Key in the nodes name under NODE NAME and pin locations under Chip Resources-Pin. Click ADD and repeat for all the pin in Table 3. Please refer to the attachment on the Pin Configurations of EPM7128SLC84-6.

  • 4 Last updated on 23rd January 2014

    Table 3 Node Name Pin Locations Node Name Pin Locations

    CLK I0 I1 I2 I3

    CLK pins I/O pin I/O pin I/O pin I/O pin

    O0 O1 O2 O3 O4 O5 O6

    LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin LED 7 segment pin

    3. Save and compile the file again. After the file is compiled, run the simulation operation.

    4. Open the Waveform Editor file at the menu of MAX Plus II and get nodes at the Node =>Enter Node from SNF menu. Click all and choose CLK, [LPM_Counter:2]diffs0.Q-[ LPM_Counter:2]diffs3.Q. Right click at the CLK and OVERWRITECLOCK. Click OK.

    5. Save the file by using the name given. Simulate the signal by using the simulator available at the MAX PLUS II menu. Check the output.

    6. Input the graphic into the EPM7128SLC84-6 device and program into ALTERA board.

    7. Connect the wires from the I/O pins (as per your define) to the LED (P7) 8. Turn on the power supply and observe the LED D1-D4 and the 7segment LED

    Display 9. What is your conclusion from the observation?

    EXERCISE:

    Students are required to do one of the following exercises: 1. By using the JK flip-flops, design a synchronous counter that will count from 0-15 by

    using the Graphic Editor to substitute the 4 count device at the bintohex.gdf graphic file.

    2. By using the JK flip-flops, design a 4 -bit synchronous counter that will count from 0-8 and back to 0 (MOD9) by using the Graphic Editor to substitute the 4 count device at the bintohex.gdf graphic file.

    3. By using the JK flip-flops, design a 4 -bit synchronous counter that will count from 0-11 and back to 0 (MOD 12) by using the Graphic Editor to substitute the 4 count device at the bintohex.gdf graphic file.

    4. By using the JK flip-flops, design a 4 -bit synchronous counter that will count from 0-13 and back to 0 (MOD 14) by using the Graphic Editor to substitute the 4 count device at the bintohex.gdf graphic file.

  • 5 Last updated on 23rd January 2014

    Figure 2

    END OF EXPERIMENT

  • 6 Last updated on 23rd January 2014

    ATTACHMENT:

    EPM7128S PROTOTYPING HEADERS PIN ASSIGNMENTS

    The EPM7128S device is located in an 84-pin plastic J-lead chip carrier (PLCC) package. There are a total of 21 pins on each side of this 84-pin PLCC package, which are connected to one of the 22-pin, dual-row 0.1-inch female headers. Since there are only 21 pins on each side of the device, there is an unassigned pin on each side of the connector. The pin numbers for the EPM7128S device are shown as follows:

    MAX_DIGIT DISPLAYS PIN ASSIGNMENTS

    The dual-digit seven-segment display is pre-wired directly to some of the I/O pins of EPM7128S device. The LED segments of the display are all active LOW, illuminating when driven by a logic 0. The segments of the display are named a, b, c, d, e, f, and g, as shown in the diagram below. The pin assignments are also given in the table below.

  • 7 Last updated on 23rd January 2014

    EXAMPLE OF CONNECTIONS:

    TEST 1: