Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17267 Discussions

Hello, I would like to Display scroll the word 'DE10' or any word across the six seven segment display of my DE10-Lite board. I can not seem to get it working, would you be able to help me?

KRose13
Beginner
1,238 Views

//////////////////// SCROLLING DE10 ////////////////////////////////

 

module DE10_LITE_Default(

 input clock, reset,

 input HEX0, HEX1, HEX2, HEX3, //the 4 inputs for each display

 output a, b, c, d, e, f, g, dp, //the individual LED output for the seven segment along with the digital point

 output [3:0] an  // the 4 bit enable signal

 );

 

localparam N = 18;

 

reg [N-1:0]count; //the 18 bit counter which allows us to multiplex at 1000Hz

 

 

 

always @ (posedge clock or posedge reset)

 begin

 if (reset)

  count <= 0;

 else

  count <= count + 1;

 end

 

reg [6:0]sseg_temp; //the 7 bit register to hold the data to output ==== Changed from 'reg' ====

reg [3:0]an_temp; //register for the 4 bit enable

 

always @ (*)

 begin

 case(count[N-1:N-2]) //using only the 2 MSB's of the counter 

  

  2'b00 : //When the 2 MSB's are 00 enable the fourth display

  begin

   sseg = HEX0;

   an_temp = 4'b1110;

  end

  

  2'b01: //When the 2 MSB's are 01 enable the third display

  begin

   sseg = HEX1;

   an_temp = 4'b1101;

  end

  

  2'b10: //When the 2 MSB's are 10 enable the second display

  begin

   sseg = HEX2;

   an_temp = 4'b1011;

  end

   

  2'b11: //When the 2 MSB's are 11 enable the first display

  begin

   sseg = HEX3;

   an_temp = 4'b0111;

  end

 endcase

 end

assign an = an_temp;

 

 

reg [6:0] HEX_Display; // 7 bit register to hold the binary value of each input given

 

always @ (*)

 begin

 case(sseg)

  4'd0 : HEX_Display = 7'b0111111; //to display dash

  4'd1 : HEX_Display = 7'b0000001; //to display 0

  4'd2 : HEX_Display = 7'b1001111; //to display 1

  4'd3 : HEX_Display = 7'b0110000; //to display E

  4'd4 : HEX_Display = 7'b1000010; //to display d

  4'd5 : HEX_Display = 7'b0111111; //to display dash

  //4'd6 : sseg_temp = 7'b0000010; //to display 6

 // 4'd7 : sseg_temp = 7'b1111000; //to display 7

 // 4'd8 : sseg_temp = 7'b0000000; //to display 8

  //4'd9 : sseg_temp = 7'b0010000; //to display 9

  //default : sseg_temp = 7'b0111111; //dash

 endcase

 end

assign HEX_Display = {g, f, e, d, c, b, a} ; //concatenate the outputs to the register, this is just a more neat way of doing this.

// I could have done in the case statement: 4'd0 : {g, f, e, d, c, b, a} = 7'b1000000; 

// its the same thing.. write however you like it

 

assign dp = 1'b1; //since the decimal point is not needed, all 4 of them are turned off

 

 

endmodule

0 Kudos
1 Reply
RichardTanSY_Altera
1,214 Views

Hi, you can try out this example tutorial first to get a hand of it. 

FPGA Design with Verilog (7 segment) 

Then you can learn to multiplex in the below link, though it is in VHDL code. 

https://www.fpga4student.com/2017/09/vhdl-code-for-seven-segment-display.html

0 Kudos
Reply