Bits and Bytes Bits and Bytes At the smallest scale in the computer, information is stored as bits and bytes. In this section, we'll look at how that works. Bit Bit, like an atom, the smallest unit of storage A bit stores just a 0 or 1 "In the computer it's all 0's and 1's" ... bits Anything with two separate states can store 1 bit -Nick's tennis racket example Chip uses areas of electric charge as 0/1 states Hard drive uses spots North/South magnetism 0/1 states A bit is too small to be much use Group 8 bits together to make 1 byte Everything in a computer is 0's and 1's ... what does that mean? The bit stores just a 0 or 1 .. it's the smallest building block of storage. Byte One byte = grouping of 8 bits e.g. 0 1 0 1 1 0 1 0 One byte can store one letter, e.g. 'A' or 'x' How Many Patterns With N Bits? How many distinct patterns can be made with 1, 2, or 3 bits? Number of bits 3 bits vs.

2 bits Consider just the leftmost bit It can only be 0 or 1 Lefmost bit is 0, then append 2-bit patterns Leftmost bit is 1, then append 2-bit patterns again Result ... 3-bits has twice as many patterns as 2-bits Number of bits In general: add 1 bit, double the number of patterns 1 bit - 2 patterns 8 bits - 256 - one byte Mathematically: n bits yields 2n patterns (2 to the nth power) One Byte - 256 Patterns 1 byte is group of 8 bits 8 bits can make 256 different patterns How to use the 256 patterns? How to store a number in a byte? Start with 0, go up, one pattern per number, until run out of patterns 0, 1, 2, 3, 4, 5, ... 254, 255 One byte can hold a number between 0 and 255 i.e.

with 256 distinct patterns, we can store a number in the range 0..255 Code: pixel.setRed(n) took a number 0..255. Why? The red/green/blue image numbers are each stored in one byte Bytes "Byte" - unit of information storage A document, an image, a movie .. how many bytes? 1 byte is enough to hold 1 typed letter, e.g. 'b' or 'X' Later we'll look at storage in: RAM, hard drives, flash drives All measured in bytes, despite being very different hardware Kilobyte, KB, about 1 thousand bytes Megabyte, MB, about 1 million bytes Gigabyte, GB, about 1 billion bytes Terabyte, TB, about 1 trillion bytes (rare) The space that data takes up in the computer is measured in by the "byte". One byte is big enough to hold a single typed letter, like 'a'. Here we'll look at storing data in RAM memory and in persistent storage like a hard drive. All of that storage space will be measured in bytes. We'll look at byte arithmetic in more detail later.

Bytes and Letters - ASCII Code ASCII is an encoding representing each typed letter by a number Each number is stored in one byte (so the number is in 0..255) A is 65 space is 32 "Unicode" is an encoding for mandarin, greek, arabic, etc. languages, typically 2-bytes per "letter" 32 space 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' 40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 / 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ?

64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W 88 X 89 Y 90 Z 91 [ 92 \ 93 ] 94 ^ 95 _ 96 ` 97 a 98 b 99 c 100 d 101 e 102 f 103 g 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w 120 x 121 y 12

2 z 123 { 124 | 125 } 126 ~ Typing, Bytes, and You How many bits are there in a byte?

- Quora Quora Written Apr 16, 2012 This is architecture-dependent. originally it was described as 1 to 6 bits (typical I/O equipment of the period used 6-bit chunks of information). The move to an 8-bit byte happened in late 1956 Some older architectures used byte for quantities of 6, 7, or (especially) 9 bits ( catb.org/~esr/jargon/html/B/byte.html ) The DEC-10 byte pointer hardware worked with arbitrary-size bytes. The byte pointer included the byte size in bits. I don't remember whether bytes could span word boundaries; I think they couldn't, which meant that you'd have a few waste bits per word if the byte size was not 3, 4, 9, or 18 bits. (The DEC-10 used a 36-bit word.) Sort of shameless copy. There were older systems where byte was less than 8-bits. Now C/C++ specifications have mandated at least 8 bits for a byte i.e. it may be more than that. DSP processors would have those mostly.

Copied verbatim below: The Control Data 6600 (and its brothers) Central Processor used a 60-bit word, and could only address a word at a time. In one sense, a "byte" on a CDC 6600 was 60 bits. The DEC-10 byte pointer hardware worked with arbitrary-size bytes. The byte pointer included the byte size in bits. I don't remember whether bytes could span word boundaries; I think they couldn't, which meant that you'd have a few waste bits per word if the byte size was not 3, 4, 9, or 18 bits. (The DEC-10 used a 36-bit word.) The first commercial CPU by Intel was the Intel 4004 (4-bit) 16-bit words are only found on 16-bit systems, like the Amiga 500. CPU 32-bits 1 word is 4 bytes CPU 64-bits 1 word = 8 bytes Byte: Today, a byte is almost always 8 bit. However, that wasn't always the case and there's no "standard" or something that dictates this.

Since 8 bits is a convenient number to work with it became the de facto standard. Word: The natural size with which a processor is handling data (the register size). The most common word sizes encountered today are 8, 16, 32 and 64 bits, but other sizes are possible. For examples, there were a few 36 bit machines , or even 12 bit machines . The byte is the smallest addressable unit for a CPU. If you want to set/clear single bits, you first need to fetch the corresponding byte from memory, mess with the bits and then write the byte back to memory. The word by contrast is biggest chunk of bits with which a processor can do processing (like addition and subtraction) at a time. That definition is a bit fuzzy, as some processor might have different word sizes for different tasks (integer vs. floating point processing for example). The word size is what the majority of operations work with. There are also a few processors who have a different pointer size: for example, the 8086 is a 16-bit processor which means its registers are 16 bit wide.

But its pointers (addresses) are 20 bit wide and were calculated by combining two 16 bit registers in a certain way. C Q&A #1: How many bits are there in a byte? – Phoxis phoxis C Language , Computer Science C Q&A #1: How many bits are there in a byte? The question is simple: How many bits are there in a byte. But the answer is not that straight, there is a “but” after the answer we all know. How many bytes One byte consists of 8 bits, which should be adjacent. This is the de facto standard, that is, it is widely accepted and used in practice. But the number of bits in a byte is not fixed, it can be different in different systems. There exists systems which has more than 8 bits wide. The number of bits in a byte is actually implementation defined and is not necessarily 8 bytes everywhere. It can be 8 bits, 9 bits, 16 bits, 32 bits, even 64 bits [1] . Does that mean if you do sizeof (char) it may return more than 1 ?

No, because char has a storage size of exactly one byte and when the number of bits in a byte change, the definition of byte changes, not the definition of char, so sizeof (char) is always 1. The minimum number of bits in a char is defined to be 8 as per C99 standards Section 5.2.4.2.1 Paragraph 1, and the number of bits in a byte in an implementation should be greater than or equal to 8. In C99 Section 3.6 Paragraph 3 it is NOTE 2 A byte is composed of a contiguous sequence of bits, the number of which is implementation-defined. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit. This clearly states the the number of bits in a byte is implementation-defined. We might need the number of bits in a byte to know it to make some bit operations or for some other cause. How can we know that is the number of bits in a byte for a certain implementation? The number of bits per byte is in the limits.h file defined as the CHAR_BIT macro.

Therefore if we want to know how many bits are there in a char or int we need to do sizeof (char) * CHAR_BIT and sizeof (int) * CHAR_BIT respectively. We need to make sure that the limits.h file is included. References sorry i write wrong 8 bits = 1 byte 1024 bute = 1kb 1024 kb = 1mb 1024 mb = 1gb and so ……………………. What is bit (binary digit)? - Definition from WhatIs.com memory dump attack A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1. Although computers usually provide instruction s that can test and manipulate bits, they generally are designed to store data and execute instructions in bit multiples called byte s. In most computer systems, there are eight bits in a byte. The value of a bit is usually stored as either above or below a designated level of electrical charge in a single capacitor within a memory device. Half a byte (four bits) is called a nibble . In some systems, the term octet is used for an eight-bit unit instead of byte.

In many systems, four eight-bit bytes or octets form a 32-bit word . In such systems, instruction lengths are sometimes expressed as full-word (32 bits in length) or half-word (16 bits in length). In telecommunication, the bit rate is the number of bits that are transmitted in a given time period, usually a second. This was last updated in March 2010 Related Terms SmartFTP - Bits, Bytes, Mega, Giga, Tera (explained) Bits, Bytes, Mega, Giga, Tera (explained) 1 bit = a 1 or 0 (b) 4 bits = 1 nybble (?) 8 bits = 1 byte (B) 1024 bytes = 1 Kilobyte (KB) 1024 Kilobytes = 1 Megabyte (MB) 1024 Megabytes = 1 Gigabyte (GB) 1024 Gigabytes = 1 Terabyte (TB) Common prefixes: - kilo, meaning 1,000.

(one thousand) 10^3 (Kilometer, 1,000 meters) - mega, meaning 1,000,000. (one million) 10^6 (Megawatt, 1,000,000 watts) - giga, meaning 1,000,000,000 (one billion) 10^9 (Gigawatt, 1,000,000,000 watts) - tera, meaning 1,000,000,000,000 (one trillion) 10^12 The smallest amount of transfer is one bit. It holds the value of a 1, or a 0. (Binary coding). Eight of these 1's and zero's are called a byte. Why eight? The earliest computers could only send 8 bits at a time, it was only natural to start writing code in sets of 8 bits. This came to be called a byte. A bit is represented with a lowercase "b," whereas a byte is represented with an uppercase "b" (B).

So Kb is kilobits, and KB is kilobytes. A kilobyte is eight times larger than a kilobit. A simple 1 or 0, times eight of these 1's and 0's put together is a byte. The string of code: 10010101 is exactly one byte. So a small gif image, about 4 KB has about 4000 lines of 8 1's and 0's. Since there are 8 per line, that's over (4000 x 8) 32,000 1's and 0's just for a single gif image. How many bytes are in a kilobyte (KB)? One may think it's 1000 bytes, but its really 1024. Why is this so? It turns out that our early computer engineers, who dealt with the tiniest amounts of storage, noticed that 2^10 (1024) was very close to 10^3 (1000); so based on the prefix kilo, for 1000, they created the KB.

(You may have heard of kilometers (Km) which is 1000 meters). So in actuality, one KB is really 1024 bytes, not 1000. It's a small difference, but it adds up over a while. The MB, or megabyte, mega meaning one million. Seems logical that one mega (million) byte would be 1,000,000 (one million) bytes. It's not however. One megabyte is 1024 x 1024 bytes. 1024 kilobytes is called one Megabyte. So one kilobyte is actually 1024 bytes, and 1024 of those is (1024 x 1024) 1048576 bytes. In short, one Megabyte is really 1,048,576 bytes. There is a difference of about 48 KB, which is a decent amount. If you have a calculator, you will notice that there is actually a 47KB difference.

There is a difference of 48,576 bytes, divided by 1024, and you get the amount of real kilobytes... 47.4375 All of this really comes into play when you deal with Gigabytes, or roughly one billion bytes. One real Gigabyte is actually 1024 bytes x 1024 bytes x 1024 bytes...1,073,741,824. However, most people like to simplify this by simply saying that one Gigabyte is only 1,000,000,000 (one billion) bytes; which makes sense because the prefix Giga means one billion. References What Is a Bit and How Many Bits Are in a Byte? | eHow What Is a Bit and How Many Bits Are in a Byte?  Email Save A bit is short for a binary digit. In a binary system, only two digits exist: 1 and 0, as opposed to the decimal system, which has 10 digits from 0 to 9.

The binary system was adapted in computers because data can simply be represented in 1's and 0's and it can easily be converted to represent electrical signals with 0 considered as an "off state" and 1 as an "on state." One byte is equivalent to 8 bits. Differentiating Number Systems Four major number systems are in general use. The one we use commonly is the decimal system, which has 10 digits. Another is the octal system, which has eight digits that go from 0 to 7. The hexadecimal system has 16 digits and goes from 0 to 9, then A to E. The last one is the binary system, which has 0 and 1. The binary system is in base 2, which when converted to the decimal system is 2 raised to the nth power; this is important in understanding storage sizes in computers. Using Binary in Computers The binary system was used in computers because it provides the easiest way of converting digital signals to electrical signals and vice versa. This allows hardware devices and software applications to interact with each other. Letters, numbers and other symbols can be translated into binary representations, which the hardware can then read and transmit through physical devices such as wires and cables.

Bits and Bytes You might wonder why 8 bits or a byte is used instead of something else. This is because the earliest computers could process only 8 bits of data at a time. As computers became faster and more advanced, the idea of a byte stuck. A single byte of data can be from 00000000 to 11111111, which when converted to decimal goes from 0 to 255. In computer symbols, a bit is represented with a lowercase letter "b" while a byte is represented with an uppercase letter "B." Understanding Computer Measurements Hard disk spaces, file and memory sizes are often measured in kilobytes, megabytes and gigabytes. A kilobyte is not exactly 1,000 bytes. Recall that when converting bits to decimal numbers, it's 2 raised to the nth power. A kilobyte is actually 1,024 bytes, which is 2 to the 10th power. Similarly, 1MB is not a million bytes but 1,048,576 bytes, or 2 to the 20th power.

One gigabyte is not exactly one billion bytes, but 1,073,741,824, or 2 to the 30th power. How much is 1 byte, kilobyte, megabyte, gigabyte, etc.? You are here: Help > Computer Storage How much is 1 byte, kilobyte, megabyte, gigabyte, etc.? Below is a list of each of the accepted disk drive space values. It is important to realize that not all manufacturers and developers use binary base 2. For example, a manufacturer may list a product's capacity as one gigabyte (1,000,000,000 bytes, a metric value) and not 1,073,741,824 bytes ( gibibyte ) that it actually is. For this page, we are using the "common names" and listing all values in base 2. Note: All values are whole numbers , which means a GB shows it can only contain one 650MB CD, but 1GB could hold 1.5753... of a 650MB CD.

Since we created this document to illustrate how much each value can contain in whole, no decimal values are shown. In other words, you can only fit one complete 650MB CD on a 1GB drive since two full 650MB discs exceed 1GB. Tip: With the exception of a bit and a nibble, all values explained below are in bytes and not bits. For example, a Kilobyte (KiB) is different than a Kilobit (Kb). When referring to storage, bytes are used. When referring to transmission speeds, bits are used. Bit A bit is a value of either a 1 or 0 (on or off). Nibble A Nibble is 4 bits. Byte Today, a Byte is 8 bits. 1 character , e.g. "a", is one byte. Kilobyte (KB) A Kilobyte is 1,024 bytes. 2 or 3 paragraphs of text.

Megabyte (MB) A Megabyte is 1,048,576 bytes or 1,024 Kilobytes 873 pages of plaintext (1,200 characters) 4 books (200 pages or 240,000 characters) Gigabyte (GB) A Gigabyte is 1,073,741,824 (230) bytes. 1,024 Megabytes, or 1,048,576 Kilobytes.

894,784 pages of plaintext (1,200 characters) 4,473 books (200 pages or 240,000 characters) 640 web pages (with 1.6MB average file size) 341 digital pictures (with 3MB average file size) 256 MP3 audio files (with 4MB average file size) A Terabyte is 1,099,511,627,776 (240) bytes, 1,024 Gigabytes, or 1,048,576 Megabytes.

916,259,689 pages of plaintext (1,200 characters) 4,581,298 books (200 pages or 240,000 characters) 655,360 web pages (with 1.6MB average file size) 349,525 digital pictures (with 3MB average file size) 262,144 MP3 audio files (with 4MB average file size) 1,613 650MB CD's A Petabyte is 1,125,899,906,842,624 (250) bytes, 1,024 Terabytes, 1,048,576 Gigabytes, or 1,073,741,824 Megabytes.

938,249,922,368 pages of plaintext (1,200 characters) 4,691,249,611 books (200 pages or 240,000 characters) 671,088,640 web pages (with 1.6MB average file size) 357,913,941 digital pictures (with 3MB average file size) 268,435,456 MP3 audio files (with 4MB average file size) 1,651,910 650MB CD's An Exabyte is 1,152,921,504,606,846,976 (260) bytes, 1,024 Petabytes, 1,048,576 Terabytes, 1,073,741,824 Gigabytes, or 1,099,511,627,776 Megabytes.

960,767,920,505,705 pages of plaintext (1,200 characters) 4,803,839,602,528 books (200 pages or 240,000 characters) 687,194,767,360 web pages (with 1.6MB average file size) 366,503,875,925 digital pictures (with 3MB average file size) 274,877,906,944 MP3 audio files (with 4MB average file size) 1,691,556,350 650MB CD's 42,949,672 25GB Blu-ray discs Zettabyte (ZB) A Zettabyte is 1,180,591,620,717,411,303,424 (270) bytes, 1,024 Exabytes, 1,048,57

6 Petabytes, 1,073,741,824 Terabytes, 1,099,511,627,776 Gigabytes, or 1,125,899,910,000,000 Megabytes.

983,826,350,597,842,752 pages of plaintext (1,200 characters) 4,919,131,752,989,213 books (200 pages or 240,000 characters) 703,687,443,750,000 web pages (with 1.6MB average file size) 375,299,970,000,000 digital pictures (with 3MB average file size) 281,474,977,500,000 MP3 audio files (with 4MB average file size) 1,732,153,707,691 650MB CD's 43,980,465,111 25GB Blu-ray discs Yottabyte (YB) A Yottabyte is 1,208,925,819,614,629,174,

706,176 (280) bytes, 1,024 Zettabytes, 1,048,576 Exabytes, 1,073,741,824 Petabytes, 1,099,511,627,776 Terabytes, 1,125,899,910,000,000 Gigabytes, or 1,152,921,500,000,000,000 Megabytes.

1,007,438,183,012,190,978,921 pages of plaintext (1,200 characters) 5,037,190,915,060,954,894 books (200 pages or 240,000 characters) 720,575,937,500,000,000 web pages (with 1.6MB average file size) 384,307,166,666,666,666 digital pictures (with 3MB average file size) 288,230,375,000,000,000 MP3 audio files (with 4MB average file size) 1,773,725,384,615,384 650MB CD's 45,035,996,273,704 25GB Blu-ray discs Is there anything bigger than a Yottabyte

?

As of 2015, there are no approved standard sizes for anything bigger than a Yottabyte. However, the two standards that have been proposed are the Hellabyte or Brontobyte . How are you calculating the above values? Calculating the above values is simple once you know the values of each of the above sizes. For example, in the Gigabyte section above, we know that 1 gigabyte is equal to 1,024 Megabytes. Therefore to determine how many 4MB MP3 files are in a Gigabyte, we take 1,024 / 4 which equals 256 or 256 4MB MP3 files in one gigabyte. Tip: You can also use our search engine to search engine and our conversion tool also to convert and compare between values. Bits, Bytes, Nybbles Bits, Bytes, Nybbles The most important base you need to know for computer organization is base 2. We also call this binary, since binary means two valued. The second most important base is base 16 (or hexadecimal), and the third is base 8 (octal). Beyond that, you don't need to know the other bases.

Let's start with some definitions first. bit A single binary digit, that can have either value 0 or 1. byte 8 bits. halfword 16 bits doubleword 64 bits The definition of "word" isn't set. It has usually referred to the number of bits used in a register. These days, typical registers store 32 bits. However, already 64 bit architectures are being built (and have been for a few years). Throughout the class notes, we'll define a word to be 32 bits. In base 2, we refer to the individual 1's and 0's as bits, rather than digits. This is very common terminology, so from now on, we won't refer to them as digits. Labelling Individual Bits As we saw in Converting from Base 10 to Base K, it's convenient to label individual digits, so we can refer to them by name. We'll label bits as well, from right to left, with 0 being the index of the rightmost bit. For example, suppose you have an N-bit number. It would be written as: bN-1 bN-2...b1b0.

It's common to define two more terms for an N-bit number. least significant bit Bit b0. We'll abbreviate this LSb with the 'b' in lowercase to represent a bit. (When it's in uppercase, it will mean byte). most significant bit Bit bN-1. We'll abbreviate this MSb with the 'b' in lowercase to represent a bit. (When it's in uppercase, it will mean byte). The reason it's called "least significant" bit is because the bit is associated with the smallest subscript, i.e., the smallest power of 2. Flipping this bit (i.e., changing it from 0 to 1, or 1 to 0) would affect the overall value the least of any bit that one could flip. The reason it's called "most significant" bit is because the bit is associated with the largest subscript, i.e., the largest power of 2. Flipping this bit (i.e., changing it from 0 to 1, or 1 to 0) would affect the overall value the most of any bit in the number.

Bitstrings and Bit vectors While there are standard sizes for differing number of bits (bits, bytes, nybbles, etc.), sometimes you just need to refer to a more arbitrary set of bits. We'll refer to a "N" bits as a bitstring or a bit vector. It may seem odd to refer to a number as a string, but it's not so unusual. When you write numbers, you typically increase the number of digits as needed. Thus, you write 10, instead of 0010. However, in hardware, you often have a fixed number of bits, such as 16 bits or 32 bits. Leading zeroes will always appear to pad it to the necessary number of total bits. So, the name "bit string" might be just as good any because it may imply a length of a string. Bitstrings are also called bit vectors. In this case, a vector typically means a "coordinate" with N arguments. For example, when you study graphs in 2 or 3 dimensions, coordinates are written like (2,3) or (2,3,1). So 0010 could be thought of as (0,0,1,0), i.e.

a coordinate in four dimensions. Of course, when people talk about bit vectors, they're generally not thinking about it as a coordinate. The main point is that, unlike sets, vectors have numbered positions (though typically, vectors are numbered left to right, starting at index 1). In any case, I will usually call it "bit strings". How Many Different Bitstring Patterns? Suppose you have an N-bit bitstring. How many possible patterns of 1's and 0's are there? And why do you care? Let's answer the first question, first. To compute the number of N-bit bitstrings, realize that you have 2 choices for each bit. You simply multiply 2, N times. This is, of course, NOT the same thing as 2N. Instead, it is 2N. This is a very important fact to remember, because the number of bitstring patterns limits the number of possible values that the bitstrings can represent. For example, if you have 3 bits, then you have 8 possible bitstring patterns (since 8=23). That limits you to a maximum of 8 different values.

You may wonder why the number of bitstring patterns isn't the same as the number of values. We're going to see some examples where two different bitstring patterns correspond to the same number. For example, I could make up a weird system where all 3-bit values really stand for 0. This wouldn't make much sense, but it doesn't necessarily have to. The number of possible representations does NOT have to equal the number of possible values. The best we can say is that the number of different patterns forces a maximum on how many values those patterns can represent. How many bits To Label N different items? This is also an odd question. But let's see where it leads us. Suppose you have N different items. You wish to label them with an K bit binary number. What's the minimum number bits necessary? We know that if we have K bits, then there are 2K different bitstring patterns. Thus, we want to solve: 2K >= N hardware - What is the history of why bytes are eight bits? - Software Engineering Stack Exchange What is the history of why bytes are eight bits?

up vote 62 down vote favorite 15 What where the historical forces at work, the tradeoffs to make, in deciding to use groups of eight bits as the fundamental unit ? There were machines, once upon a time, using other word sizes, but today for non-eight-bitness you must look to museum pieces, specialized chips for embedded applications, and DSPs. How did the byte evolve out of the chaos and creativity of the early days of computer design? I can imagine that fewer bits would be ineffective for handling enough data to make computing feasible, while too many would have lead to expensive hardware. Were other influences in play? Why did these forces balance out to eight bits? (BTW, if I could time travel, I'd go back to when the "byte" was declared to be 8 bits, and convince everyone to make it 12 bits, bribing them with some early 21st Century trinkets.) 7 This might be one of those questions where we can't answer it better than good old Wikipedia . – Scott Whitlock Nov 16 '11 at 19:53 7 So why would you prefer 12 bits to 8?

– FrustratedWithFormsDesigner Nov 16 '11 at 19:59 7 Is the last sentence in jest? A 12-bit byte would be inconvenient because it's not a power of 2. – Rob Nov 16 '11 at 20:00 16 Memory and registers weren't so cheap back then, so 8 bits was a good compromise, compared to 6 or 9 (fractions of a 36-bit word). Also, address calculations are a heck of a lot simpler with powers of 2, and that counts when you're making logic out of raw transistors in little cans. – Mike Dunlavey Nov 16 '11 at 20:05 8 Using word sizes that were powers of 2 were not so important in the "early days". The DEC-10 had a 36 bit word, and the CDC 6000 series had 60 bit words, and index registers with 18 bits.

– Jay Elston Nov 17 '11 at 18:53 up vote 57 down vote accepted A lot of really early work was done with 5-bit baudot codes, but those quickly became quite limiting (only 32 possible characters, so basically only upper-case letters, and a few punctuation marks, but not enough "space" for digits). From there, quite a few machines went to 6-bit characters. This was still pretty inadequate though -- if you wanted upper- and lower-case (English) letters and digits, that left only two more characters for punctuation, so most still had only one case of letters in a character set. ASCII defined a 7-bit character set. That was "good enough" for a lot of uses for a long time, and has formed the basis of most newer character sets as well (ISO 646, ISO 8859, Unicode, ISO 10646, etc.) Binary computers motivate designers to making sizes powers of two.

Since the "standard" character set required 7 bits anyway, it wasn't much of a stretch to add one more bit to get a power of 2 (and by then, storage was becoming enough cheaper that "wasting" a bit for most characters was more acceptable as well). Since then, character sets have moved to 16 and 32 bits, but most mainstream computers are largely based on the original IBM PC (a design that'll be 30 years old within the next few months). Then again, enough of the market is sufficiently satisfied with 8-bit characters that even if the PC hadn't come to its current level of dominance, I'm not sure everybody would do everything with larger characters anyway. I should also add that the market has changed quite a bit. In the current market, the character size is defined less by the hardware than the software. Windows, Java, etc., moved to 16-bit characters long ago. Now, the hindrance in supporting 16- or 32-bit characters is only minimally from the difficulties inherent in 16- or 32-bit characters themselves, and largely from the difficulty of supporting i18n in general.

In ASCII (for example) detecting whether a letter is upper or lower case, or converting between the two, is incredibly trivial. In full Unicode/ISO 10646, it's basically indescribably complex (to the point that the standards don't even try -- they give tables, not descriptions). Then you add in the fact that for some languages/character sets, even the basic idea of upper/lower case doesn't apply. Then you add in the fact that even displaying characters in some of those is much more complex still. That's all sufficiently complex that the vast majority of software doesn't even try. The situation is slowly improving, but slowly is the operative word. up vote 5 down vote Take a look at Wikipedia page on 8-bit architecture . Although character sets could have been 5-, 6-, then 7-bit, underlying CPU/memory bus architecture always used powers of 2. Very first Microprocessor (around 1970s) had 4-bit bus, which means one instruction could move 4-bits of data between external memory and the CPU.

Then with release of 8080 processor, 8-bit architecture became popular and that's what gave the beginnings of x86 assembly instruction set which is used even to these days. If I had to guess, byte came from these early processors where mainstream public began accepting and playing with PCs and 8-bits was considered the standard size of a single unit of data. Since then bus size has been doubling but it always remained a power of 2 (i.e. 16-, 32- and now 64-bits) Actually, I'm sure the internals of today's bus are much more complicated than simply 64 parallel wires, but current mainstream CPU architecture is 64-bits. I would assume that by always doubling (instead of growing 50%) it was easier to make new hardware that coexists with existing applications and other legacy components. So for example when they went from 8-bits to 16, each instruction could now move 2 bytes instead of 1, so you save yourself one clock cycle but then end result is the same. However, if you went from 8 to 12-bit architecture, you'd end breaking up original data into halfs and managing that could become annoying.

These are just guesses, I'm not really a hardware expert. up vote 2 down vote A byte has been variously (at least) 1, 4, 6, 7, 8, 9, 12, 18, 20 and possibly 36 bits, depending on what computer you are looking at. I am taking "byte" here to mean "smallest addressable unit of memory", rather than using any sort of text-centric interpretation. (For example, the Saturn CPU, a 64-bit CPU used in the popular HP48SX/GX calculator line addresses memory in nibbles -- 4-bits.) The 20-bit bytes were extremely common in the "IAS machines", in the 50s. 6, 12, 18 (and maybe 36) were quite popular in a variety of architectures in the 60s, 70s and to some degree 80s. In the end, having a nice correspondence between "powers of 2" and "bits in an addressable unit" seem to have won out.

Question: How many bits are there in a byte?
Answer: Eight