资源简介
经典教材深入理解计算机系统最新版实验材料!
经典教材深入理解计算机系统最新版实验材料!

代码片段和文件信息
/*
* CS:APP Data Lab
*
*
*
* bits.c - Source file with your solutions to the Lab.
* This is the file you will hand in to your instructor.
*
* WARNING: Do not include the header; it confuses the dlc
* compiler. You can still use printf for debugging without including
* although you might get a compiler warning. In general
* it‘s not good practice to ignore compiler warnings but in this
* case it‘s OK.
*/
#if 0
/*
* Instructions to Students:
*
* STEP 1: Read the following instructions carefully.
*/
You will provide your solution to the Data Lab by
editing the collection of functions in this source file.
INTEGER CODING RULES:
Replace the “return“ statement in each function with one
or more lines of C code that implements the function. Your code
must conform to the following style:
int Funct(arg1 arg2 ...) {
/* brief description of how your implementation works */
int var1 = Expr1;
...
int varM = ExprM;
varJ = ExprJ;
...
varN = ExprN;
return ExprR;
}
Each “Expr“ is an expression using ONLY the following:
1. Integer constants 0 through 255 (0xFF) inclusive. You are
not allowed to use big constants such as 0xffffffff.
2. Function arguments and local variables (no global variables).
3. Unary integer operations ! ~
4. Binary integer operations & ^ | + << >>
Some of the problems restrict the set of allowed operators even further.
Each “Expr“ may consist of multiple operators. You are not restricted to
one operator per line.
You are expressly forbidden to:
1. Use any control constructs such as if do while for switch etc.
2. Define or use any macros.
3. Define any additional functions in this file.
4. Call any functions.
5. Use any other operations such as && || - or ?:
6. Use any form of casting.
7. Use any data type other than int. This implies that you
cannot use arrays structs or unions.
You may assume that your machine:
1. Uses 2s complement 32-bit representations of integers.
2. Performs right shifts arithmetically.
3. Has unpredictable behavior when shifting an integer by more
than the word size.
EXAMPLES OF ACCEPTABLE CODING style:
/*
* pow2plus1 - returns 2^x + 1 where 0 <= x <= 31
*/
int pow2plus1(int x) {
/* exploit ability of shifts to compute powers of 2 */
return (1 << x) + 1;
}
/*
* pow2plus4 - returns 2^x + 4 where 0 <= x <= 31
*/
int pow2plus4(int x) {
/* exploit ability of shifts to compute powers of 2 */
int result = (1 << x);
result += 4;
return result;
}
FLOATING POINT CODING RULES
For the problems that require you to implent floating-point operations
the coding rules are less strict. You are allowed to use looping and
conditional control. You are allowed to use both ints and unsigneds.
You can use arbitrary integer and unsigned constan
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8377 2016-05-05 00:49 csapp-lab\1-Data Lab\datalab-handout\bits.c
文件 748 2016-05-05 00:49 csapp-lab\1-Data Lab\datalab-handout\bits.h
文件 15752 2012-09-20 00:44 csapp-lab\1-Data Lab\datalab-handout\btest.c
文件 1006 2010-09-14 02:36 csapp-lab\1-Data Lab\datalab-handout\btest.h
文件 2127 2016-05-05 00:49 csapp-lab\1-Data Lab\datalab-handout\decl.c
文件 1210275 2016-05-05 00:49 csapp-lab\1-Data Lab\datalab-handout\dlc
文件 11798 2012-04-25 00:24 csapp-lab\1-Data Lab\datalab-handout\driver.pl
文件 267 2016-05-05 00:49 csapp-lab\1-Data Lab\datalab-handout\Driverhdrs.pm
文件 3630 2011-05-24 03:20 csapp-lab\1-Data Lab\datalab-handout\Driverlib.pm
文件 3009 2006-09-14 12:03 csapp-lab\1-Data Lab\datalab-handout\fshow.c
文件 1502 2006-09-14 12:03 csapp-lab\1-Data Lab\datalab-handout\ishow.c
文件 542 2010-11-02 22:24 csapp-lab\1-Data Lab\datalab-handout\Makefile
文件 4564 2011-06-01 00:32 csapp-lab\1-Data Lab\datalab-handout\README
文件 2026 2016-05-05 00:49 csapp-lab\1-Data Lab\datalab-handout\tests.c
文件 29875 2018-04-21 13:53 csapp-lab\1-Data Lab\datalab.pdf
文件 17496 2018-04-21 13:53 csapp-lab\1-Data Lab\README-datalab.pdf
文件 23874 2016-02-05 04:54 csapp-lab\10-Proxy Lab\proxylab-handout\csapp.c
文件 6621 2014-11-14 09:24 csapp-lab\10-Proxy Lab\proxylab-handout\csapp.h
文件 10658 2016-02-09 07:24 csapp-lab\10-Proxy Lab\proxylab-handout\driver.sh
文件 515 2013-11-14 09:26 csapp-lab\10-Proxy Lab\proxylab-handout\free-port.sh
文件 827 2016-02-05 05:35 csapp-lab\10-Proxy Lab\proxylab-handout\Makefile
文件 526 2013-11-26 01:26 csapp-lab\10-Proxy Lab\proxylab-handout\nop-server.py
文件 1020 2013-12-10 02:45 csapp-lab\10-Proxy Lab\proxylab-handout\port-for-user.pl
文件 396 2015-11-20 08:28 csapp-lab\10-Proxy Lab\proxylab-handout\proxy.c
文件 1406 2016-02-05 05:14 csapp-lab\10-Proxy Lab\proxylab-handout\README
文件 1001 2014-11-06 04:25 csapp-lab\10-Proxy Lab\proxylab-handout\tiny\cgi-bin\adder.c
文件 120 2002-06-04 12:08 csapp-lab\10-Proxy Lab\proxylab-handout\tiny\cgi-bin\Makefile
文件 23874 2016-02-05 04:55 csapp-lab\10-Proxy Lab\proxylab-handout\tiny\csapp.c
文件 6621 2016-02-05 04:55 csapp-lab\10-Proxy Lab\proxylab-handout\tiny\csapp.h
文件 12155 2001-12-09 02:23 csapp-lab\10-Proxy Lab\proxylab-handout\tiny\godzilla.gif
............此处省略142个文件信息
相关资源
- PCS7深入浅出西门子第一部V9.0
- 用友烟草行业工业集团管理解决方案
- Sun 为东京工业大学提供100 TeraFLOPS 超
- 计算的本质:深入剖析程序和计算机
- LANDesk 管理解决方案和采用英特尔:r
- MCS-51单片机定时器和计数器区别的理
- 《深入学习MongoDB》PDF
- 深入了解开关调节器的输出纹波和开
- HP OpenView身份管理解决方案白皮书
- 数据备份管理解决方案
- 光栅式万能测长仪的工作原理解析
- 深入解析CFL镇流器IC驱动LED应用电路
- PC机与嵌入式计算机系统串行通讯的硬
- 深入解析windows操作系统第六版 上册
- 计算机系统结构教程清华版
- 深入解析Windows操作系统第6版 上下册
- 深入理解大数据 大数据处理与编程实
- 深入理解Linux内核(第三版) PDF扫描
- 《深度解析SDN利益战略技术实践》张
- Spark技术内幕 深入解析Spark内核架构设
- 深入浅出4G网络 LTE EPC-张明和著_北京
- 微信小程序Demo/---欧拉蜜自然语言理解
- 深入理解计算机系统_第三版配套完整
- 深入浅出面向对象分析与设计中文版
- [百度网盘]Hadoop技术内幕 深入解析M
- 深入理解LINUX网络技术内幕 英文版
- csapp203483
- 自然语言处理-关键词提取四种方法
- 自动化拓扑生成、网络拓扑管理解决
- Hadoop技术内幕 深入解析YARN架构设计与
评论
共有 条评论