TONT 37153 为什么 Windows 95 的定时器的运行频率是 55ms?

原文链接:https://devblogs.microsoft.com/oldnewthing/20041202-00/?p=37153

The story behind the 55ms timer tick rate goes all the way back to the original IBM PC BIOS. The original IBM PC used a 1.19MHz crystal, and 65536 cycles at 1.19MHz equals approximately 55ms. (More accurately, it was more like 1.19318MHz and 54.92ms.)

定时器的运行频率是 55ms 追根究底要回到原始的 IBM PC BIOS 上。最初的 IBM PC 使用了一颗 1.19MHz 的晶振,而 1.19MHz 上 65536 个时钟周期所需的时间大约就是 55ms。(更准确的说,应该是 1.19318 MHz 和 54.92ms。)

But that just pushes the question to another level. Why 1.19…MHz, then?

不过这样一解释只是将问题又推高了一个级别,为什么是 1.19 MHz 呢?

With that clock rate, 216 ticks equals approximately 3600 seconds, which is one hour. (If you do the math it’s more like 3599.59 seconds.) [Update: 4pm, change 232 to 216; what was I thinking?]

在这样的时钟频率下,216 个嘀嗒(tick)大约就是 3600 秒,也就是一小时。(精确一些的话,也可以说是3599.59 秒。)

What’s so special about one hour?

为什么『一个小时』这个周期那么特别呢?

The BIOS checked once an hour to see whether the clock has crossed midnight. When it did, it needed to increment the date. Making the hourly check happen precisely when a 16-bit tick count overflowed saved a few valuable bytes in the BIOS.

BIOS 每小时会检查一次系统时钟来确定是否跨越了午夜,当这种情况发生时,系统就会将日期向前推进一天。让这种检查机制发生在16位嘀嗒存储器溢出的时刻,可以在 BIOS 中节约宝贵的几个字节。

Another reason for the 1.19MHz clock speed was that it was exactly one quarter of the original CPU speed, namely 4.77MHz, which was in turn 4/3 times the NTSC color burst frequency of 3.5MHz. Recall that back in these days, personal computers sent their video output to a television set. Monitors were for the rich kids. Using a timer related to the video output signal saved a few dollars on the motherboard.

另一个采用 1.19MHz 时钟频率的原因是因为这个值正好是原始设计中 CPU 运行速度—— 4.77MHz ——的四分之一,而这正好又是 NTSC 制式的彩色信号频率的三分之四倍(译注:没有打错,4.77除以3.5约等于4除以3)。当年,个人电脑是将其视频信号输出到电视上的,那时候显示器是有钱人的玩具,而将定时器频率与视频信号关联起来则又在主板上省出了几美元的成本。

Calvin Hsia has another view of the story behind the 4.77MHz clock.

Calvin Hsia 提供了有关 4.77 MHz 时钟频率的另一个角度的故事。(译注:链接已失效)

(Penny-pinching was very common at this time. The Apple ][ had its own share of penny-saving hijinks.)

(那时候一分钱掰成两半花是很常见的事,Apple ][ 有其自己的省钱小妙招。)(译注:链接已失效)

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

 剩余字数 ( Characters available )

Your comment will be available after auditing.
您的评论将在通过审核后显示。

Please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically and never be audited.
请不要在评论中插入任何链接,否则将被自动归类为垃圾评论,且永远不会被提交给博主进行复审。

*