V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
mortonnex
V2EX  ›  问与答

为什么 1B = 8b?

  •  
  •   mortonnex · 2018-11-08 10:14:32 +08:00 · 3146 次点击
    这是一个创建于 1996 天前的主题,其中的信息可能已经有所发展或是发生改变。
    为什么 byte 和 bit 对倍数关系是 8?
    第 1 条附言  ·  2018-11-08 10:52:48 +08:00
    " Many types of applications use information representable in eight or fewer bits and processor designers optimize for this common usage. The popularity of major commercial computing architectures has aided in the ubiquitous acceptance of the eight-bit size.[8] Modern architectures typically use 32- or 64-bit words, built of four or eight bytes."
    15 条回复    2018-11-08 14:00:12 +08:00
    alect
        1
    alect  
       2018-11-08 10:18:49 +08:00
    mm163
        2
    mm163  
       2018-11-08 10:19:12 +08:00
    为什么 9999 是四位数?
    013231
        3
    013231  
       2018-11-08 10:26:28 +08:00   ❤️ 3
    lululau
        4
    lululau  
       2018-11-08 10:28:25 +08:00
    3L 正解
    szq8014
        5
    szq8014  
       2018-11-08 10:38:33 +08:00
    就像英文有 26 个字母一样吧…………哎?
    你去看看 ASCII 表,8 位是能满足表示 26 个字母的前提下最 2^n 最小的了,还多出来一些可以设定成其他符号。
    还可能跟早期电脑 CPU 就是 8 位 16 位的有关。
    // 嗯。。我不对自己说的话负责。。
    mortonnex
        6
    mortonnex  
    OP
       2018-11-08 10:52:32 +08:00
    @013231
    @lululau
    @szq8014

    " Many types of applications use information representable in eight or fewer bits and processor designers optimize for this common usage. The popularity of major commercial computing architectures has aided in the ubiquitous acceptance of the eight-bit size.[8] Modern architectures typically use 32- or 64-bit words, built of four or eight bytes."

    学习了!
    imn1
        7
    imn1  
       2018-11-08 11:16:32 +08:00
    其实没搞清 LZ 想问什么
    liuxey
        8
    liuxey  
       2018-11-08 11:58:15 +08:00
    说到底还是历史原因,1B=8b 是最好的选择,既够用又不浪费。
    GeruzoniAnsasu
        9
    GeruzoniAnsasu  
       2018-11-08 12:19:08 +08:00
    https://blog.trailofbits.com/2017/07/30/an-extra-bit-of-analysis-for-clemency/

    不仅 8bit 只是约定俗成,大小端对齐也是约定俗称,你看 defcon2017 不就出了个 9bit 字节,3byte 中端对齐的题,说明这样的架构也是完全可行的,只是历史没有这样发展而已
    Akiyu
        10
    Akiyu  
       2018-11-08 12:34:25 +08:00
    楼上已经总结的很清楚了, 可以不是 8bit
    现在是 8bit 是因为大家已经约定成俗了, 还有一部分历史原因

    比如最开始的键盘, 包括现在的键盘, 是不适合人体的
    当意识到人体工学键盘更适合人体时, 推广人体工学键盘已经来不及了
    因为大多数人已经习惯了普通的键盘
    feather12315
        11
    feather12315  
       2018-11-08 12:38:52 +08:00 via Android
    字拓展和位拓展了解一下。
    af463419014
        12
    af463419014  
       2018-11-08 13:34:11 +08:00
    可能因为 8 是整数吧
    yksoft1
        13
    yksoft1  
       2018-11-08 13:53:52 +08:00
    MIME、Base64、EUC-JP 之类编码为何会存在,就是因为电子邮件标准里面一个字节就是 7 位。
    yksoft1
        14
    yksoft1  
       2018-11-08 13:55:43 +08:00
    是 ISO-2022-JP..
    liwufan
        15
    liwufan  
       2018-11-08 14:00:12 +08:00
    因为 IBM
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3604 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 10:32 · PVG 18:32 · LAX 03:32 · JFK 06:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.