|
|
Episode 1: The Phantom 16-bit CPUBack in the dayI remember, back in the day, being deeply offended by the accusation that my TurboGrafX-16 was, in fact, a mere 8-bit system. I was horribly defensive and made claims like, "Look at the graphics! They're way better than 8-bit", to which my friends would make vague conciliatory gestures and hope I'd just shut up and play. I was offended on two levels. The first one, which I didn't realize at the time, was that I unconciously equated bits with penis size, and was effectively being accused of having a smaller one. The second was simply that I was so gullible as to naively believe the 16 in "TurboGrafX-16" meant something technically.Those marketing bastards lieLooking back, okay I was fooled and a fool. Yet, looking around now, I see many people are still confused about this whole bit issue. Furthermore, now as back then, the marketing folks only contribute to the confusion, by using or downright making up whatever numbers they think will sell to us penis-oriented buyers. Fortunately, I am now equipped with a hardcore computer science education and am personally no longer confused about the technical issues. My goal here is to eliminate the discombobulation for once and for all. However, I suck at explaining, so if I manage to even make a dent in it, I will consider myself a success.Definition of a BitLet's get technical already. What is a bit? A piece of information that can be either zero or 1. The lowest level, atomic unit of binary digital computers (such as the TurboGrafX).How many bits does it change to change a lightbulb? Just one: each bit can do either on or off. They're each that powerful! Contrast that to the four communists it takes to change the same lightbulb (one to change the bulb, one to hold the ladder, and two to hand out leaflets) . To be an "8-Bit" CPUThere are many measures of CPU capability. One that used to be quite popular is the "processor word size". Let's talk a bit about CPUs in order to explain this term. A CPU, or Central Processing Unit, has a fixed set of operations (aka functions) that it can perform (its instruction set). Each instruction takes a set of bits and changes some of the zeros to ones and vice versa. The instructions themselves are numbered, each number being represented by a set of bits and referred to as an opcode. A computer program is simply a series of numbers, or sets of bits. Each clock cycle, the processor, knowing where it is in the program, reads the next number from memory (RAM or, as with Hucards, ROM), interprets it as an opcode, and executes the corresponding instruction. The instruction may interpret various other sets of bits in the program as data or parameters to the instruction.These "sets of bits" are referred to as words and the size of such a set is the processor's "word size". Thus, an 8-bit processor has eight bits per word. The bits go marching eight by eightEight bits can encode the numbers from 0 to 255 (because 28 is 256). Thus, an eight-bit word can contain any of 256 distinct values. Since, as I alluded to earlier, CPU instructions are referred to by an opcode which is itself a word, an 8-bit CPU can have up to 256 instructions in its instruction set. That's actually a lot, considering the basic things a CPU does: arithmetic, comparisons, and moving data around. Even 16- and 32-bit CPUs from the TurboGrafX's day only had a couple hundred instructions.Eight bits also means that numerical values, like a player's score, can only be 0-255. Or at least it would be that way, if all values had to be one word. Fortunately, an 8-bit CPU isn't limited to processing 8-bit data. We may only be computing eight bits at a time, but we're not limited to thinking eight bits at a time. So, we can interpret two consecutive 8-bit words as one 16-bit word. 216 is 65536, so such an interpretation allows for values up to 65535. Similarly, a sequence of four 8-bit words can represent one 32-bit word, allowing values exceeding four billion. (There's also floating point, but I'll ignore that since it didn't exist back in the day.) So essentially, an 8-bit CPU just means a CPU that processes data 8-bits at a time, and has instruction opcodes that take up 8-bits each. The tradeoffSince a 16-bit CPU's instructions are 16-bits wide, a 4 megabit ROM (4 million bits) for an 8-bit CPU can contain twice as long a program as it would for a 16-bit CPU. And thus, an 8-bit CPU needs only half the memory (RAM) to hold a given program than a 16-bit CPU. Suddenly 8-bit holds an advantage over 16-bit! That 64K (65536 bytes, or half a megabit) RAM in the TurboGrafX-CD is equivalent to 128K (an entire megabit) on the Genesis.The tradeoff, though, is that it often takes longer for an 8-bit CPU to process the data. Anytime we need a number greater than 256, each basic operation takes more than one clock cycle. This is precisely the primary reason why a 7 MHz 8-bit CPU is considered to be slower than a 7 MHz 16-bit CPU. In fact, this is such a significant tradeoff that some modern processors blur the meaning of "word size" by processing data in chunks larger than their instruction size. An example is the ARM Thumb processor in the Gameboy Advance: it claims to be a 32-bit CPU, processing data thirty-two bits at a time, but it has a 16-bit instruction set, to reduce program code size. TurboGrafX-8Now, lets look specifically at the TurboGrafX's situation. It typically uses a screen resolution of 256 by 256, which means all screen-space operations can be done using 8-bit values. Further, its two graphics pipelines (sprites and background, explored further next episode) each have 256 colours. It tracks at most 64 sprites simultaneously, each of which is 32x16 pixels. Thus, most graphics operations can be done with numbers under 256. As this is the majority of its work, it spends the majority of its time running at full speed. Thus its grafx algorithms run as efficiently (in terms of clock-cycles per operation) as the "16-bit" Genesis's, yet take up half the space. So there, punks.Authored by Robodork (c) 2002 Turbo2k |
Columns
Next
week: |