Construct a 3-bit counter with inputs and outputs as pictured below.
The Terminal Count(TC) is high when the 3-bit count (Q2 Q1 Q0) is
(1 1 1). Realize your counter with a XC4003EPC84 Xilinx FPGA on
the demo board.
Use pin 13 of the XC4003E as your clock input.
To do this you need to:
- Edit block P13 to make sure the pad is connected to the CLKIN pin of this
block.
- Add a net between the CLKIN pin of P13 and the input pin of the global
buffer (BUFGP_TL.I)
See the figure below for location of these terminals.
- Add a net (say CLK) to BUFGP_TL.O and all of the K terminals
of the CLBS in which you need the clock (those in which you use the flip-flop).
The four outputs of the counter should be displayed on the 4 general
purpose LEDS (CR2 on the demo board). These are already connected to
pins 61, 62, 65 and 66 of the XC4003E-PC84. To turn on the LED you
will need to drive the pin low, so you'll probably want to invert the
output of your counter; this can be done in the IOBs.
The input, UP, will be from the spare pushbutton. The counter should
abvance by one every time you press this pushbutton. One side of the
pushbutton (J5) is connected to ground and the other side is connected
to pin 47 of the XC4003E-PC84. With the pullup on in IOB of P47, depressing
the spare pushbutton gives a low going pulse. You will need to debounce
this pulse and detect a high to low edge in order for your design to
work properly. (Use a counter to sample the input more slowly to remove
noise and the edge detector from Homework 1 to get only a single pulse.)
Follow these steps:
- Work out your design and how you plan to implement it with
CLBs on paper. The fewer CLBS, the better and easier.
- Use fpga_editor to enter your design and create an ncd file.
- Use bitgen to create a bit file from your ncd file:
bitgen counter3.ncd
- Use hwdebugr to download your bit file.
Either provide the bitfile as an argument to hwdebugr at the prompt
or
type open counter3.bit in the console window to read in the bitstream.
You must show me your working circuit by the due date.
You should draw and submit:
- The logic diagram of your design.
- A diagram to illustrate the mapping between the logic circuit
and CLBs as well as their interconnection in the XC4003E FPGA.
- Print out a map of the XC4003E LCA (logic cell array) and indicate
on the map the placement of the used CLBs and the IOBs.