PlainEnglish->computer_science
You are here: Computer Science → Computer Architecture → Bits, bytes and words
Bits, bytes and words
What is a bit?
Bit is short for 'binary digit.' It's a single digit in a binary number, and it can be either 1 or 0. Inside a computer, you can think of a bit as being a mechanical switch, which can be either switched on or off (the earliest computers actually stored information in memory using mechanical switches, with electromagnets to turn each one on or off). Now if you only have one of these switches, you can only store two different states, on or off. This is useful in itself, you can record that something is either true or false... But if you have, say, eight of them, you can store 256 different combinations of on and off states between the eight switches.What is a byte?
A byte is 8 bits. That's the definition. With 8 bits you can store any number between 0 and 255, since there are 256 different combinations of 1 and 0 to choose from. Why eight bits? The original intention was that, when storing text, 8 bits would be enough to assign a unique number every possible language character you might want to use in your document. The idea was that each character in a file would take up one byte of memory (in most cases, this is still true). Let's see: there are 26 uppercase letters (A-Z), 26 lowercase (a-z), 10 numerical digits(0-9), 32 punctuation characters and other symbols on a US keyboard, the space character That's already 94 different characters. Then there's a few characters for creating newlines, a tab character for indentations, there's even a 'bell' character which programs would output in order to make the user's terminal beep. You can see how it all adds up In practice, only characters up to 127 were ever standardised (the standard is called ASCII, which stands for American Standard Code for Information Interchange, because in the early days, one of the eight bits was set aside for error testing purposes (back when computers were far less reliable), and 7 bits only gives you 128 different combinations.What is a word?
You often hear about 32-bit or 64-bit computer architectures. A word is basically the number of bits a particular computer's CPU can deal with in one go. It varies depending on the computer architecture you're using. Imagine looking at an imaginary computer's circuitry very closely. On a 32-bit machine, you would see 32 wires running parallel to each other between the computer's memory controller and the CPU, for the purpose of giving the CPU access to one particular word of memory. Actually, there would be an additional 32 wires (perhaps less) for the CPU to select a particular memory address to access. If a CPU can access 32 bits of memory in one go, then it turns out that it makes a lot of sense to address the computer's memory using ≤32 bits. (This happens to be why the 32-bit version of Windows can't deal with more than 2GB of RAM, but the 64-bit version can.)
Home
This work by http://plainenglish.info is licensed under a Creative Commons Attribution 4.0 International License.
You may copy this work, however you must always attribute this work if you do so.
This work by http://plainenglish.info is licensed under a Creative Commons Attribution 4.0 International License.
You may copy this work, however you must always attribute this work if you do so.