没有合适的资源?快使用搜索试试~ 我知道了~
首页探寻计算机硬件与软件的秘密编码之旅:理解现代技术的关键
探寻计算机硬件与软件的秘密编码之旅:理解现代技术的关键
需积分: 9 2 下载量 96 浏览量
更新于2024-07-18
收藏 2.56MB PDF 举报
"《代码:隐藏在电脑硬件和软件背后的语言》是由查尔斯·佩兹德尔(Charles Petzold)所著的一本深入浅出的计算机科学著作。这本书以独特的视角探讨了编程和编码理论在计算机技术发展中的核心作用,将复杂的概念通过日常物品和易于理解的语言系统如布莱叶盲文和莫尔斯码来呈现,让读者对计算机的“秘密内心世界”有更深的理解。 作者巧妙地运用比喻,比如将电脑与手电筒、英军入侵、黑猫和跷跷板等生活现象相联系,阐述了人类创新精神和沟通欲望如何推动了过去两个世纪的技术革新。通过讲述编码的演变历程,读者不仅可以了解到个人电脑(PC)、数字媒体和互联网的世界,还能从中获得实用的背景知识,无论技术水平高低,都能被书中的故事所吸引,甚至可能激发起对科技的热情。 本书特别强调了编程作为一种语言的重要性,它不仅体现在计算机硬件层面,也影响着软件的设计和交互方式。佩兹德尔解释了编码理论的基本原理,如二进制、逻辑门、算法和数据结构,这些都是现代计算机运作的基础。他还介绍了早期的通信编码方式,如摩尔斯码,这些编码方法启发了今天的数字化通信系统。 《代码》是一本寓教于乐的读物,旨在帮助读者跨越技术障碍,理解当今科技世界的运作机制。书中包含丰富的实例和插图,使得复杂的技术概念变得直观易懂。同时,它也提醒我们,无论是过去的发明还是现代技术,其背后都蕴含着人类智慧和创新的故事。无论你是技术新手还是资深专业人士,《代码》都能提供一个独特且富有洞察力的视角,带你探索计算机科学的奥秘。"
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/10726866/bg10.jpg)
12 Chapter Two
Of course, once we have a number multiplied by itself, we can start us-
ing exponents to show powers. For example, 2 × 2 × 2 × 2 can be written
as 2
4
(2 to the 4th power). The numbers 2, 4, 8, and 16 are all powers of
2 because you can calculate them by multiplying 2 by itself. So our summary
can also be shown like this:
Number of
Dots and Dashes Number of Codes
12
1
22
2
32
3
42
4
This table has become very simple. The number of codes is simply 2 to the
power of the number of dots and dashes. We might summarize the table data
in this simple formula:
number of codes = 2
number of dots and dashes
Powers of 2 tend to show up a lot in codes, and we’ll see another example
in the next chapter.
To make the process of decoding Morse code even easier, we might want
to draw something like the big treelike table shown here.
![](https://csdnimg.cn/release/download_crawler_static/10726866/bg11.jpg)
Codes and Combinations 13
This table shows the letters that result from each particular consecutive
sequence of dots and dashes. To decode a particular sequence, follow the
arrows from left to right. For example, suppose you want to know which
letter corresponds to the code dot-dash-dot. Begin at the left and choose the
dot; then continue moving right along the arrows and choose the dash and
then another dot. The letter is R, shown next to the last dot.
If you think about it, constructing such a table was probably necessary
for defining Morse code in the first place. First, it ensures that you don’t make
the dumb mistake of using the same code for two different letters! Second,
you’re assured of using all the possible codes without making the sequences
of dots and dashes unnecessarily long.
At the risk of extending this table beyond the limits of the printed page,
we could continue it for codes of five dots and dashes and more. A sequence
of exactly five dots and dashes gives us 32 (2×2×2×2×2, or 2
5
) additional
codes. Normally that would be enough for the 10 numbers and the 16 punc-
tuation symbols defined in Morse code, and indeed the numbers are encoded
with five dots and dashes. But many of the other codes that use a sequence
of five dots and dashes represent accented letters rather than punctuation
marks.
To include all the punctuation marks, the system must be expanded to six
dots and dashes, which gives us 64 (2×2×2×2×2×2, or 2
6
) additional codes
for a grand total of 2+4+8+16+32+64, or 126, characters. That’s overkill for
Morse code, which leaves many of these longer codes “undefined.” The word
undefined used in this context refers to a code that doesn’t stand for any-
thing. If you were receiving Morse code and you got an undefined code,
you could be pretty sure that somebody made a mistake.
Because we were clever enough to develop this little formula,
number of codes = 2
number of dots and dashes
we could continue figuring out how many codes we get from using longer
sequences of dots and dashes:
Number of
Dots and Dashes Number of Codes
12
1
= 2
22
2
= 4
32
3
= 8
42
4
= 16
52
5
= 32
62
6
= 64
72
7
= 128
82
8
= 256
92
9
= 512
10 2
10
= 1024
![](https://csdnimg.cn/release/download_crawler_static/10726866/bg12.jpg)
14 Chapter Two
Fortunately, we don’t have to actually write out all the possible codes to
determine how many there would be. All we have to do is multiply 2 by itself
over and over again.
Morse code is said to be a binary (literally meaning two by two) code
because the components of the code consist of only two things—a dot and
a dash. That’s similar to a coin, which can land only on the head side or the
tail side. Binary objects (such as coins) and binary codes (such as Morse code)
are always described by powers of two.
What we’re doing by analyzing binary codes is a simple exercise in the
branch of mathematics known as combinatorics or combinatorial analysis.
Traditionally, combinatorial analysis is used most often in the fields of prob-
ability and statistics because it involves determining the number of ways that
things, like coins and dice, can be combined. But it also helps us understand
how codes can be put together and taken apart.
![](https://csdnimg.cn/release/download_crawler_static/10726866/bg13.jpg)
15
Chapter Three
Braille and
Binary Codes
amuel Morse wasn’t the first person to successfully translate the let-
ters of written language to an interpretable code. Nor was he the first
person to be remembered more as the name of his code than as him-
self. That honor must go to a blind French teenager born some 18 years after
Samuel Morse but who made his mark much more precociously. Little is
known of his life, but what is known makes a compelling story.
Louis Braille was born in 1809 in Coupvray,
France, just 25 miles east of Paris. His father
was a harness maker. At the age of three—an age
when young boys shouldn’t be playing in their
fathers’ workshops—he accidentally stuck a
pointed tool in his eye. The wound became in-
fected, and the infection spread to his other eye,
leaving him totally blind. Normally he would
have been doomed to a life of ignorance and
poverty (as most blind people were in those days),
but young Louis’s intelligence and desire to learn
were soon recognized. Through the intervention
of the village priest and a schoolteacher, he first
attended school in the village with the other
children and at the age of 10 was sent to the Royal Institution for Blind Youth
in Paris.
S
![](https://csdnimg.cn/release/download_crawler_static/10726866/bg14.jpg)
16 Chapter Three
One major obstacle in the education of the blind is, of course, their in-
ability to read printed books. Valentin Haüy (1745–1822), the founder of
the Paris school, had invented a system of raised letters on paper that could
be read by touch. But this system was very difficult to use, and only a few
books had been produced using this method.
The sighted Haüy was stuck in a paradigm. To him, an A was an A was
an A, and the letter A must look (or feel) like an A. (If given a flashlight to
communicate, he might have tried drawing letters in the air as we did be-
fore we discovered it didn’t work very well.) Haüy probably didn’t realize
that a type of code quite different from the printed alphabet might be more
appropriate for sightless people.
The origins of an alternative type of code came from an unexpected
source. Charles Barbier, a captain of the French army, had by 1819 devised
a system of writing he called écriture nocturne, or “night writing.” This
system used a pattern of raised dots and dashes on heavy paper and was
intended for use by soldiers in passing notes to each other in the dark when
quiet was necessary. The soldiers were able to poke these dots and dashes
into the back of the paper using an awl-like stylus. The raised dots could then
be read with the fingers.
The problem with Barbier’s system is that it was quite complex. Rather
than using patterns of dots and dashes that corresponded to letters of the
alphabet, Barbier devised patterns that corresponded to sounds, often requir-
ing many codes for a single word. The system worked fine for short mes-
sages in the field but was distinctly inadequate for longer texts, let alone
entire books.
Louis Braille became familiar with Barbier’s system at the age of 12. He
liked the use of raised dots, not only because it proved easy to read with the
fingers but also because it was easy to write. A student in the classroom
equipped with paper and a stylus could actually take notes and read them
back. Louis Braille diligently tried to improve the system and within three
years (at the age of 15) had come up with his own, the basics of which are
still used today. For many years, the system was known only within the
school, but it gradually made its way to the rest of the world. In 1835, Louis
Braille contracted tuberculosis, which would eventually kill him shortly after
his 43rd birthday in 1852.
Today, enhanced versions of the Braille system compete with tape-
recorded books for providing the blind with access to the written word, but
Braille still remains an invaluable system and the only way to read for people
who are both blind and deaf. In recent years, Braille has become more fa-
miliar in the public arena as elevators and automatic teller machines are made
more accessible to the blind.
What we’re going to do in this chapter is dissect Braille code and see how
it works. We don’t have to actually learn Braille or memorize anything. We
just want some insight into the nature of codes.
In Braille, every symbol used in normal written language—specifically,
letters, numbers, and punctuation marks—is encoded as one or more raised
剩余399页未读,继续阅读
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![cmd](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
leadchange
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 多模态联合稀疏表示在视频目标跟踪中的应用
- Kubernetes资源管控与Gardener开源软件实践解析
- MPI集群监控与负载平衡策略
- 自动化PHP安全漏洞检测:静态代码分析与数据流方法
- 青苔数据CEO程永:技术生态与阿里云开放创新
- 制造业转型: HyperX引领企业上云策略
- 赵维五分享:航空工业电子采购上云实战与运维策略
- 单片机控制的LED点阵显示屏设计及其实现
- 驻云科技李俊涛:AI驱动的云上服务新趋势与挑战
- 6LoWPAN物联网边界路由器:设计与实现
- 猩便利工程师仲小玉:Terraform云资源管理最佳实践与团队协作
- 类差分度改进的互信息特征选择提升文本分类性能
- VERITAS与阿里云合作的混合云转型与数据保护方案
- 云制造中的生产线仿真模型设计与虚拟化研究
- 汪洋在PostgresChina2018分享:高可用 PostgreSQL 工具与架构设计
- 2018 PostgresChina大会:阿里云时空引擎Ganos在PostgreSQL中的创新应用与多模型存储
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)