FAMUFSU College of Engineering EEL 3705 3705 L

  • Slides: 20
Download presentation
FAMU-FSU College of Engineering EEL 3705 / 3705 L Digital Logic Design Spring 2007

FAMU-FSU College of Engineering EEL 3705 / 3705 L Digital Logic Design Spring 2007 Instructor: Dr. Michael Frank Modules #90 -99 (Extra Slides): Design Examples Module #92: VGA Text Output – ASCII Character Generator 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 1

FAMU-FSU College of Engineering Character Codes ASCII, Unicode 10/25/2021 M. Frank, EEL 3705 Digital

FAMU-FSU College of Engineering Character Codes ASCII, Unicode 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 2

FAMU-FSU College of Engineering The ASCII Character Code American Standard Code for Information Interchange

FAMU-FSU College of Engineering The ASCII Character Code American Standard Code for Information Interchange Standards ANSI INCITS 4 -1986 (R 2002), ANSI X 3. 4 -1986 (R 1997), ISO 646 -1983 Control code glyphs; normally not printed. From ANSI X 3. 32 -1973, ISO 2047 -1975 Meanings of control codes are defined at: http: // www. cs. tut. fi/~jkorpela/chars/c 0 optional bit may be 0, or used for parity or for code extensions 8 th 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 3

FAMU-FSU College of Engineering Symbols I’ll Use for the Non-Printing ASCII Control Characters You

FAMU-FSU College of Engineering Symbols I’ll Use for the Non-Printing ASCII Control Characters You can insert any of these special symbols into MS Word documents using the Insert Symbol menu command a Unicode font such as Arial Unicode MS. 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 4

FAMU-FSU College of Engineering ASCII Code Example o Represent the string “Hello, World!” in

FAMU-FSU College of Engineering ASCII Code Example o Represent the string “Hello, World!” in ASCII code as a sequence of hexadecimal digits. Use the unit separator (∫) control character to delimit the end of the string. H e l l o , ␣ W o r l d ! ∫ 48 65 6 c 6 c 6 f 2 c 20 57 6 f 72 6 c 64 21 1 f n Or, written out as a single enormous number, this is: 4865, 6 C 6 C, 6 F 2 C, 2057, 6 F 72, 6 C 64, 211 F 16. o 10/25/2021 Writing commas between every 4 hex digits for readability. M. Frank, EEL 3705 Digital Logic, Fall 2006 5

FAMU-FSU College of Engineering VGA Text Display Programming Examples Character Generator and Text Page

FAMU-FSU College of Engineering VGA Text Display Programming Examples Character Generator and Text Page Display for the FLEX 10 K 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 6

FAMU-FSU College of Engineering Goal of Next Example: Make the FLEX Display my ASCII

FAMU-FSU College of Engineering Goal of Next Example: Make the FLEX Display my ASCII Table! 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 7

FAMU-FSU College of Engineering VGA_char: Initial circuit for testing ability to display text characters

FAMU-FSU College of Engineering VGA_char: Initial circuit for testing ability to display text characters n n n Uses the same VGA_driver module. Down-samples to 320× 240 resolution. Fills display w. an 80× 24 array of null symbols “∅”. Each glyph rendered as 6× 10 fat (2× 2) pixels. White text on black background. Read and write ports are registered – this is actually unnecessary. 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 8

FAMU-FSU College of Engineering Design & Entry of Text Character Font o Hand-draw each

FAMU-FSU College of Engineering Design & Entry of Text Character Font o Hand-draw each character glyph as a 6× 8 block of pixels within an 8× 10 pixel character space. o Encode pixel bits in a. mif file used to initialize a ROM module for the font data. 10/25/2021 0 1 2 3 4 5 0 0 0 1 1 0 1 0 2 1 0 0 1 3 1 0 0 1 4 0 1 0 5 1 0 1 1 0 0 descender area 6 0 0 0 7 0 0 0 vertical spacing 8 9 6 7 NUL_glyph. mif file DEPTH = 8; WIDTH = 6; ADDRESS_RADIX = HEX; DATA_RADIX = BIN; CONTENT BEGIN 0 : 001101; 1 : 010010; 2 : 100101; 3 : 101001; 4 : 010010; 5 : 101100; 6 : 000000; 7 : 000000; END; M. Frank, EEL 3705 Digital Logic, Fall 2006 9

FAMU-FSU College of Engineering Output of VGA_char Example 10/25/2021 M. Frank, EEL 3705 Digital

FAMU-FSU College of Engineering Output of VGA_char Example 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 10

FAMU-FSU College of Engineering Design for a complete 128 -character ASCII font including color

FAMU-FSU College of Engineering Design for a complete 128 -character ASCII font including color glyphs for control pictures 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 11

FAMU-FSU College of Engineering Display circuit for 128 -character color font ASCII table Uses

FAMU-FSU College of Engineering Display circuit for 128 -character color font ASCII table Uses a 1, 024× 6 bit font pixel ROM and a 128× 3 bit (rgb) font color ROM. Note: We set the first two columns of each character (rather than the last 2) to be 0. This gives an extra 2 clock cycles of “breathing room” while the character pixel/color information is being fetched from ROM. 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 12

FAMU-FSU College of Engineering Successful Color Font Display (VGA_font_color project) ASCII Table repeats across

FAMU-FSU College of Engineering Successful Color Font Display (VGA_font_color project) ASCII Table repeats across screen 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 13

FAMU-FSU College of Engineering Close-Up Photo of One ASCII Table 10/25/2021 M. Frank, EEL

FAMU-FSU College of Engineering Close-Up Photo of One ASCII Table 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 14

FAMU-FSU College of Engineering Next example: Display a screenful of arbitrary text For example,

FAMU-FSU College of Engineering Next example: Display a screenful of arbitrary text For example, here is a screen design mocked up as a table in MS Word 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 15

FAMU-FSU College of Engineering Use Sci. TE and Hex. Edit to create an ASCII

FAMU-FSU College of Engineering Use Sci. TE and Hex. Edit to create an ASCII text file containing the raw character data DEL character 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 16

FAMU-FSU College of Engineering Write a short C program to convert the raw text

FAMU-FSU College of Engineering Write a short C program to convert the raw text data to MIF file format 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 17

FAMU-FSU College of Engineering Modify logic design to fetch the character codes to display

FAMU-FSU College of Engineering Modify logic design to fetch the character codes to display from a ROM 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 18

FAMU-FSU College of Engineering Screenshot showing successful display of the custom 40× 24 -character

FAMU-FSU College of Engineering Screenshot showing successful display of the custom 40× 24 -character page of text Feature idea for next version: provide the option not to explicitly draw all of the normally nonprinting characters, especially SP (␣). . . Activate the suppress_space option with a pushbutton… 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 19

FAMU-FSU College of Engineering Ideas for Further Work o Use the ROM to initialize

FAMU-FSU College of Engineering Ideas for Further Work o Use the ROM to initialize a RAM with modifiable character data. n o Create a PS/2 keyboard decoder n o Done in examples Implement a simple word-processing application Develop a simple machine language interpreter for a character-encoded instruction set. n o Make display of control characters a selectable option Then program some simple video games based on the text display! Also create some videogames in pure logic based on more direct use of the VGA driver (pong, etc. ) 10/25/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 20