22

Early home computers and game consoles output video to TV sets. The NTSC color clock frequency is 3.58 MHz. This informed the design of some video systems: http://pineight.com/mw/index.php?title=Dot_clock_rates

In particular, the Atari 2600 and Intellivision have one pixel per color clock, which is an obviously reasonable way to do it.

In the Apple II, the pixel clock is exactly twice the color clock. That makes sense because it has an option to turn off the color clock to generate reasonably crisp black-and-white text, then turn it on for the ability to generate artifact colors. This arrangement is very economical on parts count, which was important at the time.

The Atari 800 also has a pixel clock exactly twice the color clock, but as far as I know, it does not have the option to turn off the color clock. I'm trying to figure out what advantage it gains from this.

Specifically, I know if you run at an exact multiple of the color clock you can generate artifact colors, but surely you would get strictly better results by running exactly at the color clock and spending the memory and bandwidth on coloring fewer pixels? For example, say the Atari is operating in a mode with 1 bit per pixel, and generating artifact colors. Would it not be better off halving the pixel resolution and using 2 bits per pixel to just generate the wider range of colors directly?

There is a theory that says it makes sense to subsample the chroma information, in other words run the luma information at twice the frequency, because the luma information is more important, but as far as I can see based on e.g. https://en.wikipedia.org/wiki/Apple_II_graphics#Color_on_the_Apple_II the result of this is that the luma information simply gets converted into artifact colors, and you might as well have done this directly.

The situation with other machines like the NES looks even worse; it outputs somewhat more than one pixel per color clock, but less than two, so that the extra resolution will just convert into uncontrollable color fringing. On the face of it, the NES looks like a reduction of the resolution to 3.58 MHz pixel clock would produce better results for lower cost.

What advantage was there in going higher than one pixel per color clock (in machines that weren't going to turn off the color clock to generate black-and-white text like the Apple II), that I am missing?

5
  • 5
    The Atari 7800 probably shouldn't be included in your list of systems using 3.58MHz clocks. It can use that clock, but only does so when running in Atari 2600 compatibility mode. In native mode, it runs at 7.15MHz.
    – Jules
    Mar 21, 2018 at 18:11
  • @Jules Good catch! Fixed.
    – rwallace
    Mar 21, 2018 at 18:21
  • @Jules is there any relevance to the fact that 7.15 is 2x 3.58?
    – RonJohn
    Mar 21, 2018 at 21:49
  • @RonJohn IT people really really like multiplying stuff by 2 (usually stuff that has been already multiplied by 2).
    – xDaizu
    Mar 22, 2018 at 8:37
  • 2
    @Jules: The Atari 7800 has 160-pixel 5-bit line buffers. While it has some modes that split each pixel in half, using two of the bits plus a shared bit to select a left-half color, and the remaining two bits plus the shared bit to select a right-half color, transparency and motion are both reckoned on a 160-pixel (chroma x1) basis.
    – supercat
    Mar 22, 2018 at 14:54

4 Answers 4

20

I think you're conflating a few issues:

  1. being in-phase with the colour subcarrier;
  2. being sampled at a rate less than or equal to the colour subcarrier; and
  3. being sampled at an integer division of the colour subcarrier.

Being in-phase has exactly one effect: the artefacts on horizontal edges are consistent from one line to the next. The edges do not demonstrate chroma crawl.

Being at a rate less than or equal to the colour subcarrier also has exactly one effect: the true colour is going to be displayed somewhere, at least instantaneously, for each pixel.

Being at any integer divisor of the colour clock rate buys a third separate advantage: the pixel looks identical no matter where you put it on the display.

Nothing you can do is going to get you sharp pixels. All you're doing is picking which sort of artefacts you want.

However, you buy yourself a substantial disadvantage for being in-phase: NTSC signals are not normally in-phase by careful design. Being 50% out of phase makes the colour subcarrier's interference with the luminance signal much less visible. This stems from the original design requirement that a colour signal be viewable on an unfiltered black and white set from before the specification of colour without undue ugliness.

You buy yourself a substantial disadvantage for being less than or equal to the colour subcarrier frequency: low-resolution graphics.

You also buy yourself at least two substantial disadvantage if you optimise for being exactly on the colour subcarrier:

  1. your allegation that adding luminance information above and beyond the colour subcarrier frequency doesn't have a visible effect becomes true because the information you can add gets trapped in the vestigial parts of the subcarrier filtering. The actual rule is that with real-life filters, luminance information is liable to be lost only exactly when it is a multiple or divisor of the colour subcarrier — a comb filter is often considered the gold standard for chroma/luma separation and it has that name exactly because its frequency domain response graph spikes at integer intervals; and
  2. you've optimised for something that isn't actually a constant supposing you ever want to ship in a PAL country.

A chip you didn't mention is the Texas Instruments TMS 9918, which is in-phase but uses a non-integer divisor of the colour subcarrier (specifically, each pixel is 2/3rds of an NTSC cycle long). TI considered the constancy of horizontal colour artefacts to be a bug not a feature, dubbing it the rainbow effect. The linked memo shows a suggested modification that switches to ordinary chroma crawl. The non-engineers were apparently filing it as a bug report.

So, to summarise, if you are at exactly the colour subcarrier rate:

  • you look much worse on old and/or cheap black and white sets that don't filter the chroma, which the NTSC spec says they shouldn't have to;
  • you lose the fine luminance information as a simple practical consequence of the frequency response of ordinary separation filters;
  • except in PAL countries of course, where all the software you optimised for the results of your decision suddenly has the opposite design decision.

And to throw in a bonus argument of lesser weight: the SCART connector dates from the '70s. Even by 1982 all but the very cheapest European micros offered full RGB output — cf. the Oric or the Electron. Fixating on the subset of users that have a magically clean RF connection or a TV with composite connectors but not a SCART or S-Video socket isn't a very long-sighted strategy.

4
  • Except that Apple did also sell a card able to transfor the output into PAL at a reasonable price, so no NTSC decoder needed.
    – Raffzahn
    Mar 21, 2018 at 23:20
  • 1
    @Raffzahn I was unaware, as implied. Or 'wrong', as it's known. Will edit when not on a phone. It looks like they sold an adaptation of the Apple II that produced 50Hz output but ordinarily in black and white, and additionally sold what amounts to an NTSC decoder plus PAL encoder so you could upgrade your European machine to colour?
    – Tommy
    Mar 21, 2018 at 23:28
  • 1
    Na, not wrong. And yes, that's what they did. The split solution was a rather usefull one. First the modification on the basic II where rather small, thus easy to incooperate, but second, moving the colour generation onto a seperate card also enabled suport of the French SECAM system by offering a different encoder to support it.
    – Raffzahn
    Mar 21, 2018 at 23:44
  • "This stems from the original design requirement that a colour signal be viewable on an unfiltered black and white set from before the specification of colour without undue ugliness" - One wonders why the NTSC people bothered trying to jam the colour signal in with the black-and-white signal in the first place, instead of transmitting the pure B&W signal plus a separate colour overlay.
    – Vikki
    Sep 2, 2021 at 1:18
13

The pixel clock has to be fast enough to generate the number of pixels you want to display horizontally within the 56 microsecond scan line interval. At 3.58MHz, you only get about 200 pixels. This was fine for the Atari 2600 et al, which had 160 horizontal pixels, but the other systems you mentioned had higher horizontal resolution, so had to use a faster pixel clock.

Edited to clarify in response to comment:

This is actually useful. A standard definition TV is actually able to display more detail horizontally in terms of luminance (i.e. brightness) than it can in chrominance (i.e. "colour"). An NTSC TV is limited to approximately 200 transitions of colour in each horizontal line, due to the 3.58MHz colour signal bandwidth, but it can manage somewhere between 400 and 700 brightness transitions per line, depending on the quality of the electronics and how good the signal it's receiving is. PAL and SECAM have slightly higher figures, but in the grand scheme of things the difference is small.

This is why the last generation of systems that were designed primarily for TV output tended to have between 256 and 320 horizontal pixels (e.g. the Commodore 64 or Sinclair Spectrum) -- these were the most convenient figures that could reliably be displayed. 480 or 512 pixels might have been interesting, but a lot of users would never have been able to see the detail added by such high resolutions, so it wasn't commercially useful to provide it.

On the other end of the spectrum (no pun intended), DVD was designed with a horizontal resolution of 720 pixels because that was the lowest convenient resolution that was universally acknowledged to be beyond the capabilities of NTSC and PAL TVs. But it still encoded the picture in a format that had a lower chrominance resolution than luminance - it uses 4:2:0 subsampling, which actually has less resolution in the vertical direction than a TV signal has (although it probably has more in the horizontal direction).

5
  • Yes, but do they actually have higher horizontal resolution? Does e.g. the Atari 800 actually display 320 pixels horizontally? Or does it come out as 160 pixels with artifact colors?
    – rwallace
    Mar 21, 2018 at 18:19
  • 2
    Yes, they actually have higher resolution. Note that standard-definition TVs have higher resolution for luminance than they do chrominance. (See: wolfcrow.com/blog/understanding-luminance-and-chrominance) The end result is that the colour of adjacent pixels might not be easily distinguished, but variations of dark vs bright were noticeable. This was important for text display, for example: you couldn't realistically display 40 column text in 192 pixels: they'd have been too difficult to read. You could just about do 32 columns, but it wouldn't have been pretty.
    – Jules
    Mar 21, 2018 at 18:24
  • 3
    As implied in my answer, also don't forget the common-enough use case: child obtains microcomputer. Child hogs main TV. Parents seek cheapest solution, buy the cheapest available secondary set. This is the 1980s, so it's a 12" b/w set. It doesn't do luminance and chrominance separation at all, because the subcarrier is deliberately specified as out of phase so that it wouldn't have to, and that cuts $1.50 from the bill of materials. Child either sees more detailed luminance or a very ugly obviously out-of-spec version of the subcarrier. Possibly the computer gets returned as broken.
    – Tommy
    Mar 21, 2018 at 20:11
  • 2
    @rwallace: Machines with a "2x chroma" dot clock can, without creating artifacts, put a single white pixel anywhere that has at least two black pixels on each side, and can put a single black pixel anywhere that has two or more white pixels on each side. This isn't quite as useful as being able to freely place white and black pixels without restriction, but can still create a much wider range of graphics than would be possible with a "1x chroma" dot clock.
    – supercat
    Mar 21, 2018 at 22:03
  • 3
    @Tommy - "This is the 1980s, so it's a 12" b/w set" ... I'm pretty sure that the B/W set my parents gave me wasn't as big as 12"... I think it was either 9" or 10". Complete with analogue tuning dial rather than presets. Wasn't until 1987 or so they decided to spend the cash on a colour 14" set for me. :)
    – Jules
    Mar 22, 2018 at 2:30
9

Short Answer:

There is no relation.

What seems like a relaiton is non related coincidence.


Long Answer:

First of all, there is no colour clock. The mentioned frequency of 3.58 MHz is not a colour clock, but the carrier frequency used to modulate the encoded colour signal atop the basic B&W signal. There is no relation to RAM speed, pixel generation or alike. Especially nothing that needs to be adjusted to this clock, either direct or in any multiple thereof.

Computers are digital and use digital clocking. TV isn't.

The reason why this frequency is used that often in home computers is simple: cost. A 3.58 MHz crystal is dirt cheap compared to more 'logical' values. And that's not just by some pennies. They where the single most produced value. For example, in 1980 (just checked some magazines) a 4 MHz crystal (and next to any other) was around 4-5 USD, while a 3.58 MHz could be acquired at 0.87 USD. That's quite a lot to be saved for a mere 10% less speed.

Further, depending on the kind of video generation, the 3.58 MHz were needed to encode the colour signal. So instead of having two crystals, one for CPU and Memory, the other for signal generation, one was sufficient - saving even more.


Technical background: lines and pixel, and resolution vs. colour.

The colour signal in itself doesn't define any pixels, as it again is analogue. The colour carrier frequency is about 227.5 times the line frequency. Together with a usable line length of 52/64 this gives ~185 complete colour changes. In a digital system this would be the same as a maximum of 370 'colour' pixels.

Now colour is just some frosting atop a b&w base signal. This signal gives us the intensity of a spot and is again analogue. There is no pixelation. Sure, on Y a 'pixel' is formed by the lines used to draw the picture. So while this makes discrete steps along the vertical, horizontally any stepping between 1 (one pixel per line) and infinite is possible (*1). Due to analogue available bandwidth in a real world transmission system it's for all existing (classic) TV systems on this planet less than 320 vertical lines (*2). In today's terms that may be described as 640 pixels. In reality there are usually less than 550 usable.

So if we really want to talk about what amount of pixels is possible, we need to take both numbers into account. Up to ~370 distinct, non interacting colour positions and up to ~550 distinct B&W positions are possible. As a result any system producing with up to 370 pixel can be displayed on a TV based CRT system. Each of these pixels will be able to have any (displayable) colour at any (possible) intensity (*3).

With more than ~370 pixels per line, a classic colour TV will no longer be able to guarantee a distinct colour to each pixel. For example an orange pixel next to a yellow pixel might, even at 500 pixels per line, still come out well defined, while a blue instead will tend to look more like green. Now it depends on one pixel ahead if it will become blue over time or not. A sequence of blue and yellow dots will look like bluish green and yellowish green instead.

(No, this is not the (in)famous NTSC colour bleeding, though looking similar.)

(It also isn't the restriction of adjacent colours on an Apple II, as this is given through the encoding used by Woz.)

So, long story short: there is no direct relation between pixel clock, memory clock and colour carrier. If at all, it's within design decisions taken by whoever made a computer following certain design goals - usually price, thus reduction of components.


*1 - Okay, the X resolution is limited by the upper frequency the electron beam can be modulated, and even before that by the upper frequency the television signal allows. As a third limiter, usually somewhere in between, the colour mask further limits arbitrary changes.

*2 - Horizontal resolution is described in classic analogue TV as the number of vertical black lines on a white background that still can be displayed. Or in other words, that (sine) signal which still can be encoded as full transition between minimum and maximum intensity - which happens to be exactly the frequency assigned to a channel. For most TV systems something between 4 and 6 MHz

*3 - Well, since an analogue signal can not flip from on state to the exact opposite in zero time, there will be, in both cases (colour and intensity) border effects, which will become more and more visible as frequency (changes) close in to maximum distance and maximum frequency.

4
  • But there was surely a connection at least insofar as the Apple II used the exact frequency relationship to deterministically create artifact colors? Had the pixel clock not been exactly twice the color clock, there would still have been artifact colors but they would have been effectively random.
    – rwallace
    Mar 21, 2018 at 19:53
  • 1
    @rwallace No. At least not in relation to principal working. One could set up a seperate source for each of the shifted phase signals and mix tehn according tohe data read at a total different spead. But we are talking Woz her. A master in the arts of part reduction. According to his story, his whole idea to make the Apple II was to create a video logic where the digital output will, when fed to a NTSC screen, will be interpreted as a colour signal modulated atop a B&W signal. So, the usage is not related to pixelisation, but a clever setup to eliminate a seperate mixing and modulation circuit
    – Raffzahn
    Mar 21, 2018 at 20:10
  • 1
    @Raffzahn: On the Apple II, each scan line has 64 clock cycles that are 3.5 chroma clocks long and one which is 4 chroma clocks long. If the Apple II didn't add the extra half chroma clock, every other scan line would have the opposite color phase. Hi-res color software would need to be designed differently to accommodate that, but I would think graphics would likely look better. I wonder whether the hardware to do things that way would have been easier or more expensive than the hardware to add the extra 1/7 CPU cycle every scan line.
    – supercat
    Mar 21, 2018 at 22:07
  • 1
    @supercat In fact the timing logic is one of only two patents related to the II. The way the system clock is created at varying speed to accomodate saving circuitry is unique. The only answer to your question I can think of is that there was no further saving in chips. We know that Woz did put as much into software as possible to save even a single 7400 gate. The weired memory layout of all video modes is a direct result thereof. Woz prefered to save a few gates over than having continous video memory :))
    – Raffzahn
    Mar 21, 2018 at 22:14
8

Not sure if you should call it an advantage, but the Apple II used the double color clock frequency to create colors.

Consider two bit patterns,

0101010101
1010101010

On a monochrome display, they represent just a dotted pattern. On a color display, you have a signal with the frequency of the color clock, but with a different phase. And the phases produce colors, so you get different colors.

The downside is that you can't assign colors to single pixels this way; it's the combination of pixels that makes the color. Another downside is that you can't have black-white transitions anymore, these get the typical "color fringes".

The Apple goes even further, and uses one bit per seven pixels to allow another phase shift (90 degrees on top of the 180 degrees you get from the patterns), this way you get four colors, plus black and white.

Which is all you get in hires... (on an Apple II)

4
  • Right, if the Apple II was always in color mode then it would surely make more sense to just have actual colored pixels, but as it is the current way makes sense for it because it turns off the color clock in text mode. But it doesn't seem to make so much sense for systems that don't have the option to turn off the color clock.
    – rwallace
    Mar 21, 2018 at 18:20
  • 1
    @rwallace: I wonder if it would have added anything to the cost of the Apple II to make it so that hires mode could be used with chroma either enabled or disabled, based upon the state of the lores control bit?
    – supercat
    Nov 30, 2019 at 23:34
  • 2
    @supercat: I guess Woz had already optimized for IC count, and there were no gates left to implement that function (which would have been pretty cheap, a few gates at most). And BTW, the lack of such a function didn't prevent software being written for monochrome hires (which you got when using a monitor instead of TV): The phase shift bit would move a seven-pixel-block by half a pixel on monitors, and there were monochrome hires fonts which took advantage of that.
    – dirkt
    Dec 1, 2019 at 8:09
  • 1
    @dirkt: The annoyance with the present design is that if one is using a program like Bank Street Writer with a color television set or monitor, the presence of a chroma subcarrier will make text much harder to read than it would be without. Even if one turns the color knob to minimum to eliminate color fringes, many sets have a comb filter that would turn the middle portions of characters like "m" and "w" into gray blobs as opposed to patterns of vertical lines.
    – supercat
    Jun 8, 2020 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .