Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

计算机 位—字节—字的关系[0]

Posted on 2023年11月14日 by

计算机中位(bit), 字节(byte), 字(word)定义

1、位(bit)

来自英文bit,表示二进制位。位是计算机内部数据储存的最小单位,11010100是一个8位二进制数。一个二进制位只可以表示0和1两种状态(21);两个二进制位可以表示00、01、10、11四种(22)状态;三位二进制数可表示八种状态(23)……。

2、字节(byte)

来自英文Byte,习惯上用大写的“B”表示。 字节是计算机中数据处理的基本单位。计算机中以字节为单位存储和解释信息,规定一个字节由八个二进制位构成,即1个字节等于8个比特(1Byte=8bit)。八位二进制数最小为00000000,最大为11111111;通常1个字节可以存入一个ASCII码,2个字节可以存放一个汉字国标码。

3、字(word)

计算机进行数据处理时,一次存取、加工和传送的数据长度称为字(word)。一个字通常由一个或多个(一般是字节的整数位)字节构成。例如286微机的字由2个字节组成,它的字长为16;486微机的字由4个字节组成,它的字长为32位机。 计算机的字长决定了其CPU一次操作处理实际位数的多少,由此可见计算机的字长越大,其性能越优越。

一个ascll码就是一个字节, 因为ascll码的二进制范围是00000000到11111111, 十进制范围是0到255,

unicode指的是UCS-2的编码方式, 是以两个字节的长度

utf-8是一种变长的编码方式,它可以使用1~4个字节表示一个符号,根据不同的符号而变化字节长度

utf-16是,好处在于大部分字符都以固定长度的字节 (2字节) 储存,但UTF-16却无法兼容于ASCLL编码

UTF-32(或 UCS-4)是以4个字节的长度固定存储的;

每一个字节文件都是以约定的编码进行存储的。

位(bit), 字节(byte), 字(word)的关系

1. bit:位

一个二进制数据0或1,是1bit;

2. byte:字节

存储空间的基本计量单位,如:MySQL中定义 VARCHAR(45)  即是指 45个字节;
1 byte = 8 bit

3. 一个英文字符占一个字节(视编码而定)

1 字母 = 1 byte = 8 bit

4. 一个汉字占2个字节(视编码而定)

1 汉字 = 2 byte = 16 bit

补充:

参考资料:

  1. https://www.cnblogs.com/diligenceday/p/5591692.html
  2. http://www.ad.siemens.com.cn/download/docMessage.aspx?Id=3401

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT