Computer Graphics Hardware: 1 The CRT Display
Computer Graphics Hardware: 1 The CRT Display
Kenneth H. Carpenter Department of Electrical and Computer Engineering Kansas State University January 26, 2001 - February 5, 2004
The most commonly used type of graphics display device at the present time is the CRT (cathode ray tube) monitor. This device consists of a picture tube similar to those used with television sets, and drive electronics suitable for computer display use. The computer must contain a graphics adapter that sends appropriate signals to the CRT monitor. Together a graphics output is obtained.
1.1
The CRT is a large glass envelope containing a high vacuum. The inside of the face has a coating of phosphorescent material. With a color display this material is actually three different phosphors that emit the three primary colors, red, green, and blue, when hit by an electron of suitable energy. There must be a mask behind the screen to cause electrons to only hit the color of phosphor intended. Fig. 1 shows the tube in front view, while Fig. 2 shows the tube from the side. The narrow end of the tube (the neck) at the left end in Fig. 2 contains three electron guns which emit three beams one for each of the primary colors. The electron gun is shown in enlarged form, along with the electrical connections to it in schematic form, in Fig. 3. A heater raises the temperature of the cathode material so that electrons have enough thermal energy to escape from the material. The electric eld produced by the high potential difference between the anode and the cathode cause a current of electrons to ow from the cathode towards the anode. A hole in the anode allows these electrons to go across the tube and hit the phosphor on the face of the tube. A grid between the anode and cathode has a charge that controls the current in the electron beam and thereby controls the rate at which photons are emitted by the phosphor and hence controls the brightness of the phosphors emitted light. 1
Figure 1: Front face of a CRT, showing scan lines (for only 28 lines vertical resolution).
Figure 2: Side view of a CRT, showing the major components (but not the purity magnets).
+ Vg
Deection coils produce magnetic elds which change with time and bend the path of the electron beam so that the phosphor dots that are illuminated on the screen change with time in a pattern that is called a raster. The currents through the coils are produced by the monitors deection circuitry. The vertical deection is at a much lower frequency, fv , than the horizontal deection, whose frequency is fh . Since the current in the deection coils cannot change instantaneously because of their inductance, there must be a nite time after the beam is deected all the way across the tube before it can be back at the starting side again. This time is called the retrace time. There is a horizontal retrace time and a vertical retrace time. During the retrace times the grid voltages on the electron guns are set to values to turn off the electron beam. The current in one of the deection coils is shown in Fig. 4. The raster pattern is shown (with a very small vertical resolution) on the face of the tube in Fig. 1. The number of vertical lines in this pattern is called the vertical resolution. It is usually a number like 480, 600, or 768, although it could be any value consistent with the computer graphics adapter and the driving software. The horizontal resolution is a number like 640, 800, or 1024, and is usually chosen so that the ratio of the horizontal to vertical resolution is 4/3, although it does not have to be. The horizontal resolution is the number of pixels displayed on a horizontal scan line. (A scan line is one of the horizontal traces of the electron beam during a horizontal period. The horizontal period is the amount of time that is the inverse of the horizontal frequency.) These pixels are formed on the video signal as a quantized stairstep wave. The width of these steps is the reciprocal of the dot clock frequency, fd . The heights of these steps are a function of the quantized pixel 4
current
time
ts tl
tr
Figure 4: Current in a CRT deection coil. ts is the time of the visible part of the scan, tr is the retrace time, and tl is the total time taken. The frequency is f = 1/tl .
values stored in the frame buffer in the graphics adapter. The mathematical relationship between the three frequencies, fv , fh , and fd is determined by the horizontal resolution, nh , the vertical resolution, nv , and the fraction of the horizontal visible scan time that is the retrace time, rh , and the fraction of the vertical visible scan time that is the retrace time, rv . (r = retracetime/non-retracetime, f = 1/(retracetime + non-retracetime)). The required relationships are thus: fh = nv (1 + rv )fv fd = nh (1 + rh )fh (1)
The frame buffer is the memory holding the information on what color to give each pixel of the display. The number of pixels is the product of the horizontal and vertical resolutions: np = nv nh . If each pixel could only be one of two colors, say black and white, then only one bit of memory would be needed to store this information black could be a zero and white a one. Thus the number of bits required for the frame buffer is the same as the number of pixels, and the number of bytes required would seem to be that number divided by eight but the conversion to bytes is more complicated as we will see later. If many colors are to be possible for the pixels there are two ways to specify them in the frame buffer. The rst is called rgb or sometimes truecolor if enough colors are possible to make the latter name reasonable. In this case there must be a set of bits to specify the red value, a set for the green value, and a set for the blue value all placed in the frame buffer. The second is called color index where a set of bits in the frame buffer gives the offset into another buffer called the color map which contains the actual rgb information for the pixel. For either rgb or color map mode of operation, the frame buffer will need multiple bits per pixel. These are usually organized into bit planes where each bit plane has one bit per pixel and there are as many bit planes as there are bits per pixel. In order for the computer processing of scan lines in the frame buffer to be efcient, the rst bit for a scan line in a bit plane should start on a natural boundary in the memory. This would be starting on a new byte, or multi-byte word, depending on the computer architecture. This means that if the horizontal resolution is not an integer times the number of bits in the memory word, then the last word for the line will contain unused bits. Thus the total memory bytes required for a bit plane may be more than the number of pixels divided by eight.
Example 1: Find the number of bytes required for a bit plane for 800 by 600 resolution when the word length is 4 bytes. Solution: 800/8 = 100 bytes per line are needed. Since 100 divides by 4, each scan line can start on a new word with no memory lost. So 100 600 = 60000 bytes are needed for a bit plane. Example 2: Find the number of bytes required for a bit plane for 800 by 600 resolution when the word length is 8 bytes. Solution: 800/8 = 100 bytes per line are needed. Since 100 does not divide by 8 without a remainder, each scan line will require 800/64 rounded up to an integer or 13 words = 104 bytes per line. Hence the total memory requirement for the bit plane is 104 600 = 62400 bytes. Example 3: How many kilobytes of memory are required for the bit planes in the previous two examples? Solution: 60000/1024 = 59 (rounded up to an integer) 62400/1024 = 61 (rounded up to an integer). Example 4: How many bytes are required for a color map for a color index frame buffer when each pixel in the frame buffer has 6 bits and each color is specied by 32 bits? Solution: 6 bits allows 26 = 64 choices. So the color map requires 64 entries. Each entry requires 32 bits, which is 4 bytes. Hence the color map requires 644 = 256 bytes. Example 5: Given that a monitor/graphics card/display combination must meet the following specications: vertical retrace time, trv 50s
horizontal retrace time, trh 5s dot clock frequency, fd 200MHz vertical frequency, fv 70Hz aspect ratio, nv = 3 nh 4 Find the maximum resolution, nh by nv , which satises these requirements while keeping both nh and nv integers. nh = tsh fd 3 nh tlh = tsv 4 nh 1 + trh = = tlh fd fh 3 1 nh tlh + trv = 4 fv 1 4 n2 + trh fd nh + fd (trv ) = 0 h 3 fv 1 1 4 ( trh fd )2 + ( trv ) fd 2 fv 3
1 nh = trh fd + 2
From inspection of this last equation, one can see that nh is maximized when fd is a maximum, fv is a minimum, and trv is a minimum. It is not so obvious what effect trh has on nh . So take a derivative: nh 1 = fd 1 + trh 2
1 2 trh fd ( 1 trh fd )2 + ( f1 2 v
trv ) 4 fd 3
<0
Since this derivative is always negative, nh is maximized by having trh a minimum. Thus the maximum is 1 nhmax = 5s 200MHz + 2 (500)2 + 1 4 5 105 2 108 70 3
nhmax = 1511.5 This value for nhmax must be reduced to the next integer divisible by 4 in order for nv to be an integer. Thus the nal solution is nh = 1508 3 nv = 1508 = 1131 4
to obtain the maximum resolution meeting all the requirements. (to be continued ... The date on the rst page will change when new material is added.) 8