Forum: FPGA, VHDL & Verilog Verilog VGA Out

Author: (unknown) (Guest)
Posted on:

Rate this post
0 useful
not useful
The following code fragment shows the score text in the top left corner. 
I need to move it to the top right corner.
How can I change the coordenates to do that?
I have been trying to do that, but no effects.

// score region
   //  - display two-digit score, ball on top left
   //  - scale to 16-by-32 font
   //  - line 1, 16 chars: "Score:DD Ball:D"
   assign score_on = (pix_y[9:5]==0)&&(pix_x[9:4]<16);
   assign row_addr_s = pix_y[4:1];
   assign bit_addr_s = pix_x[3:1];
   always @*
      case (pix_x[7:4])
          4'h0: char_addr_s = 7'h53; // S
          4'h1: char_addr_s = 7'h63; // c
          4'h2: char_addr_s = 7'h6f; // o
          4'h3: char_addr_s = 7'h72; // r
          4'h4: char_addr_s = 7'h65; // e
          4'h5: char_addr_s = 7'h3a; // :
          4'h6: char_addr_s = {3'b011, dig1}; // digit 10
          4'h7: char_addr_s = {3'b011, dig0}; // digit 1
          4'h8: char_addr_s = 7'h00; //
          4'h9: char_addr_s = 7'h00; //
          4'ha: char_addr_s = 7'h42; // B
          4'hb: char_addr_s = 7'h61; // a
          4'hc: char_addr_s = 7'h6c; // l
          4'hd: char_addr_s = 7'h6c; // l
          4'he: char_addr_s = 7'h3a; // :
          4'hf: char_addr_s = {5'b01100, ball};

Author: Michael Engel (cuby)
Posted on:

Rate this post
1 useful
not useful
The top right corner is already occupied by the "Ball:" text, so this 
must be either moved or not displayed at all. Changing the position of 
the "Score:"+digits should be easy, simply change the constants in the 
case statement, e.g., to start at 4'h8 for the "S" and then go on using 
4'h9, 4'ha... for the subsequent characters and the tens and ones 

In case other readers were wondering, this is code from a Verilog Pong 
implementation, which can e.g. be found at 

-- Michael

PS: I hope you didn't just try to get some easy homework solution for 
your FPGA class... :-)


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.