0% found this document useful (0 votes)
75 views8 pages

Bai Chuan Bi Lab5

This document provides instructions for two labs involving finite state machines and Verilog. The first lab asks students to design an FSM that detects four consecutive 1s or 0s as input and sets the output to 1 during these sequences. The second lab asks students to build a Morse code encoder FSM that displays dots and dashes on an LED for the first eight letters input via switches. Students are instructed to draw state diagrams for both designs and test them on an Altera DE2 board.

Uploaded by

Hoàng Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views8 pages

Bai Chuan Bi Lab5

This document provides instructions for two labs involving finite state machines and Verilog. The first lab asks students to design an FSM that detects four consecutive 1s or 0s as input and sets the output to 1 during these sequences. The second lab asks students to build a Morse code encoder FSM that displays dots and dashes on an LED for the first eight letters input via switches. Students are instructed to draw state diagrams for both designs and test them on an Altera DE2 board.

Uploaded by

Hoàng Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Trng i Hc Cng Ngh Thng Tin

Khoa K Thut My Tnh

Bi Chun B Lab 5
Mn Thit K Vi Mch Vi HDL
Lp

: CE106.E22.1(HT1)

Ging Vin : Nguyn Thanh Sang

Nguyn Vn Minh

11520230

Thc hnh
Hng dn thit k Verilog Lab 5
Bi 1. We wish to implement a finite state machine (FSM) that recognizes two
specific sequences of applied input symbols, namely four consecutive 1s or four
consecutive 0s. There is an input w and an output z. Whenever w = 1 or w = 0 for
four consecutive clock pulses, the value of z has to be 1; otherwise, z = 0.
Overlapping sequences are allowed, so that if w = 1 for five consecutive clock
pulses the output z will be equal to 1 after the fourth and fifth pulses.
Use the toggle switch SW0 on the Altera DE2 board as the input w, the LEDG0 as
the output z, and the push button KEY0 as the clock input which is applied anually.
Simulate the behavior of your circuit and then test the functionality of your design
on board DE2.
Bi lm: ta v lu trng thi nh sau:

Bi 3.
In this part of the exercise you are to implement a Morse-code encoder using an
FSM. The Morse code uses patterns of short and long pulses to represent a
message. Each letter is represented as a sequence of dots (a short pulse), and
dashes (a long pulse). For example, the first eight letters of the alphabet have the
following representation:

Design and implement a Morse-code encoder circuit using an FSM. Your circuit
should take as input one of the first eight letters of the alphabet and display the
Morse code for it on a red LED. Use switches SW2-0 and pushbuttons KEY as
inputs. When a user presses KEY1, the circuit should display the Morse code for a
letter specified by SW1-0 (000 for A, 001 for B, etc.), using 0.5-second pulses to
represent dots, and 1.5-second pulses to represent dashes. Pushbutton KEY0
should function as an asynchronous reset.
Bi lm: ta v lu trng thi nh sau:
Ch thch

SW2-0: 000 : A

SW2-0: 001 : B

SW2-0: 010 : C

SW2-0: 011 : D

SW2-0: 100 : E

SW2-0: 101 : F

SW2-0: 110 : G

SW2-0: 111 : H

You might also like