Lab 3 - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Lab 3

Description:

15-button keypad. 8 switches. Block Diagram of Prototype ... Keypad, Switches, LED, 7-S LED Display. All these devices are mapped to corresponding address ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 21
Provided by: pers90
Category:
Tags: keypad | lab | lib | pressed

less

Transcript and Presenter's Notes

Title: Lab 3


1
Lab 3 4 Discussion
  • EE414/514 VHDL Design

September 25
2
Lab 3 Hint- Package and Library
  • Library IEEE
  • use ieee.std_logic_arith.all
  • use ieee.std_logic_unsigned.all
  • USE IEEE.Std_LOGIC_1164.all entity adder is
       port ( a_in in std_logic_vector (3 downto
    0)          b_in    in std_logic_vector (3
    downto 0)          c_out out std_logic_vector
    (3 downto 0)) end adder architecture
    adder_arch of adder is begin    process (a_in,
    b_in)       variable carry std_logic_vector (4
    downto 0)       variable sum std_logic_vector
    (3 downto 0)    begin       carry (0) '0'
          for i in 0 to 3 loop         sum (i)
    a_in(i) xor b_in(i) xor carry(i)         carry
    (i1) (a_in(i) and b_in(i)) or
                            (b_in(i) and carry (i))
    or                         (carry (i) and
    a_in(i))       end loop       c_out lt sum
       end process end adder_arch

What these two means?
3
Lab 3 Package and Library
  • Go to library IEEE, You will find
  • PACKAGE std_logic_1164 IS
  • FUNCTION "and" ( l std_ulogic r std_ulogic
    ) RETURN UX01
  • END std_logic_1164

4
Include Users Design Lib In Lab 3-Make your
library visible to design
  • Put two design in the same workspace
  • First design a single byte counter
  • At the same workspace, design a two-byte counter
  • Library
  • First create a library with your design-single
    byte counter
  • Attach your library to two-byte counter

5
Include Users Design Lib In Lab 3-- Package
6
Include Users Design Lib In Lab 3-- Use Package
7
Connection of Prototype Boards in Lab 4
Expansion Board Dio2
System Board Digilab2
LCD
C O N N E C T O R
XC2S200 -PQ208
7-S LED
JTAG
LED
XC95108
CLOCK
Keypad
Reset
Switch
JTAG
8
(No Transcript)
9
Features of Prototype Board- System Board
Digilab 2
  • Spartan2 XC2S200-PQ208
  • Select correct devices in Xilinx ISE
  • Pin location
  • 50 MHZ CLOCK
  • Speed of your design
  • Source of the clock divider
  • Configuration mode JTAG
  • Select JTAG clock as startup clock
  • Expansion Connector

10
Block Diagram of Prototype Board- System Board
Digilab 2
11
Function Implemented On System Board -Timer
  • Timer and Clock Divider Module
  • process (CLK, MR)
  • begin
  • if MR '0' then
  • L1 for count_value in 18 downto 0 loop
  • QOUT(count_value) lt '0'
  • end loop L1
  • else
  • if (CLK'event and CLK'1') then
  • QOUT lt QOUT 1
  • end if
  • end if
  • end process
  • SWCLK lt QOUT(18) -- using appropriate taps off
    the counter as divided
  • SMCLK lt QOUT(12) -- clock outputs

How to Calculate the factor of Divider ?
12
Function Implemented On System Board - Example
of State Machine
  • State Machine,
  • State Reset, Start_T, are defined
  • COMB_PROC process (CLK, MR) -- This is the
    combinational part
  • begin
  • if (MR '0') then
  • NS lt RESET
  • elsif (CLK'event and CLK '1') then
  • case NS is -- case appears in () to
    aid in coding
  • when RESET gt -- (1)
  • if S '0' then
  • NS lt START_T -- go to this
    state when the S button is pressed
  • else
  • NS lt RESET -- otherwise stay
    in this same state.
  • end if
  • when START_T gt -- (2)transitional states have
    the outputs of the corresponding stable state.
  • if S '1' then
  • NS lt START
  • else
  • NS lt START_T

13
Features of Prototype Board- Expansion Board
Dio2
  • XC95108 CPLD
  • Display Units
  • 162 character LCD
  • 4 seven-segment LED display
  • 16 LED of various colors
  • Input Devices
  • 15-button keypad
  • 8 slide switches

14
Block Diagram of Prototype Board- Expansion
Board Dio2
Bus for exchange data between Dio2 and Digilab2
boards
15
How to Access The Interface Units- LCD
  • Signals
  • D7-D0 Data Bus
  • LCD_R/W
  • LCD_RS
  • LCD_E

16
How to Access The Interface Units- LCD
  • Code
  • constant LCD_CMDS LCD_CMDS_T (
  • 0 gt "00"X"01", -- Clear The Display
  • 1 gt "00"X"38", -- Set interface data width,2
    line,58 dots
  • 2 gt "00"X"0c", -- Set display on, cursor off
    and blink off
  • 3 gt "00"X"02", -- Return Cursor to Home
  • 4 gt "10"X"4f", -- write the display data
    Ohio
  • 5 gt "10"X"68",
  • 6 gt "10"X"69",
  • 7 gt "10"X"6f",

17
(No Transcript)
18
How to Access The Interface Units-Keypad,
Switches, LED, 7-S LED Display
  • All these devices are mapped to corresponding
    address
  • Read the data from certain address to obtain the
    status of the input devices, such as keypad and
    switches
  • Write the data to certain address to turn on/off
    LED and modify the display data on 7-S LED display

19
How to Access The Interface Units-Keypad,
Switches, LED, 7-S LED Display
  • Code
  • signal btns std_logic_vector(14 downto 0)
  • -- 14 push buttons are mapped to bits of the
    vector
  • signal firstTwoNum,LastTwoNum std_logic_vector(7
    downto 0)
  • -- There are four 7-s LED display units, the
    first two are mapped to vectorFirstTwoNum
  • -- Another two are mapped to vector LastTwoNum
    RSTINgtbtns(10), -- Reset input is mapped to
    A button
  • RUNINgtnot btns(11), -- Run input is mapped
    to A button
  • Q3 gt FirstTwoNum(3 downto 0), -- Q3 is
    displayed on 7-S LED
  • Q2 gt FirstTwoNum(7 downto 4), -- Q2 is
    displayed on 7-S LED
  • Q1 gt LastTwoNum(3 downto 0), -- Q1 is
    displayed on 7-S LED
  • Q0 gt LastTwoNum(7 downto 4), -- Q0 is
    displayed on 7-S LED

20
Q/A
Write a Comment
User Comments (0)
About PowerShow.com