Bits Bytes and Words
来源:互联网 发布:linux给用户赋权限命令 编辑:程序博客网 时间:2024/06/10 08:16
Bits, Bytes and Words
A bit is a BInary digiT. So a bit is a zero or a one. Bits can be implemented in computer hardware using switches. If the switch is on then the bit is one and if the switch is off then the bit is zero. A bit is limited to representing two values.
Since the alphabet contains more than two letters, a letter cannot be represented by a bit. A byte is a sequence of bits. Since the mid 1960's a byte has been 8 bits in length. 01000001 is an example of a byte. Since there are 8 bits in a byte there are 28 different possible sequences for one byte, ranging from 00000000 to 11111111. This means that a byte can be used to represent any type of value with no more than 28 = 256 possible values. Since the number of things that you can enter on a computer keyboard is smaller than 256 (including all keystoke pairs, like shift or control plus another key), a code for a keystoke is represented with a code within a byte.
Since characters (letters, decimal digits and special characters such as punctuation marks, etc) can be represented with bytes, a standard is needed to insure that the code that's used on your computer is the same as the code that is used on mine. There are two standard codes that use one byte to represent a character, ASCII (ass'-key) and EBCDIC (ib'-suh-dik). ASCII, the American Standard Code for Information Interchange, is the code that is most commonly used today. EBCDIC, Extended Binary Coded Decimal Interchange Code, was used by IBM on its large mainframe computers in the past. Wikipedia has more than you want to know about ASCII and EBCDIC. Since these codes are limited to 256 possible combinations, certain character sets, such as Chinese, Arabic, Japanese, Klingon and others, cannot be represented using these codes. This problem is solved by using another code, Unicode, which uses 2 bytes for each character. This extension allows 216 different symbols to be represented, a total of 65,536. The use of Unicode gives more flexibility in the representation of data. The drawback of using Unicode is that it takes twice as much space to store the same number of characters.
A word is the number of bits that are manipulated as a unit by the particular CPU of the computer. Today most CPUs have a word size of 32 or 64 bits. For example, the notebook computer that I bought in May 2008 contains a core 2 duo 64 bit processor. Data is fetched from memory to the processor in word size chunks and manipulated by the ALU in word size chunks. All other things being equal, (and they never are), larger word size implies faster and more flexible processing.
Further Information
Wikipedia contains exhaustive information about bits, bytes and words.
howSTUFFworks also has an article on (How Bits and Bytes Work)
- Bits Bytes and Words
- Bits and Bytes
- CS213 (2) Bits and Bytes
- FX3 use of SPI and 32 bits words GPIF
- bytes与bits
- ECC校验,256bytes 校验1bits
- Bytes和bits有何区别
- bytes与bits的前世今生
- Bits and Pieces 模拟
- Read and write bytes data
- show unused blocks and bytes
- python bytes and string 编码
- English words and phrase
- About Words and Deeds
- SOJ.Letters and Words
- Keywords and Reserved Words
- Java Key words and Reserved words
- A. Little Elephant and Bits
- 世界是有限的还是无限的?
- NOIP2013 DAY2 T3 华容道(PUZZLE) BFS+SPFA
- html常用标签补充
- Bit Byte Megabyte Gigabyte
- redis-散列
- Bits Bytes and Words
- sql练习
- 机器学习K均值聚类 python
- Git学习笔记(一)
- 读取zookeeper保存的topic元数据
- android 保存网络图片到本地
- 浅谈Java反射
- Spark Streaming 新手指南(原始文章已经发布表在IBM Developworks)
- sentinel监控主从服务器