资源简介
此资源是上海交通大学ICS课程的PPT,Homework,lab材料,对于学习和理解计算机系统有很大帮助,此资源的配套教材是《深入理解计算机系统》
代码片段和文件信息
/*
* 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 constants.
You are e
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-09-30 17:14 Introduction to Computer Systems-1\
文件 181368 2018-09-01 22:15 Introduction to Computer Systems-1\hw-1-8.pdf
目录 0 2018-09-30 22:04 __MACOSX\
目录 0 2018-09-30 22:04 __MACOSX\Introduction to Computer Systems-1\
文件 513 2018-09-01 22:15 __MACOSX\Introduction to Computer Systems-1\._hw-1-8.pdf
文件 2260992 2018-09-01 22:09 Introduction to Computer Systems-1\1-1-intro 2.ppt
文件 442 2018-09-01 22:09 __MACOSX\Introduction to Computer Systems-1\._1-1-intro 2.ppt
文件 29338 2018-09-01 22:14 Introduction to Computer Systems-1\y86_set.png
文件 520 2018-09-01 22:14 __MACOSX\Introduction to Computer Systems-1\._y86_set.png
文件 4466 2018-09-01 22:13 Introduction to Computer Systems-1\asm.html
文件 517 2018-09-01 22:13 __MACOSX\Introduction to Computer Systems-1\._asm.html
文件 2445824 2018-09-01 22:09 Introduction to Computer Systems-1\1-6-x86 2.ppt
文件 440 2018-09-01 22:09 __MACOSX\Introduction to Computer Systems-1\._1-6-x86 2.ppt
文件 257517 2018-09-01 22:16 Introduction to Computer Systems-1\hw-1-13-sol.pdf
文件 518 2018-09-01 22:16 __MACOSX\Introduction to Computer Systems-1\._hw-1-13-sol.pdf
目录 0 2018-09-28 10:44 Introduction to Computer Systems-1\lab1\
文件 6148 2018-09-24 20:57 Introduction to Computer Systems-1\lab1\.DS_Store
目录 0 2018-09-30 22:04 __MACOSX\Introduction to Computer Systems-1\lab1\
文件 120 2018-09-24 20:57 __MACOSX\Introduction to Computer Systems-1\lab1\._.DS_Store
文件 29875 2018-09-23 20:51 Introduction to Computer Systems-1\lab1\datalab.pdf
文件 506 2018-09-23 20:51 __MACOSX\Introduction to Computer Systems-1\lab1\._datalab.pdf
目录 0 2018-09-28 10:44 Introduction to Computer Systems-1\lab1\datalab-handout\
文件 15752 2012-09-20 00:44 Introduction to Computer Systems-1\lab1\datalab-handout\btest.c
目录 0 2018-09-30 22:04 __MACOSX\Introduction to Computer Systems-1\lab1\datalab-handout\
文件 212 2012-09-20 00:44 __MACOSX\Introduction to Computer Systems-1\lab1\datalab-handout\._btest.c
文件 542 2010-11-02 22:24 Introduction to Computer Systems-1\lab1\datalab-handout\Makefile
文件 212 2010-11-02 22:24 __MACOSX\Introduction to Computer Systems-1\lab1\datalab-handout\._Makefile
文件 110 2018-09-28 10:44 Introduction to Computer Systems-1\lab1\datalab-handout\鏈嶅姟鍣ㄥ垎鍙戞椂闂?NF:us
文件 210 2018-09-28 10:44 __MACOSX\Introduction to Computer Systems-1\lab1\datalab-handout\._鏈嶅姟鍣ㄥ垎鍙戞椂闂?NF:us
文件 10794 2018-09-24 19:07 Introduction to Computer Systems-1\lab1\datalab-handout\bits.c
文件 268 2018-09-24 19:07 __MACOSX\Introduction to Computer Systems-1\lab1\datalab-handout\._bits.c
............此处省略312个文件信息
相关资源
- 《UML建模教程》
- 合肥工业大学数据库ppt
- 捷顺科技 智慧商业-行业方案-2019.p
- OpenCV图像处理视频课程 - 贾志刚 PP
- 并行计算课程PPT
- IMXRT1064RM.pdf
- 柔性直流输电讲座ppt汇总
- PPT模板 创意
- 第三、四篇论文.pptx
- 2013吉林大学信息学竞赛冬令营课程资
- 经典培训相关PPT模板_培训模板 (24)
- 经典培训相关PPT模板_培训模板 (16)
- 经典培训相关PPT模板_培训模板 (11)
- 华为HCIE-RS培训教材PPT全套
- 数据挖掘导论(完整版) PPT
- ajax学习ppt完整版
- 《学习OpenCV(中文版)》-于仕琪
- zemax非序列照明技巧汇编
- 2017_IBM_微课程_区块链和HyperLedger之P
- 蒋玉龙半导体器件原理 PPT
- 图解数据结构 使用C
- 电子科技大学图论杨春PPT+06-16年期末
- 计算机网络 7版 课件ppt
- 区块链 PPT 科普 学习 扫盲 原理 详解
- 清华大学孙富春教授PPT讲解人工智能
- 电视原理与系统 ppt
- HCNA-HNTD v2.1 培训教材与支持文档(P
- 设计模式ppt
- Docker ppt
- 软件工程第三版 齐治昌PPT
评论
共有 条评论