QuestionQuestion

Transcribed TextTranscribed Text

Homework 3 The objective of homework 3 is to write a module based solution that displays the message “Hello World” on the 7 segment displays of your FPGA prototype board. To do this you will write a module that converts the ASCII (American Standard for Information Interchange) code that represents a letter or number to an array to be associated with LEDs on a 7 segment display in order to display that number. Implement all the letters in the alphabet, and the numbers 0-9 using a case statement. Notice that some of these letters are implemented as capitals and some are not. Capital letters have a different ASCII code. You need to represent both capital and little letters with the same LEDs, since our 7 segment displays aren’t really capable of doing both capital and lower case letters. You can use this code with some modification in lab assignments to come. The you will write a module that sends the message “Hello World” to the bank of 7 segment displays. Since there are only 6, 7segment displays you will have to display “Hello” when pushbutton Key0 is up (value of 1), and then “World” when you push Key0 down (value of 0). These are the letter implementations you should use for the alphabet. Notice H, K, and X are all made the same way. This is because you need more than 7 segments to represent all the letters well. To understand an arbitrary message using 7 segment displays you will have to figure some things out by context . No matter, use the implementations shown below for letters and numbers Information on the pin settings for 7 segment displays is in the DE0-CV users guide, which is captured below. Note there is a period also on the display, but it is not connected up, so you can’t use it on this prototype board. This isn’t relevant to this exercise. For some of your prototype boards this wiring will not work and an alternate wiring scheme is available online. In classes we have found alternate designs in about 50% of boards. Your wiring may be unique to your board requiring some extra debugging on your part. Assignment directions Program a module that displays the letters in this message Hello World With 7segment displays as described, it will really look like “HELLO” with Key0 up and with Key0 down ” OrLd” This module should have an instance of the module (like the one shown below) that will decode any letter from ASCII to the values needed to display on the LEDs. The module that converts ASCII codes to Hex LED Bits should look something like this // you have to finish this code using correct syntax, see begin and end, and case and endcase in language specification, and be carful Problem 1) Complete this for all letters and numbers. Problem 2) Next you need to write the parent module in which the code above is an instance. This parent module that calls this to display “Hello World” should look something like this. Compile and do a simulation verification. A test bench is probably not necessary, just test ASCIICodes. Capture this waveform include it in the pdf you turn in. Problem 3) Use these two codes to program your FPGA in Quartus Prime. Capture an image of your pin assignments. Program the device, and capture an image showing that it was 100% complete. Then capture an image of Hello and World lit up on your FPGA. These images can be done with your phone camera and dropped into Powerpoint or Word and converted to pdf. There is a demo in Resources/Demos that may help you compile and Modelsim and then program your device in Quartus. This will require a pin assignment from table 3-5. You can only hand in pdfs and .doc files, no image files, which means you need to convert any image files to pdf or include them in a powerpoint and then save as pdf. In case you are wondering you turn in your Verilog code files in every assignment including this one. If you leave out files required to for the grader to compile your code, you will not get full credit.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

odule Seg(input [7:0] AsciiCode, output reg [6:0] HexSeg);
   always @ (*) begin
      HexSeg = 7'd0;
      $display("AsciiCode %b", AsciiCode);
      case (AsciiCode)
       // A
       8'h41:
          begin
             HexSeg[3] = 1;
          end
       // a
       8'h61:
          begin
             HexSeg[3] = 1;
          end
       // B
       8'h42:
          begin
             HexSeg[0] = 1;
             HexSeg[1] = 1;
          end
       // b
       8'h62:
          begin
             HexSeg[0] = 1;
             HexSeg[1] = 1;
          end
       // C
       8'h43:
          begin
             HexSeg[1] = 1;
             HexSeg[2] = 1;
             HexSeg[6] = 1;
          end
       // c
       8'h63:
          begin
             HexSeg[1] = 1;
             HexSeg[2] = 1;
             HexSeg[6] = 1;
          end
       // D
       8'h44:
          begin
             HexSeg[0] = 1;
             HexSeg[5] = 1;
          end
       // d
       8'h64:
          begin
             HexSeg[0] = 1;
             HexSeg[5] = 1;
          end
       // E
       8'h45:
          begin
             HexSeg[1] = 1;
             HexSeg[2] = 1;
          end
       // e
       8'h65:
          begin
             HexSeg[1] = 1;
             HexSeg[2] = 1;
          end
       // F
       8'h46:
          begin
             HexSeg[1] = 1;
             HexSeg[2] = 1;
             HexSeg[3] = 1;
          end
       // f
       8'h66:
          begin
             HexSeg[1] = 1;
             HexSeg[2] = 1;
             HexSeg[3] = 1;
          end
       // G
       8'h47:
          begin
             HexSeg[4] = 1;
          end
       // g
       8'h67:
          begin
             HexSeg[4] = 1;
          end
       // H
       8'h48:
          begin
             HexSeg[0] = 1;
             HexSeg[3] = 1;
          end
       // h
       8'h68:
          begin
             HexSeg[0] = 1;
             HexSeg[3] = 1;
          end
       // I
       8'h49:
          begin
             HexSeg[0] = 1;
             HexSeg[1] = 1;
             HexSeg[2] = 1;
             HexSeg[3] = 1;
             HexSeg[6] = 1;
          end
       // i
       8'h69:
          begin
             HexSeg[0] = 1;
             HexSeg[1] = 1;
             HexSeg[2] = 1;
             HexSeg[3] = 1;
             HexSeg[6] = 1;
          end
       // J
       8'h4A:
          begin
             HexSeg[0] = 1;
             HexSeg[5] = 1;
             HexSeg[6] = 1;
          end
       // j
       8'h6A:
          begin
             HexSeg[0] = 1;
             HexSeg[5] = 1;
             HexSeg[6] = 1;
          end
       // K
       8'h4B:
          begin
             HexSeg[0] = 1;
             HexSeg[3] = 1;
          end
       // k
       8'h6B:
          begin
             HexSeg[0] = 1;
             HexSeg[3] = 1;
          end...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

50% discount

Hours
Minutes
Seconds
$60.00 $30.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Verilog, VHDL Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats