You are on page 1of 4

EE 5143 – Course Project – Dr Rahman

The project described in this document is based on implementing a 12-hour clock, hosted in a Cyclone III
FPGA. This is a more advanced undertaking than all the labs encountered so far in this course. However,
it is mostly based on concepts introduced in the lab assignments. Even though this is a somewhat more
advanced project than all the lab projects, it still uses only a very small fraction of resources inside a
Cyclone III FPGA. This should give you some appreciation of how much uncommitted logic is packed
inside even a relatively low-end FPGA these days. You can use such an FPGA to either build one very
complex system or a set of completely separate systems so that almost all of the LEs and pins on the
FPGA are utilized.

이 문서에 설명 된 프로젝트는 Cyclone III FPGA 에서 호스팅되는 12 시간 시계 구현을 기반으로합니다. 이것은


지금까지이 과정에서 만난 모든 실습보다 더 진보 된 작업입니다. 그러나 대부분은 실습 과제에서 소개 된 개
념을 기반으로합니다. 이 프로젝트는 모든 실험실 프로젝트보다 다소 고급 프로젝트이지만 여전히 Cyclone
III FPGA 내부에서 매우 적은 양의 리소스 만 사용합니다. 이것은 요즘 비교적 저가형 FPGA 조차도 커밋되지
않은 로직이 얼마나 많은지 알 수 있습니다. 이러한 FPGA 를 사용하여 하나의 매우 복잡한 시스템 또는 완전
히 분리 된 시스템 세트를 구축하여 FPGA 의 거의 모든 LE 및 핀을 활용할 수 있습니다.

A complete block schematic diagram of a 12-hour clock is given on the next page. You would need to
study it carefully. Each block requires writing its VHDL code, compiling it and generating a block diagram.
Once all the blocks have been constructed, a top_level can be implemented to wire up all the
component blocks. This is then compiled, pin assignments made and a final compilation performed. For
the sake of this project, connect the 50 MHz input to the one of the FPGA pins that has the clock
available at it and the second_blink output to any of the LEDs while the display_out outputs can be
assigned to pins that connect to the 7-segment display. Either a .sof or a .jic file can be downloaded to
the FPGA. Note that this clock is not adjustable – it always starts at 12:00 and advances from there (as
they say – even a broken clock shows the correct time twice a day!) No VHDL code is provided for this
project. You will need to write all the code yourself. To qualify for marks you will need to show
screenshots of successfully compiled code for the various blocks.

12 시간 시계의 전체 블록 개략도가 다음 페이지에 나와 있습니다. 주의 깊게 연구해야합니다. 각 블록은


VHDL 코드를 작성하고 컴파일하고 블록 다이어그램을 생성해야합니다. 모든 블록이 구성되면 top_level 을
구현하여 모든 구성 요소 블록을 연결할 수 있습니다. 그런 다음 컴파일되고 핀 할당이 이루어지며 최종 컴파
일이 수행됩니다. 이 프로젝트를 위해 50MHz 입력을 사용 가능한 클럭이있는 FPGA 핀 중 하나에 연결하고
second_blink 출력을 LED 중 하나에 연결하고 display_out 출력을 7-에 연결하는 핀에 할당 할 수 있습니다. 세
그먼트 표시. .sof 또는 .jic 파일을 FPGA 로 다운로드 할 수 있습니다. 이 시계는 조정할 수 없습니다. 항상
12:00 에 시작하여 거기에서 진행됩니다 (말했듯이 – 고장난 시계도 하루에 두 번 정확한 시간을 표시합니
다!).이 프로젝트에는 VHDL 코드가 제공되지 않습니다. 모든 코드를 직접 작성해야합니다. 마크 자격을 얻으
려면 다양한 블록에 대해 성공적으로 컴파일 된 코드의 스크린 샷을 보여 주어야합니다.

Writing and compiling code for the top four blocks is essential and 80% marks can be obtained if this is
done. To get the other 20% marks you need to code the other four blocks as well. You will get partial
marks from the reserved 20% if you complete some of the bonus part. Here is a description of the
complete system. Note that a PLL has not been used but could be used to reduce the 50 MHz clock’s
frequency. The TickGenerator takes in the 50 MHz clock and generates a 1 Hz output clock – essentially
generating second ticks. Its output can drive a second-by-second blinking LED. Additionally, the output
tick_out is also sent to the SecondGenerator block. The SecondGenerator block generates the second
count i.e; it increments an internal variable once every second from 0 to 59 and then rolls back to 0.
That (std_logic_vector) variable can be assigned to a (std_logic_vector) signal second[5..0] which comes
out of the block. Note that this is a 6-bit std_logic_vector value because counts up to 59 can be
accommodated in 6 binary digits (26 = 64). As most clocks do not display second counts so this value is
not utilized any further here. This block also generates a pulse every time the second counter rolls over
i.e. every 1 minute. This comes out as the std_logic signal minute_out which becomes the input
minute_in for the next block.

상위 4 개 블록에 대한 코드를 작성하고 컴파일하는 것은 필수적이며이 작업을 수행하면 80 %의 점수를 얻을


수 있습니다. 나머지 20 % 마크를 얻으려면 나머지 4 개 블록도 코딩해야합니다. 일부 보너스 부분을 완료하
면 예약 된 20 %에서 부분 점수를 받게됩니다. 다음은 전체 시스템에 대한 설명입니다. PLL 은 사용되지 않았
지만 50MHz 클록의 주파수를 줄이는 데 사용할 수 있습니다. TickGenerator 는 50MHz 클럭을 받아 1Hz 출력
클럭을 생성합니다. 기본적으로 두 번째 틱을 생성합니다. 그 출력은 초 단위로 깜박이는 LED 를 구동 할 수
있습니다. 또한 출력 tick_out 도 SecondGenerator 블록으로 전송됩니다. SecondGenerator 블록은 두 번째 카운
트를 생성합니다. 내부 변수를 0 에서 59 까지 1 초마다 증가한 다음 0 으로 롤백합니다.이 (std_logic_vector)
변수는 블록에서 나오는 (std_logic_vector) 신호 second [5..0]에 할당 될 수 있습니다. 최대 59 개의 카운트를 6
개의 이진수 (26 = 64)에 수용 할 수 있기 때문에 이것은 6 비트 std_logic_vector 값입니다. 대부분의 시계는 초
카운트를 표시하지 않으므로이 값은 여기에서 더 이상 사용되지 않습니다. 이 블록은 또한 두 번째 카운터가
롤오버 될 때마다 즉 1 분마다 펄스를 생성합니다. 이것은 std_logic 신호 min_out 으로 나옵니다. 이것은 다음
블록에 대한 입력 minute_in 이됩니다.

The MinuteGenerator block is very similar to SecondGenerator. It generates the minute count i.e; it
increments an internal variable once every minute from 0 to 59 and then rolls back to 0. That variable
can be assigned to a signal Minute[5..0] which comes out of the block. Note that this also is a 6-bit
std_logic_vector value. This block also generates a pulse every time the 2 minute counter rolls over i.e.
every 1 hour. This comes out as the std_logic signal hour_out which becomes the input hour_in for the
next block. Again, the HourGenerator block is very similar to SecondGenerator and MinuteGenerator. It
generates the hour count i.e; it increments an internal variable once every hour until it gets to 12 and
then rolls back to 1. Note that it will start from 12 and on the next hour tick advance to 1 etc. That
variable can be assigned to a signal hour[5..0] which comes out of the block. Note that this also is a 6-bit
std_logic_vector value just to maintain uniformity.

MinuteGenerator 블록은 SecondGenerator 와 매우 유사합니다. 분 수를 생성합니다. 내부 변수를 0 에서 59 까


지 1 분마다 증가한 다음 0 으로 롤백합니다.이 변수는 블록에서 나오는 Minute [5..0] 신호에 할당 될 수 있습
니다. 이것은 또한 6 비트 std_logic_vector 값입니다. 이 블록은 또한 2 분 카운터가 롤오버 될 때마다 즉 1 시간
마다 펄스를 생성합니다. 이것은 std_logic 신호 hour_out 으로 나옵니다. 이것은 다음 블록의 입력 hour_in 이
됩니다. 다시 말하지만 HourGenerator 블록은 SecondGenerator 및 MinuteGenerator 와 매우 유사합니다. 시간
카운트를 생성합니다. 내부 변수는 12 가 될 때까지 매시간 한 번씩 증가한 다음 1 로 롤백됩니다. 12 에서 시
작하여 다음 시간에 틱이 1 로 증가합니다.이 변수는 시그널 시간 [5. .0] 블록에서 나옵니다. 이것은 또한 균일
성을 유지하기위한 6 비트 std_logic_vector 값입니다.
There are two instances of DoubleDabble block. This block takes in the minute or hour count as a binary
number and generates two binary coded decimal (BCD) signals: one holding the one’s place digit and the
other holding the ten’s place digit. Complete code for the double dabble algorithm is provided in the
Wikipedia article on Double Dabble. This needs to be appropriately modified. Note that DoubleDabble
will produce (output) a BCD value as two digits (representing decimal values), each requiring 4 bits to
hold i.e. a total of 8 bits. The first four bits (3 downto 0) can be assigned to ones[3..0] and the last four
bits (7 downto 4) can be assigned to tens[3..0]. The DisplayDriver block takes all the four decimal digits
(minute one’s place, minute ten’s place, hour one’s place and hour ten’s place) coded as BCD values of 4
bits each and displays them on four digits of the 7-segment LED display on your DE0 board. Such displays
usually work in a multiplexed fashion i.e. they take information about only one of the four digits as well
as four single bit values that determine which of the four digits will actually glow. In this way, one sends
digit values one by one scanning from one end to the other (hour unit’s place, hour ten’s place, minute
unit’s place and minute ten’s place). If this is done quickly enough then due to persistence of vision we
see all four digits glowing steadily.

DoubleDabble 블록에는 두 가지 인스턴스가 있습니다. 이 블록은 분 또는 시간 카운트를 이진수로


사용하고 두 개의 이진 코드 십진수 (BCD) 신호를 생성합니다. 하나는 1 자리 숫자를, 다른 하나는
10 자리 숫자를 보유합니다. Double Dabble 알고리즘에 대한 전체 코드는 Double Dabble 의
Wikipedia 기사에서 제공됩니다. 이것은 적절하게 수정되어야합니다. DoubleDabble 은 BCD 값을
두 자리 (십진수 값을 나타냄)로 생성 (출력)하며, 각각은 4 비트를 보유해야합니다 (총 8 비트).
처음 4 비트 (3 에서 0 까지)는 1 [3..0]에 할당되고 마지막 4 비트 (7 에서 4 까지)는 10 [3..0]에 할당
될 수 있습니다. DisplayDriver 블록은 각각 4 비트의 BCD 값으로 코딩 된 4 자리 십진수 (분 1 자리,
분 10 자리,시 1 자리 및시 10 자리)를 가져와 DE0 의 7 세그먼트 LED 디스플레이의 네 자리에
표시합니다. 판. 이러한 디스플레이는 일반적으로 다중 방식으로 작동합니다. 즉, 4 자리 중 하나에
대한 정보와 4 자리 중 실제로 빛을 발하는 4 개의 단일 비트 값에 대한 정보 만 가져옵니다. 이런
식으로 한 쪽 끝에서 다른 쪽 끝으로 하나씩 스캔하여 숫자 값을 전송합니다 (시간 단위 자리,시 10
자리, 분 단위 자리 및 분 10 자리). 이것이 충분히 빨리 이루어지면 시력의 지속성으로 인해 네
자리가 모두 꾸준히 빛나는 것을 볼 수 있습니다.

Thus, in this block you need to output each digit’s value in turn, repeatedly going from the left-most
digit to the right-most digit. The digit’s value is sent as a 7-bit vector to drive the seven segments of each
7-segment display. This block also takes a 500 Hz scan clock from the ScanClock block which simply
generates a 500 Hz clock. This frequency is not critical. It can be 400 Hz, 600 Hz etc. and there will be no
visible difference. Its value needs to be a few hundred Hertz in order to scan quickly 3 so that the display
does not seem to flicker. A good thing to do is to display each digit for 4 or 5 periods of the scan clock
and then move to displaying the next digit. Note that you can verify the functioning of the blocks in the
top row by sending their single bit pulse signals to an LED to make sure that the periodicities are 1
second, 1 minute and 1 hour. Now it is up to you to get going with this project. I can answer minor
queries about this project but will not provide any detailed guidance so as to let you have a go at it
yourself. Please submit it by April 22 i.e. within a month from today. I’ll provide code for all blocks, if
requested, after the project has been graded. Note that coding problems usually do not have unique
solutions so your code does not need to be the same as my code. It only needs to accomplish correctly
what each block is supposed to do.

따라서이 블록에서 각 숫자의 값을 차례로 출력해야하며, 가장 왼쪽 숫자부터 맨 오른쪽 숫자까지 반복적으


로 이동해야합니다. 숫자의 값은 7 비트 벡터로 전송되어 각 7 세그먼트 디스플레이의 7 개 세그먼트를 구동
합니다. 이 블록은 단순히 500Hz 클럭을 생성하는 ScanClock 블록에서 500Hz 스캔 클럭을 가져옵니다. 이 빈도
는 중요하지 않습니다. 400Hz, 600Hz 등이 될 수 있으며 눈에 띄는 차이는 없습니다. 디스플레이가 깜박 거리
지 않도록 빠르게 스캔하기 위해서는 그 값이 수백 헤르츠가되어야합니다. 좋은 방법은 스캔 클럭의 4 ~ 5 주
기 동안 각 숫자를 표시 한 다음 다음 숫자 표시로 이동하는 것입니다. 주기가 1 초, 1 분 및 1 시간인지 확인하
기 위해 단일 비트 펄스 신호를 LED 에 전송하여 맨 위 행에있는 블록의 기능을 확인할 수 있습니다. 이제이
프로젝트를 진행하는 것은 당신에게 달려 있습니다. 이 프로젝트에 대한 사소한 질문에 답할 수는 있지만 직
접해볼 수 있도록 자세한 지침은 제공하지 않습니다. 오늘부터 1 개월 이내에 4 월 22 일까지 제출해주십시
오. 프로젝트가 채점 된 후 요청시 모든 블록에 대한 코드를 제공하겠습니다. 일반적으로 코딩 문제에는 고유
한 솔루션이 없으므로 코드가 내 코드와 같을 필요는 없습니다. 각 블록이 수행해야하는 작업 만 올바르게 수
행하면됩니다.

You might also like