PC Peripherals for Technicians

Slides:



Advertisements
Similar presentations
MICROPROCESSOR BASED SYSTEM DESIGN
Advertisements

Number Systems and Codes
DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
ICS312 Set 2 Representation of Numbers and Characters.
VGA Text Mode An introduction to font selection and to reprogramming of the Character Generator ram.
SECTION 4a Transforming Data into Information.
1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter Video Graphics Mode Operation Chapter Video Graphics Mode Operation.
1 Graphic adapters and monitors – the summary. 2 Outline The summary of principles of displaying the information – adapters and monitors. Black and white.
Assembly Language for Intel-Based Computers Chapter 15: BIOS-Level Programming (c) Pearson Education, All rights reserved. You may modify and.
Craig Schock, 2003 Binary Numbers Numbering Systems Counting Symbolic Bases Common Bases (10, 2, 8, 16) Representing Information Binary to Decimal Conversions.
PC Peripherals for Technicians
Display Technology  Images stolen from various locations on the web...
Chapter 7 Programming with DOS and BIOS Function Calls Objectives: The use of DOS and BIOS function call How to read the PC’s keyboard How to send text.
Kip Irvine: Assembly Language for Intel-Based Computers
Screen Display Module M15.2 Sections 9.5, 13.1, 13.2.
Lecture 121 Lecture 12: VGA Video ECE 412: Microcomputer Laboratory.
Monitors and Sound Systems section 3A This lesson includes the following sections: · Monitors · PC Projectors · Sound Systems.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Video Monitor Uses raster scanning to display images
IE433 CAD/CAM Computer Aided Design and Computer Aided Manufacturing Part-2 CAD Systems Industrial Engineering Department King Saud University.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
The character data type char
Topics Introduction Hardware and Software How Computers Store Data
BIOS1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
Digital Design: From Gates to Intelligent Machines
Practical PC, 7th Edition Chapter 17: Looking Under the Hood
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
Decimal Binary Octal Hex
BIOS1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Video Monitor Uses raster scanning to display images –Beam of electrons illuminates phosphorus dots on the screen called pixels. Starting at the top of.
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DATA REPRESENTATION Dept. of Computer Science Engineering Islamic Azad University.
Informatics I101 February 25, 2003 John C. Paolillo, Instructor.
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
ICS312 Set 1 Representation of Numbers and Characters.
What is a computer? A computer is a device that:
EE4OI4 Engineering Design UP1core Library Functions.
Lab 8 Bit-Mapped Graphics Moving from text-based graphics to bit- mapped graphics. Easy to draw graphic points and lines using INT 10h, Function 0Ch (write.
Text-Mode Programming Question #1 What are the three levels of access to the video display when writing characters on the screen in text mode?
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
ECE 103 Engineering Programming Chapter 53 Generic Algorithms Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
Video Card CES Industries, Inc. Lesson 10.  Translates computer information of binary digital data into visual information that the monitor can understand.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
1 Information Representation in Computer Lecture Nine.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
CS 2130 Lecture 23 Data Types.
Systems Architecture, Fourth Edition 1 Data Representation Chapter 3.
Microprocessors Monday, Apr. 16 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Programming for GCSE Topic 2.2: Binary Representation T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science.
Lecture 11 Text mode video
Direct-Access Color Graphics Chapter 11. Graphics modes C++ provides a different combination of graphics characteristics. These characteristics include.
ECE291 Computer Engineering II Lecture 12 Josh Potts University of Illinois at Urbana- Champaign.
PRIMITIVE TYPES IN JAVA Primitive Types Operations on Primitive Types.
Flowchart of basic interrupt mechanism
Bits, Data Types, and Operations
Chapter 2 Bits, Data Types, and Operations
Machine level representation of data Character representation
Number Systems and Codes
Color Color is one of the most interesting aspects of both human perception and computer graphics. In principle, a display needs only three primary colors.
9/17/2018 Kiến Trúc Máy Tính.
Microprocessor and Assembly Language
Interfacing Memory Interfacing.
Number Systems and Codes
Ch2: Data Representation
ASCII Character Codes nul soh stx etx eot 1 lf vt ff cr so
Cosc 2P12 Week 2.
Chapter 2 Data Representation.
Number Systems Lecture 2.
Text Representation ASCII Collating Sequence
Presentation transcript:

PC Peripherals for Technicians Mar 1998 PC Peripherals for Technicians Chapter 3.2 - Video Text Mode Operation Systems Manufacturing Training and Employee Development Copyright © 1998 Intel Corp. Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 Text Mode Operation OBJECTIVES: At the end of this section, the student will be able to do the following: Discuss Video Display Modes in a Graphics System. Discuss the ASCII standard. Explain the Text Mode Video Buffer data format. Discuss Text Mode character fonts. Describe the attribute byte & the palette registers. Discuss color generation using the Video DAC. Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 Display Modes Video subsystems operate in multiple display modes which control certain aspects of the video operation. Text OR Graphics; Screen Resolution; Number of colors. Numerous control registers put the video adapter hardware in a state that will allow it to produce the indicated mode. This is almost always accomplished with BIOS calls. Video modes are changed using BIOS software interrupt INT 10h, or through a high-level construct such as the int86() function in Microsoft C. Default Mode is Text Mode 03h The initial video mode is an 80-column alphanumeric mode (03h) set by the ROM BIOS during POST. Text modes display alphanumeric characters only. Rev. 2.0 Sys MFG Training/Employee Development

Modes supported BIOS (Partial list) PC Peripherals for Technicians Mar 1998 Modes supported BIOS (Partial list) CGA EGA VGA MDA EGA EGA EGA EGA VGA VGA VGA Text Graphics Mode Emul. Res. Type Max Colors Scheme Char. Box Max. Pages Buff. Start 0,1 2,3 2,3! 4,5 6 7 7! D E F 10 11 12 13 320x200 320x350 360x400 640x200 640x350 720x400 720x350 640x480 8 1 4 2 16/256k 4/256k 2/256k MDA Mono VGA Mono Mono 16/356k 256/256k 40x25 80x25 80x30 8x8 8x14 9x16 9x14 8x16 B8000h B0000h A0000h ! - Indicates power-on default mode 3! - Color monitor is attached 7! - Monochrome monitor is attached Rev. 2.0 Sys MFG Training/Employee Development

Characteristics of VGA Mode 03h PC Peripherals for Technicians Mar 1998 Characteristics of VGA Mode 03h Characteristics of VGA Mode 03h: Video Buffer @ B8000 80 Characters/line; 25 text lines frame 4000 bytes of Memory used (4000t = FA0h) 80 x 25 = 2000 characters 2000 chars * 2 bytes/char = 4000 bytes. Character size = 9 x 16 Resolution = 720 pixels x 400 raster lines 720 pixels per horizontal line 720 / 9 pixels/char -> 80 char/line 400 vertical lines 400 / 16 lines/char -> 25 text lines 15 7 6 5 4 3 2 1 0 2 4 5 9 1 3 6 7 8 10 11 12 13 14 Rev. 2.0 Sys MFG Training/Employee Development

Characteristics of VGA Mode 03h PC Peripherals for Technicians Mar 1998 Characteristics of VGA Mode 03h Characteristics of VGA Mode 03h Horizontal Freq. = 31.5 KHz (lines/sec) Vertical Freq = 70 Hz (frames/sec) 31.5 KHz / 70 Hz ~ 449 lines per frame Only 400 displayed due to overscan Dot Clock = 28.322 MHz (28,322,000 dots per second) 28.322 MHz / 31.5 KHz = 900 dots/line 100 chars/ line * 9 dots / char = 900 dots/line Only 80 chars/line displayed due to overscan Number of colors = 16 (2 4 = 16) Attribute Byte is two 4-bit fields: Foreground Color: Bits 0-3 Background Color: Bits 4-7 Displayed Video Buffer area 720 pixels x 400 lines Rev. 2.0 Sys MFG Training/Employee Development

Mode 3: Display Memory Map PC Peripherals for Technicians Mar 1998 Mode 3: Display Memory Map Bit Planes 0, 1 B8000 B8F9F B9000 B9F9F BA000 BAF9F Page 0 Bit Planes 0, 1 Display Data 0000 0000 4000 Bytes Page 1 3999 4000 4095 0F9Fh 0FA0h 0FFFh Page 2 96 Bytes Unused Typical Page: 80x25 = 4000 Bytes A Display Page is one screen of text. Int 10h Function 5 sets the active page. BE000 BEF9F BF000 BFF9F Page 6 Page 7 THE 32K BETWEEN B8000 - BFFFF CAN HOLD UP TO 8 DISPLAY PAGES (8 * 4096 = 32K) NOTE: The memory between A0000h & B7FFFh is not used for display in this mode. Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 ASCII Standard American Standard Code for Information Interchange ASCII (pronounced “askey”) is a 7 bit code used to achieve compatibility between data services. The ASCII standard ensures that each of the common characters are assigned a unique code that is the same, regardless of keyboard, computer or monitor. Common characters include: Alphabet: Upper & lower case (A,a,B,b, ... Z,z) Numbers: (0,1,2...8,9) Symbols: (@, $, [, ~, etc) Non printable characters: Control chars (^G, ^H), etc. Extended ASCII characters includes codes for multiple keys (e.g. - CTL-ALT-DEL). Rev. 2.0 Sys MFG Training/Employee Development

Decimal To Hex to ASCII Conversion PC Peripherals for Technicians Mar 1998 Decimal To Hex to ASCII Conversion Dec Hex ASCII 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 15 NAK 23 24 25 26 27 28 29 30 31 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1-XON DC2 DC3-XOFF DC4 NAK SYN 23 ETB CAN EM SUB ESC FS GS RS US 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 16 23 15 NAK 1A 1B 1C 1D 1E 1F 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 22 2A 2B 2C 2D 2E 2F 3A 3B 3C 3D 3E 3F SP ! “ # $ % & ‘ ( ) * + , - . / : ; < = > ? 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 4A 4B 4C 4D 4E 4F 5A 5B 5C 5D 5E 5F @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z { \ } ^ _ 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 6A 6B 6C 6D 6E 6F 7A 7B 7C 7D 7E 7F a b c d e f g h i j k l m n o p q r s t u v w x y z | ~ DEL Rev. 2.0 Sys MFG Training/Employee Development

Putting a character on the screen PC Peripherals for Technicians Mar 1998 Putting a character on the screen BIOS ( INT 10h) Dot Stream To Monitor A 41 07 Video RAM ASCII Char Code 41h 07h ATTR Info (colors) Video Controller Video Signal Generator CRT Controller Alphanumeric Character Attribute Decoder Color & Intensity Dot Pattern Horiz & Vert Timing BUS Interface Microprocessor O/S or Application Software Write “A” on Screen - Call INT 10h AH=09 AL=41 Rev. 2.0 Sys MFG Training/Employee Development

Putting a character on the screen PC Peripherals for Technicians Mar 1998 Putting a character on the screen In Text Mode each character is represented in the Video Buffer by a pair of bytes: The first byte represents the character’s ASCII value. The second byte represents the character’s attribute (i.e. color of foreground/background, blinking, intensity) The Video Controller reads out the character codes and attributes simultaneously from the video buffer. Each location in the video hardware’s display buffer maps to a location on the display screen. The first byte of the display buffer maps to the top, leftmost point on the screen. As memory addresses increase, the screen location moves from left to right & top to bottom. Rev. 2.0 Sys MFG Training/Employee Development

Putting a character on the screen PC Peripherals for Technicians Mar 1998 Putting a character on the screen Examining the contents of the video buffer shows how the data corresponds to the characters on the screen AMIBIOS (C) 1992 American Megatrends, Inc BIOS Version 1.00.02.CA3C 0008192 KB Please Wait... Image on screen >byte 0b8000p length 40 (ITP cmd to display memory) 0x0000000b8000P 41 07 4d 07 49 07 42 07 'A.M.I.B.' 0x0000000b8008P 49 07 4f 07 53 07 20 07 'I.O.S. .' 0x0000000b8010P 28 07 43 07 29 07 31 07 '(.C.).1.' 0x0000000b8018P 39 07 39 07 32 07 20 07 '9.9.2. .' 0x0000000b8020P 41 07 6d 07 65 07 72 07 'A.m.e.r.' 0x0000000b8028P 69 07 63 07 61 07 6e 07 'i.c.a.n.' 0x0000000b8030P 20 07 4d 07 65 07 67 07 ' .M.e.g.' 0x0000000b8038P 61 07 74 07 72 07 65 07 'a.t.r.e.' Video Buffer Each Character Code is followed by it’s Attribute Byte Rev. 2.0 Sys MFG Training/Employee Development

Putting a character on the screen PC Peripherals for Technicians Mar 1998 Putting a character on the screen Viewing the Video Buffer as Bit Planes Bit Plane 1 2000 bytes (7D0h) Bit Plane 0 C.0 B8000 C.1 B8002 C.79 B809E C.80 B80A0 C.81 B80A1 C.159 CHARACTER ATTRIBUTE A.0 B8001 A.1 B8003 A.79 B809F C.0. = Character position zero @ B8000 A.0. = Attribute position zero @ B8001 Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation First we’ll describe Font Generation from the Character Byte, then color generation using the Palette & the Attribute Byte. The number of text lines displayed depends on the vertical resolution: e.g. - The default text mode 03h (720 x 400) has 400 raster lines. The 9x16 FONT with a character matrix height of 16 pixels, produces 25 lines of text in mode 03h. 400 / 16 = 25 text lines and - 720 / 9 = 80 characters / line Other modes such as the 132x43 VGA text mode 54h (1056 x 350) use different character sets such as the 8 x 8 character matrix displaying 43 lines of text. e.g. - 350 / 8 = 43 text lines (Mode 54h: 1056 x 350) e.g. - 1056 / 8 = 132 characters (Mode 54h: 1056 x 350) Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation = Foreground color = Background color Character Box - Pixel pattern for “A” 9 X 16 VGA text-mode character box * The right-hand column of pixels is a duplicate of the pattern in Column 0 Data = 38h 00111000 binary Bit Pattern of font as stored in memory 15 7 6 5 4 3 2 1 0 * 2 4 5 9 1 3 6 7 8 10 11 12 13 14 00 38 6C C6 FE Characters can be 9 dots wide in some modes and 8 dots wide in others. Default VGA Text Video Mode 3 Character Row #’s Note: The 9th pixel is usually blank except for ASCII codes C0h-DFh. These characters (used for drawing frames & borders) create unbroken horizontal lines that can be connected without any space in between them. Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation Because the 8-bit ASCII codes can’t be directly displayed on the the screen, they are translated by the hardware Alphanumeric Character Generation circuitry into the pixel patterns corresponding to those codes. e.g. 41h = “A” Regardless of the fonts character size, 32 (20h) bytes is reserved for each of the 256 characters. The BIOS contains a default table of character bit patterns. Each character table occupies 8 KB of memory. 32 bytes/ character * 256 characters = 8192 bytes. Up to 8 character sets can be resident in Bit Plane 2. 8 * 8KB = 64KB (A0000 - AFFFF) Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation 32 (20h) bytes are reserved for each of the 256 character fonts Character Generator would use ASCII code of 41h to get the start address of the bit patterns for font “A” to display. e.g. 41h x 20h = 820h (offset from base of A0000h) Attribute Controller (Palette) CRT Character Gen [Lookup Table] (Bit Plane 2) e.g. A0823 Character Row (e.g. 3) Latch Memory Addr (e.g. B8000) Dots (41h) Character Memory Bit Plane 0 (07h) Attribute Memory Bit Plane 1 (e.g. B8001) Video Buffer (DRAM) R G B Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation The Character Generator uses a Bit plane 2 as a Lookup Table to translate the ASCII value into a matrix of dots called a character box or cell to display on the screen. The default font is automatically copied from ROM to video memory map 2 when a TEXT display mode is selected via the BIOS. Direct access by the CPU to Bit plane 2 is not allowed when the Video Controller is programmed during POST. Bit plane 2 (which is loaded by the BIOS during POST) is accessed internally by the Video Controller hardware and is not normally visible to the programmer. To be able to read the bit pattern, it is necessary to re-program the video controller so the automatic odd/even addressing shuffle in text mode is not utilized. Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation The 32 bytes stored in Bit Plane 2 for ASCII code 41 are: 0x0000000a0820P 00 00 10 38 6c c6 c6 fe '...8l...' 0x0000000a0828P c6 c6 c6 c6 00 00 00 00 '........' 0x0000000a0830P 00 00 00 00 00 00 00 00 '........' 0x0000000a0838P 00 00 00 00 00 00 00 00 '........' Note: Address A0823h contain 38h (0011 1000 binary) The above pattern was read after programming the Video Controller to read Map 2 (not normally visible to the programmer). 32 (20h) bytes are reserved for each character. The start address is calculated as follows for “A” (41h): A0000h + (20h * 41h) => A0000h + 820h => A0820h The start address calculated for “a” (61h) would be: A0000h + (20h * 61h) => A0000h +C20h => A0C20h Rev. 2.0 Sys MFG Training/Employee Development

Text Mode Character Generation PC Peripherals for Technicians Mar 1998 Text Mode Character Generation Character Fonts - Bit Plane 2 9 X 16 VGA text-mode character box 15 7 6 5 4 3 2 1 0 * 2 4 5 9 = Foreground color = Background color 1 3 6 7 8 10 11 12 13 14 0a082b 0a082d 0a082e 0a0820 0a0821 0a0823 0a0822 0a0824 0a0825 0a0826 0a0827 0a0828 0a0829 0a082a 0a082c 0a082f 00 38 6C C6 FE Character Generator would use ASCII code of 41h to get the start address of the bit patterns for font “A” to display. e.g. 41h x 20h = 820h NOTE: Offset of each scan line from start address of ASCII 41h. e.g. 4th scan line (Char Row 3) addr => 820+3= 823h A0823h = 38h (0011 1000 binary) To display 1 row of characters, the CRTC reads out 80 8-bit codes from character memory 16 times in succession for an 80 x 25 display. Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - Text Mode 3 PC Peripherals for Technicians Mar 1998 Color Generation - Text Mode 3 Now we’ll describe the Attribute Byte and Color Generation In alphanumeric modes, the microprocessor writes each symbol to the video buffer as a series of 2 bytes. e.g. B800:0 = 41h, B800:1 = 07h Low-order byte = (41h); High-order byte (07h) Low-order byte 7 6 5 4 3 2 1 0 8-bit character code 4-bit foreground attribute 4-bit background attribute High-order byte Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - Text Mode 3 PC Peripherals for Technicians Mar 1998 Color Generation - Text Mode 3 The second byte represents the character’s attribute (i.e. color of foreground/background, blinking, intensity) Video Buffer (DRAM) Attribute Controller (Palette) CRT Character Gen [Lookup Table] (Bit Plane 2) e.g. A0820 Character Row Latch Memory Addr Dots (41h) Character Memory Bit Plane 0 (e.g. B8000) (07h) Attribute Memory Bit Plane 1 (e.g. B8001) R G B Each attribute nibble selects registers in the color palette Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - Text Mode 3 PC Peripherals for Technicians Mar 1998 Color Generation - Text Mode 3 ATTRIBUTE BYTE: The Video hardware translates the attribute nibbles into the indicated foreground & background colors. e.g. [0000 0111] -> 07h = Normal (white on black) e.g. [0000 1111] -> 0Fh = High Intensity e.g. [1000 0001] -> 81h = Blinking Blue Attribute Bits 7 - Blinking (Note: No intensity component) 6 - Background color - Red component 5 - Background color - Green component 4 - Background color - Blue component 3 - Foreground color - Intensity component 2 - Foreground color - Red component 1 - Foreground color - Green component 0 - Foreground color - Blue component Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette The color palette is a lookup table consisting of 16 six-bit values in the Attribute Controller. Port 3C0, 3C1 Offset 00-0Fh (16 registers) Each character can be displayed in any of 16 foreground colors (bits 3-0) and 8 background colors (bits 6-4). One reason for using a color palette is that the total number of possible colors can be greater than the number of colors that can be displayed simultaneously 16 colors simultaneously out of 64 colors combinations. A total of 64 colors combinations are available with 6 bits. (26 = 64) With 16 registers, 16 colors can be loaded into the Palette Registers at the same time. Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette Each of the 16 Palette Registers contains six bits. On earlier EGA cards, these 6 bits directly correspond to the signals going to the monitor. The EGA TTL level monitor color signal pins were: RED, red, GREEN, green, BLUE, blue where each color had 2 signals, one representing a brighter, more intense display (r,g,b) and the other for a normal display (RGB). Note: VGA uses analog signal levels and the 6 bits in the Palette Registers are inputs to the Video DAC (Digital to Analog Converter) which can produce the same colors as on a TTL EGA system. Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette 7 6 5 4 3 2 1 0 X X r g b R G B BLUE GREEN RED blue green red X X 0 0 0 0 1 0 => Green Memory Buffer Example: B8000 = 41 (ASCII Capital A) B8001 = 52 (Attribute) Foreground Pixels = 2 Background Pixels = 5 Produces Green Character “A” on magenta background TO DAC e.g. - Attribute Nibble = 2h: Palette = 2h = xx00 0010b xx00 0010=> Green (G) Foreground Pixels e.g. - Attribute Nibble = 5h: Palette = 5h = xx00 0101b xx00 0101b => Magenta (R+B) ~ purple Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette 7 6 5 4 3 2 1 0 X X r g b R G B BLUE GREEN RED blue green red X X 0 0 0 1 1 1 => White Memory Buffer Example: B8000 = 41 (ASCII Capital A) B8001 = 07 (Attribute) Foreground Pixels = 7 Background Pixels = 0 Produces White Character “A” on black background TO DAC e.g. - Attribute Nibble = 7h: Palette = 7h = xx00 0111b xx00 0111b => White (R+G+B) Foreground Pixels e.g. - Attribute Nibble = 0h: Palette = 0h = xx00 0000b xx00 0000=> Black (no colors) Background Pixels Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette RED, red, GREEN, green, BLUE, blue where each color has 2 signals, one representing a brighter, more intense display (r,g,b) and the other for a normal display (R,G,B). Note: r, g, & b, are all selected when Bit 3 of foreground Attribute nibble is a one. e.g. - 9h = 1001b for “light blue” [intense] X X r g b R G B I R G B 7 6 5 4 3 2 1 0 X X r g b R G B BLUE GREEN RED blue green red X X 1 1 1 0 0 1 => Light Blue Light Blue (r+g+b + B) [XX11 1001] white + Blue Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette The following 2 tables show the relationship between the Attribute nibble value, the Palette Register value, and the color displayed. (Values loaded by BIOS) Attribute Nibble Palette Value Default Color 0h - 0000 00h Black [ xx00 0000 ] 1h - 0001 01h Blue (B) [ xx00 0001 ] 2h - 0010 02h Green (G) [ xx00 0010 ] 3h - 0011 03h Cyan (G+B) [ xx00 0011 ] 4h - 0100 04h Red (R) - [ xx00 0100 ] 5h - 0101 05h Magenta (R+B) [ xx00 0101 ] 6h - 0110 14h Brown (g+R) [ xx01 0100 ] 7h - 0111 07h White (R+G+B) [ xx00 0111 ] e.g., Black Background Modified Brown e.g., White Foreground Rev. 2.0 Sys MFG Training/Employee Development

Color Generation - The Palette PC Peripherals for Technicians Mar 1998 Color Generation - The Palette Relationship between the Attribute nibble value, the Palette Register value, and the color displayed. (Cont.) Note: r, g, & b are all selected when Bit 3 of foreground Attribute nibble is a one. e.g., 9h = 1001b for “light blue” [intense] Attribute Nibble Palette Value Default Color 8h - 1000 38h Dim White (r+g+b) [xx11 1000] Dark Gray 9h - 1001 39h Light Blue (r+g+b+B) [xx11 1001] Ah - 1010 3Ah Light Green (r+g+b+G) [xx11 1010] Bh - 1011 3Bh Light Cyan (r+g+b+G+B ) [xx11 1011] Ch - 1100 3Ch Light Red (r+g+b+R) [xx11 1100] Dh - 1101 3Dh Lt Magenta (r+g+b+R+B) [xx11 1101] Eh - 1110 3Eh Yellow (r+g+b+R+G) [xx11 1110] Fh - 1111 3Fh Int. White (r+g+b +R+G+B)[xx11 1111] Rev. 2.0 Sys MFG Training/Employee Development

Colors: The Digital to Analog Converter PC Peripherals for Technicians Mar 1998 Colors: The Digital to Analog Converter VGA uses ANALOG SIGNAL LEVELS to drive the monitor, and the 6 bits in the Palette Registers are inputs to the Video DAC. The 6-bit Palette Register output combined with 2 bits from a Color Select register to form an 8-bit value passed to the DAC. 4-bit Attribute From Video Buffer (1 of 16 Registers) 6-bits (bits 0-5) r,g,b,R,G,B (1 of 64 8-bits (1 of 256 [FFh] [4 banks of 64 [3Fh] colors] bits 6 & 7 (Mode 3=00) Attr Ctlr Palette Registers 3C0, 3C1 Offsets 00-0Fh Attribute Controller Color Select Register Ports 3C0, 3C1 Offset 14 - Bits 3 & 2 (1 of 4 banks) VIDEO DAC 3C7, 3C8, 3C9 00-FFh [Note: 00-3Fh w/ 6 bits] R G B To Monitor Analog Output 0 - 0.7 V Attribute Mode Control Reg Offset 10 - Bits 7 = 0 (Palette Size Select - 16 color 4 banks of 64 entries) Additional information NOT covered in class Rev. 2.0 Sys MFG Training/Employee Development

Colors: The Digital to Analog Converter PC Peripherals for Technicians Mar 1998 Colors: The Digital to Analog Converter The Video DAC use the 8-bit input to select one of its 256 color registers. Each of DAC 256 color registers contains an 18-bit RGB specification (6-bits for each color: 3 x 6 = 18) The 4-bit attribute value decodes into a set of three analog RGB values to the monitor. The larger the number contained in the DAC register, the greater the analog output voltage. By default, the Video BIOS initializes the first 64 DAC registers with RGB values to produce the the same 64 colors available on the EGA. The 6 bits from the Palette Registers select 1 of 64 (00 - 3Fh) registers in the DAC. Rev. 2.0 Sys MFG Training/Employee Development

Colors: The Digital to Analog Converter PC Peripherals for Technicians Mar 1998 Colors: The Digital to Analog Converter BIOS initializes the DAC to emulate EGA in Text Mode: 00h => XX00 0000b => 00t: Black (0 v - 0% Saturation) 15h => XX01 0101b => 21t: Dim (Low Intensity - 33% ) 2Ah => XX10 1010b => 42t: Normal (Medium Int. - 66%) 3Fh => XX11 1111b => 63t: High (High Intensity (0.7 v -100%) Palette Value - Color (Offset in DAC) DAC Red Green Blue 00 - Black 00 01 - Normal Blue (B) 2A 02 - Normal Green (G) 03 - Cyan (G+B) 04 - Normal Red (R) 05 - Magenta (R+B) 14 - Brown ( g+R) 15 07 - White (R+G+B) 39 - Light Blue ( r+g+b+B) 3F 3C - Light Red ( r+g+b+R) 3F - Bright White Note that the 64t bits are divided into 3 groups with a separation of 21t between each intensity level. The larger the number contained in the DAC register, the greater the analog output voltage. NOTE: This is only a partial list of the 256 DAC registers. Rev. 2.0 Sys MFG Training/Employee Development

Colors: The Digital to Analog Converter PC Peripherals for Technicians Mar 1998 Colors: The Digital to Analog Converter I R G B X X 1 1 1 1 0 0 Bit 3 1 Bit 2 Bit 1 Bit 0 Ch => 1100 From Video Buffer Foreground Color Value (e.g.-Low Nibble from B80001) Palette Reg Number (Ch) Palette Register Reg 15t Data = 3F Reg 15t Data = 3E Reg 13t Data = 3D Reg 12t Data = 3C Reg 03t Data = 03 Reg 02t Data = 02 Reg 01t Data = 01 Reg 00t Data = 00 Video DAC 3F 15 15 00 00 00 00 00 2A 00 2A 00 00 2A 2A 3F 3F 3F 3F 3F 15 3F 15 3F FFh=255t 254t 253t 252t 3Ch=060t 003t 002t 001t 000t Color # R G B Notes: 1- Attribute C hex produces Light Red (White + Red) 2- 3Ch=60t=xx11 1100 Binary 60t -> decimal (base ten) 3Ch => xx11 1100 6 bits in Palette Reg selected by 0Ch address 3Ch => 3F 15 15 18 bits in DAC selected by 3Ch address I R G B Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 REVIEW & SUMMARY WE HAVE DISCUSSED THE FOLLOWING: Video Display Modes in a Graphics System Video subsystems operate in multiple display modes which control certain aspects of the video operation. Text OR Graphics; Screen Resolution; Number of colors. Characteristics of VGA Mode 03h Video Buffer @ B8000h Character size = 9 x 16 Resolution = 720 pixels x 400 lines 80 Characters/line; 25 lines frame (screen) 4K of Memory used (2K chars * 2 bytes/char = 4K bytes) 15 7 6 5 4 3 2 1 0 2 4 5 9 1 3 6 7 8 10 11 12 13 14 Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 REVIEW & SUMMARY The ASCII standard. The ASCII standard ensures that each of the common characters are assigned a unique 7 bit code that is the same, regardless of keyboard, computer or monitor. The Text Mode Video Buffer data format. In Text Mode each character is represented in the Video Buffer by a pair of bytes: The first byte represents the character’s ASCII value. The second byte represents the character’s attribute Each location in the video hardware’s display buffer maps to a location on the display screen. As memory addresses increase, the screen location moves from left to right & top to bottom. Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 REVIEW & SUMMARY Text Mode character fonts. The Character Generator uses a Bit plane 2 as a Lookup Table to translate the ASCII value into a matrix of dots called a character box or cell to display on the screen. The font is automatically copied from ROM to video memory map 2 when a TEXT display mode is selected via the BIOS. The attribute byte. The Video hardware translates the attribute nibbles into the indicated foreground & background colors. Attribute Bits 7 - Blinking (Note: No intensity component) 6 - Background color - Red component 5 - Background color - Green component 4 - Background color - Blue component 3 - Foreground color - Intensity component 2 - Foreground color - Red component 1 - Foreground color - Green component 0 - Foreground color - Blue component Background Nibble Foreground Nibble Rev. 2.0 Sys MFG Training/Employee Development

PC Peripherals for Technicians Mar 1998 REVIEW & SUMMARY The palette registers. Each of the 16 Palette Registers contains six bits. r, g, & b, are all selected when Bit 3 of foreground Attribute nibble is a one .e.g. - 9h = 1001b for “light blue” [intense] Color generation using the Video DAC. VGA uses analog signal levels to drive the monitor, and the 6 bits in the Palette Registers are inputs to the DAC. X X r g b R G B I R G B X X 1 1 1 0 0 1 4-bit Attribute From Video Buffer (1 of 16 Regs) 6-bits (bits 0-5) r,g,b,R,G,B (1 of 64 Registers) 8-bits (1 of 256 [FFh] [4 banks of 64 [3Fh] colors] bits 6 & 7 (Mode 3=00) Attr Ctlr Palette Registers 3C0, 3C1 Offsets 00-0Fh VIDEO DAC 3C7, 3C8, 3C9 00-FFh [Note: 00-3Fh w/ 6 bits] R G B To Monitor Analog Output 0 - 0.7 V End of Chapter 3-2 Rev. 2.0 Sys MFG Training/Employee Development