forked from Hansimov/csapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitBook: [master] 119 pages modified
- Loading branch information
1 parent
978ccd0
commit 3ced41c
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Writeup | ||
|
||
> datalab.pdf | ||
> | ||
> 15-213, Fall 20xx | ||
> | ||
> Data Lab: Manipulating Bits | ||
Harry Bovik \([email protected]\) 是本作业的负责人。 | ||
|
||
## 1. 介绍 | ||
|
||
本作业的目的是更加熟悉整数和浮点数的位级表示。你可以通过解决一系列的编程“谜题”来做到这一点。这些谜题很多都是人造的,但你会发现自己在处理这些谜题的过程中,会更多地考虑位。 | ||
|
||
## 2. 支持 | ||
|
||
这是一个个人项目。所有提交内容都是电子版。说明和更正将公布在课程网页上。 | ||
|
||
## 3. 讲义说明 | ||
|
||
**此处插入一段内容,解释讲师如何给学生分发 datalab.handout.tar 文件。** | ||
|
||
开始先将 datalab-handout.tar 复制到一台 Linux 机器上(受保护的)目录中,您打算在该目录完成工作。然后输入命令 | ||
|
||
```c | ||
unix> tar xvf datalab-handout.tar | ||
``` | ||
|
||
这会把许多文件解压到目录中。你唯一需要修改和提交的文件是 bits.c。 | ||
|
||
bits.c 文件包含了 13 个编程谜题的框架。你的任务是完成每个函数框架,对于整数谜题只能使用直线代码(即,没有循环或条件语句),以及有限数量的 C 语言算术和逻辑运算符,具体来说,你只能使用以下 8 个运算符: | ||
|
||
```c | ||
! ˜ & ˆ | + << >> | ||
``` | ||
|
||
一些函数进一步限制了这个列表。此外,不允许使用任何长度超过 8 位的常量。有关详细规则和代码样式要求的讨论,请参见 bits.c 中的注释。 | ||
|
||
## 4. 谜题 | ||
|
||
本节介绍你将在 bits.c 中解决的谜题。 | ||
|
||
表 1 列出了从最简单到最困难的谜题。“难度级别”字段给出谜题的难度级别(点数),“最大操作符数”字段提供允许用于实现每个功能的最大运算符的数目。有关函数行为要求的更多详细信息,请参见 bits.c 中的注释。您也可以参考 tests.c 中的测试函数。这些函数被用作参考函数来表示函数的正确行为,尽管它们不满足函数的代码规则。 | ||
|
||
|
||
|