13Uint3 B3a
Power Circuit and Motor-mounted Apparatus Certifie
Power Circuit and Motor-mounted Apparatus Certified for CanadaAccessories, "Inrush Limiter SITOP Series", Model(s) 6EP1967-2AA00 Accessories , Model(s) 6EP4134-3AB00-0AY0, 6EP4134-3AB00-1AY0, 6EP4134-3AB00-2AY0, 6EP4136-3AB00-0AY0, 6EP4136-3AB00-1AY0, 6EP4136-3AB00-2AY0, 6EP4137-3AB00-0AY0, 6EP4137-3AB00-1AY0, 6EP4137-3AB00-2AY0Industrial control equipment, miscellaneous apparatus , Model(s) 6EP1333-1AL12, 6EP1333-3BA00, 6EP1333-3BA00-8AC0, 6EP1334-1AL12, 6EP1334-3BA00, 6EP1334-3BA00-8AB0, 6EP1336-2BA10, 6EP1336-3BA00, 6EP1336-3BA00-8AA0, 6EP1336-3BA10, 6EP1337-3BA00, 6EP1424-3BA00, 6EP1433-0AA00, 6EP1434-2BA10, 6EP1436-2BA10, 6EP1436-3BA00, 6EP1436-3BA00-8AA0, 6EP1436-3BA01, 6EP1436-3BA10, 6EP1437-2BA20, 6EP1437-3BA00, 6EP1437-3BA00-0AA0, 6EP1437-3BA00-8AA0, 6EP1437-3BA10, 6EP1437-3BA20, 6EP1456-2BA00, 6EP1456-3BA00, 6EP1457-3BA00, 6EP1457-3BA00-0AA0, 6EP1961-3BA01, 6EP1962-2BA00, 6EP1964-2BA00Industrial control equipment, miscellaneous apparatus, current monitors , Model(s) 6EP1961-2BA00Industrial control equipment, miscellaneous apparatus, hold-up modules , Model(s) 6EP1961-3BA00Industrial control equipment, miscellaneous apparatus, redundance modules , Model(s) 6EP1961-3BA20, 6EP1961-3BA21Industrial control equipment, miscellaneous apparatus, signaling modules , Model(s) 6EP1961-3BA10Miscellaneous apparatus, power supplies, open type , Model(s) 6EP1311-1SH02, 6EP1311-1SH03, 6EP1311-1SH12, 6EP1311-1SH13, 6EP1321-1SH02, 6EP1321-1SH03, 6EP1321-5BA00, 6EP1322-1SH02, 6EP1322-1SH03, 6EP1322-5BA10, 6EP1331-1SH02, 6EP1331-1SH03, 6EP1331-5BA00, 6EP1331-5BA10, 6EP1332-1SH04, 6EP1332-1SH42, 6EP1332-1SH43, 6EP1332-1SH51, 6EP1332-1SH52, 6EP1332-1SH61, 6EP1332-1SH71, 6EP1332-5BA00, 6EP1332-5BA10, 6EP1332-5BA20, 6EP1351-1SH02, 6EP1351-1SH03, 6EP1352-1SH02, 6EP1352-1SH03, 6EP1536-3AA00Miscellaneous apparatus, Power Supply Accessories, open type , Model(s) 6EP1931-2DC21, 6EP1931-2DC31, 6EP1931-2DC42, 6EP1931-2EC01, 6EP1931-2EC11, 6EP1931-2EC21, 6EP1931-2EC31, 6EP1931-2EC42, 6EP1931-2FC21, 6EP1931-2FC42, 6EP1933-2EC41, 6EP1933-2EC51, 6EP1935-5PG01Power supplies , Model(s) 6EP1321-1LD00, 6EP1332-1LD00Power supplies, open type, "AS-Interface Series", Model(s) 3RX9501-0BA00, 3RX9501-1BA00, 3RX9501-2BA00, 3RX9502-0BA00, 3RX9503-0BA00, 3RX9511-00AA00, 3RX9512-00AA00, 3RX9513-00AA00Power supplies, open type, "SITOP Series", Model(s) 6EP1322-2BA00, 6EP1322-2BA10, 6EP1323-2BA00, 6EP1332-2BA20, 6EP1333-2AA01, 6EP1333-2AA01-0AA0, 6EP1333-2BA01, 6EP1333-2BA20, 6EP1334-2AA01, 6EP1334-2AA01-0AA0, 6EP1334-2AA01-0AB0, 6EP1334-2AA01-0AC0, 6EP1334-2BA01, 6EP1334-2BA20, 6EP1332-1LB00, 6EP1333-1LB00, 6EP1334-1LB00Switch mode power supplies, open type, "SITOP EVS", Model(s) (SITOP EVP 100)6EP1232-1AA10, (SITOP EVP 150)6EP1233-1AA00, (SITOP EVP 300)6EP1234-1AA00, (SITOP EVP 60)6EP1232-1AA00Switch mode power supplies, open type, "SIYOUNG Power", Model(s) (SIYOUNG Power 100)6EP0123-2AAO-0AB0, (SIYOUNG Power 150)6EP0123-3AAO-0AB0, (SIYOUNG Power 300)6EP0123-4AAO-0AB0, (SIYOUNG Power 60)6EP0123-2AAO-0AA0Switching Power Supplies , Model(s) 6EP1322-1LD00, 6EP1331-1LD00, 6EP1332-1LD10, 6EP1333-1LD00, 6EP1334-1LD00NMTR7.E197259Power Circuit and Motor-mounted Apparatus Certified for CanadaPage BottomSee General Information for Power Circuit and Motor-mounted Apparatus Certified for CanadaSIEMENS AGE197259OESTERREICHSIMEAPOSTFACH 83, SIEMENSSTRASSE 901211 VIENNA, AUSTRIALast Updated on 2013-05-20Questions? Print this page Terms of Use Page Top© 2013 UL LLCWhen the UL Leaf Mark is on the product, or when the word "Environment" is included in the UL Mark, please search the UL Environment database for additional information regarding this product's certification.The appearance of a company's name or product in this database does not in itself assure that products so identified have been manufactured under UL's Follow-Up Service. Only those products bearing the UL Mark should be considered to be Certified and covered under UL's Follow-Up Service. Always look for the Mark on the product.UL permits the reproduction of the material contained in the Online Certification Directory subject to the following conditions: 1. The Guide Information, Assemblies, Constructions, Designs, Systems, and/or Certifications (files) must be presented in their entirety and in a non-misleading manner, without any manipulation of the data (or drawings). 2. The statement "Reprinted from the Online Certifications Directory with permission from UL" must appear adjacent to the extracted material. In addition, the reprinted material must include a copyright notice in the following format: "© 2013 UL LLC".。
单片机产生各种波形及其程序图
,0xc7,0xca,0xcc,0xcf,0xd1,0xd4,0xd6,0xd8,0xda,0xdd,0xdf,0xe1,0xe3,0xe5,0xe7,0xe
9,0xea,0xec,0xee,0xef,0xf1,0xf2,0xf4,0xf5
,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfd,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xfe,0xfd ,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7,0xf6,0xf5,0xf4,0xf2,0xf1,0xef,0xee,0xec,0xea,0x e9,0xe7,0xe5,0xe3,0xe1,0xde,0xdd,0xda ,0xd8,0xd6,0xd4,0xd1,0xcf,0xcc,0xca,0xc7,0xc5,0xc2,0xbf,0xbc,0xba,0xb7,0xb4,0xb 1,0xae,0xab,0xa8,0xa5,0xa2,0x9f,0x9c,0x99 ,0x96,0x93,0x90,0x8d,0x89,0x86,0x83,0x80,0x80,0x7c,0x79,0x76,0x72,0x6f,0x6c,0 x69,0x66,0x63,0x60,0x5d,0x5a,0x57,0x55,0x51 ,0x4e,0x4c,0x48,0x45,0x43,0x40,0x3d,0x3a,0x38,0x35,0x33,0x30,0x2e,0x2b,0x29,0 x27,0x25,0x22,0x20,0x1e,0x1c,0x1a,0x18,0x16 ,0x15,0x13,0x11,0x10,0x0e,0x0d,0x0b,0x0a,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0 x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02 ,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x09,0x0a,0x0b,0x0d,0x0e,0x10,0x11,0x13,0x15 ,0x16,0x18,0x1a,0x1c,0x1e,0x20,0x22,0x25,0x27,0x29,0x2b,0x2e,0x30,0x33,0x35,0 x38,0x3a,0x3d,0x40,0x43,0x45,0x48,0x4c,0x4e ,0x51,0x55,0x57,0x5a,0x5d,0x60,0x63,0x66 ,0x69,0x6c,0x6f,0x72,0x76,0x79,0x7c,0 x80 }; void delayms(uint t) {
3A Uint3 My friends—赵静
Play: Are you Mike
Unit 3
My
friends
He ′s my friend
Su Hai
She ′s my friend
He ′s my friend
She ′s my friend
She ′s my friend
He ′s my friend
3A Unit 3 My fri来自ndStory time
3
4
动动小脑袋
能为下面的内容找到他们的中文名字吗?用 线连接他们。
goodbye
he
she
friend
她
朋友
他
再见
情景选择
( B ) 1、与别人分别时,你说: ( B
( A
A. Hi B. Goodbye ) 2、你向爸爸介绍你的男同学时,你说: A. He′s my sister B. He′s my friend 3、你向你的妹妹介绍Mike,你说: ) A. He′s Mike B. she ′s my sister ,Tina
小小翻译家
1 she ′s my friend. 她是我的朋友。 他是Mike。 2 He ′s Mike. 3 He ′s my friend. 他是我的朋友。 她是李老师。 4 she ′s Miss Li. 5 Goodbye, Su Hai. 再见,苏海。 6 Good morning ,class. 早上好,同学们。
Homework
1 、和同伴一起创设情境, 介绍彼此的好朋友。
2、放学了,爸爸或妈妈来接 你,向他们介绍你的好朋友。
Thank you !
Chapter_07
Willy Sansen
10-05
0710
Symmetrical CMOS OTA
M7 1: M9 :1
VDD
M8 4
Differential pair 3 Current mirrors
5
M1 2
3
+
M2 1
vOUT
CL
Symmetrical : Node 1 = Node 2 Rail-to-rail output swing
fnd = ≈
gm3 2π Cn1 fT3NPN 3
2
1
M10
M11
VSS
Higher !
Willy Sansen
10-05
0728
Folded cascode OTA: input to Vss rail
M9 M5 7 M7 5 M6 6 M8 4
VDD
M1
0.9 V
3
+
M2
vOUT
CL
VT = 0.7 V VGS1-VT = 0.2 V VGS10-VT = 0.5 V V+ = 1.5 V VGS3-VT = 0.2 V
Willy Sansen 0723
10-05
Folded cascode CMOS OTA : DC
M9
VDD
50
M2
50
100
M1
DC current flow
-
3
+ +
M4
vOUT
50 50 100 100
M11
2
50 1 50
CL
VSS
Willy Sansen
10-05
Python.DataFrame基础与应用
Python.DataFrame基础与应⽤Python.DataFrame基础与应⽤$1$PandasSeries数据应⽤$2$概述$6$Series结构,也称Series序列,是Pandas常⽤的数据结构之⼀,它是⼀种类似于⼀维数组的结构,由⼀组数据值(value)和⼀组标签组成,其中标签与数据值之间是⼀⼀对应的关系。
$6$Series可以保存任何数据类型,⽐如整数、字符串、浮点数、Python对象等,它的标签默认为整数,从0开始依次递增。
Series的结构图,如下所⽰:即通过标签我们可以更加直观地查看数据所在的索引位置。
$2$创建Serise对象$1$DataFrame数据应⽤$2$概述$6$DataFrame是⼀个表格型的数据结构,既有⾏标签(index),⼜有列标签(columns),它也被称异构数据表,所谓异构,指的是表格中每列的数据类型可以不同,⽐如可以是字符串、整型或者浮点型等。
其结构$6$DataFrame的每⼀⾏数据都可以看成⼀个Series结构,只不过,DataFrame为这些⾏中每个数据值增加了⼀个列标签。
因此DataFrame其实是从Series的基础上演变⽽来。
在数据分析任务中DataFrame的应⽤⾮常$2$创建DataFrame对象$3$.基本语法$6$基本语法如下表importPandasaspd#导⼊Pandas库pd.DataFrame(data,index,columns,dtype,copy)$6$其参数解析如下:$7$data:输⼊的数据,可以是ndarray[1],series,list,dict,标量或⼀个DataFrame。
$7$index:⾏标签,如果没有传递index值,则默认⾏标签是np.arange(n),n代表data的元素个数。
$7$columns:列标签,如果没有传递columns值,则默认列标签是np.arange(n)。
$7$dtype:dtype表⽰强制转换每⼀列的数据类型。
新鲁教版英语七年级上册《uint 3 what does he look like》优秀教案3篇(重点资料).doc
Unit 3 What does he look like?一、教材简析:本单元的主要学习目标是学会介绍自己的外貌,能够谈论他人的外貌,并发表自己的看法。
相对于其他单元来说,本单元知识与其他语法项联系较少,是一个相对独立的单元。
在进行教学设计时,可以相对灵活地处理。
学习本单元所需知识储备主要是有关人的相貌的一些词汇如tall, short, straight, hair, eye,和句型She has ---,He is ---及”Yes/No ”questions 等。
本单元的能力培养目标是运用Guessing 的策略,结合现实中的人物,培养学生的仔细观察和准确描述人的相貌的能力。
二、教法设计:生词短语通过集中识词的方法;对于习语放在语境中讲释并进行模仿运用;对本单元重点“谈论人的外貌”,通过由词到句反复操练的方法突破。
三、单元教学目标:1.Knowing all the new words and expressions of this unit .ing the sentence patterns freely:What does he/she look like? He/She has ---/He/S he is---&Yes/No questions.ing the phrases freely.(教学重难点2)4.Developing students’ observing and describing abilities.四、教学重难点:一)谈论人的相貌(Talk about one’s physical appearance)二)重点单词和词组(Key words and Phrases)1. like prep. 像;像……一样2. look like 看起来像,看起来是……样子3. short adj. 短的;矮的4. hair n. 头发;毛发;(动物的)毛5. curly adj. 卷曲的;卷缩的6. straight adj. 直的;直线的;笔直的7. height n. 高度;身高8. thin adj. 瘦的9. heavy adj. 重的;沉的10. build n. (人的)体格11. popular adj. 为大众喜爱的;流行的;通俗的12. blonde adj. (或blond)金发的;金发碧眼的13. good-looking adj. 好看的;漂亮的14. bit n. 一点儿;少许;微量15.a little bit 有点儿;一点儿16. brown adj. 棕色的;褐色的17. bald adj. 秃头的;无发的或少发的18. beard n. 胡须19. glasses n. 眼镜20. mustache n. 长在嘴唇上部的胡须21. remember v. 想起,记得22. winner n. 获胜者23. award n.. 奖品;奖金24.nobody pron.. 没有人;无人五、课时课型安排:新授课3课时Section A 1课时Section B &Self check 1课时讲练课1课时单元测试课1课时六、教具:CAI课件录音机七、交际用语1. What do you look like?2. I’m short. I have curly hair.3.What do they look like?4.They’re medium height5.What does he/she look like?6.He/She is tall/medium height/short//thin/heavy//bald.7.He/She has a medium build//a beard//a mustache.8.He/she has long/short//blonde/brown/black…/straight/curly hair9.He/She wears glasses//a white T-shirt八、重点难点释义 (Language Points)1. have a medium build中等体格2. be medium height中等身高3. have short, blonde, curly hair留着短的金色的卷发4. have a beard长着络腮胡子5. the rock singer with funny glasses and long curly hair那位戴着滑稽眼镜,长着长卷发的摇滚歌手6. What does he look like? 他看上去什么样子?look like表示“看起来像……”在这里注意一下和be like的区别look like指的是“外观上像”的意思be like则是指“品德,相貌”等,例如:What is he like? 他是个什么样的人?7. She is good-looking but she is a little bit quiet . 她长得漂亮但有些内向。
AES-256算法C语言实现
AES-256算法C语⾔实现AES是美国确⽴的⼀种⾼级数据加密算法标准,它是⼀种对数据分组进⾏对称加密的算法,这种算法是由⽐利时的Joan Daemen和Vincent Rijmen设计的,因此⼜被称为RIJNDAE算法.根据密钥长度的不同,AES标准⼜区分为AES-128, AES-192, AES-256三种,密钥越长,对每⼀数据分组进⾏的加密步骤(加密轮数)也越多.AES-128/192/256分别对应10/12/14轮加密步骤. AES-256对应的密钥长度为256bits, 其每⼀数据分组都需要进⾏14轮的加密运算,(若将初始轮+结束轮视为完整⼀轮, 总共就是14轮).AES规定每⼀数据分组长度均为128bits.由于加密过程中每⼀轮都需要⼀个密钥,因此⾸先需要从输⼊密钥(也称为种⼦密码)扩展出Nr(10/12/14)个密钥,总共是Nr+1个密钥.AES加密步骤:密钥扩展(每⼀轮加密都需要⼀个密钥) -> 初始轮加密(⽤输⼊密钥 AddRoundKey) ->重复轮加密(⽤扩展密钥SubBytes/ShiftRow/MixColumns/AddRoundKey) -> 结束轮加密(⽤扩展密钥 SubBytes/ShiftRows/AddRoundKey)AES解密步骤:密钥扩展(每⼀轮解密都需要⼀个密钥) -> 初始轮解密(⽤输⼊密钥AddRoundKey) ->重复轮解密(⽤扩展密钥InvShiftRows/InvSubBytes/AddRoundKey/InvMixColumns) -> 结束轮解密(⽤扩展密钥InvShiftRows/InvSubBytes/AddRoundKey)加/解密步骤由以下基本算⼦组成AddRoundKey: 加植密钥SubBytes: 字节代换InvSubBytes: 字节逆代换ShiftRow: ⾏移位InvShiftRow: ⾏逆移位MixColumn: 列混合InvMixColumn: 列逆混合AES的加密和解密互为逆过程, 因此两个过程其实可以相互交换.对⽂件进⾏AES加密, 就是将⽂件划分成多个数据分组,每个为128bit,然后对每⼀个数据分组进⾏如上所叙的加密处理.参考资料:Advanced Encryption Standard (AES) (FIPS PUB 197) (November 26, 2001)Advanced Encryption Standard by Example (by Adam Berent)下⾯是具体的AES-256加密解/密程序和注释.程序内也包含了AES-128/AES-192相应的测试数据,如有兴趣可以选择不同标准进⾏测试.为了演⽰⽅便,程序只进⾏了⼀个分组的加密和解密运算.并在密钥扩展和每轮计算后都将结果打印出来,以⽅便与AES标准⽂件中的例⼦进⾏⽐较.在Linux环境下编译和执⾏:gcc -o aes256 aes256.c./aes256/*---------------------------------------------------------------------This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License version 2 aspublished by the Free Software Foundation.A test for AES encryption (RIJNDAEL symmetric key encryption algorithm).Reference:1. Advanced Encryption Standard (AES) (FIPS PUB 197)2. Advanced Encryption Standard by Example (by Adam Berent)Note:1. Standard and parameters.Key Size Block Size Number of Rounds(Nk words) (Nb words) (Nr)AES-128 4 4 10AES-192 6 4 12AES-256 8 4 14Midas Zhoumidaszhou@https:///widora/wegi----------------------------------------------------------------------*/#include <stdio.h>#include <stdint.h>#include <string.h>/* S_BOX S盒 */static const uint8_t sbox[256] = {/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16 };/* Reverse S_BOX 反向S盒 */static const uint8_t rsbox[256] = {/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB, 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D };/* Galois Field Multiplication E-table GF乘法E表 */static const uint8_t Etab[256]= {/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */0x01, 0x03, 0x05, 0x0F, 0x11, 0x33, 0x55, 0xFF, 0x1A, 0x2E, 0x72, 0x96, 0xA1, 0xF8, 0x13, 0x35,0xE5, 0x34, 0x5C, 0xE4, 0x37, 0x59, 0xEB, 0x26, 0x6A, 0xBE, 0xD9, 0x70, 0x90, 0xAB, 0xE6, 0x31,0x53, 0xF5, 0x04, 0x0C, 0x14, 0x3C, 0x44, 0xCC, 0x4F, 0xD1, 0x68, 0xB8, 0xD3, 0x6E, 0xB2, 0xCD,0x4C, 0xD4, 0x67, 0xA9, 0xE0, 0x3B, 0x4D, 0xD7, 0x62, 0xA6, 0xF1, 0x08, 0x18, 0x28, 0x78, 0x88,0x83, 0x9E, 0xB9, 0xD0, 0x6B, 0xBD, 0xDC, 0x7F, 0x81, 0x98, 0xB3, 0xCE, 0x49, 0xDB, 0x76, 0x9A,0xB5, 0xC4, 0x57, 0xF9, 0x10, 0x30, 0x50, 0xF0, 0x0B, 0x1D, 0x27, 0x69, 0xBB, 0xD6, 0x61, 0xA3,0xFE, 0x19, 0x2B, 0x7D, 0x87, 0x92, 0xAD, 0xEC, 0x2F, 0x71, 0x93, 0xAE, 0xE9, 0x20, 0x60, 0xA0,0xFB, 0x16, 0x3A, 0x4E, 0xD2, 0x6D, 0xB7, 0xC2, 0x5D, 0xE7, 0x32, 0x56, 0xFA, 0x15, 0x3F, 0x41,0xC3, 0x5E, 0xE2, 0x3D, 0x47, 0xC9, 0x40, 0xC0, 0x5B, 0xED, 0x2C, 0x74, 0x9C, 0xBF, 0xDA, 0x75,0x9F, 0xBA, 0xD5, 0x64, 0xAC, 0xEF, 0x2A, 0x7E, 0x82, 0x9D, 0xBC, 0xDF, 0x7A, 0x8E, 0x89, 0x80,0x9B, 0xB6, 0xC1, 0x58, 0xE8, 0x23, 0x65, 0xAF, 0xEA, 0x25, 0x6F, 0xB1, 0xC8, 0x43, 0xC5, 0x54,0xFC, 0x1F, 0x21, 0x63, 0xA5, 0xF4, 0x07, 0x09, 0x1B, 0x2D, 0x77, 0x99, 0xB0, 0xCB, 0x46, 0xCA,0x45, 0xCF, 0x4A, 0xDE, 0x79, 0x8B, 0x86, 0x91, 0xA8, 0xE3, 0x3E, 0x42, 0xC6, 0x51, 0xF3, 0x0E,0x12, 0x36, 0x5A, 0xEE, 0x29, 0x7B, 0x8D, 0x8C, 0x8F, 0x8A, 0x85, 0x94, 0xA7, 0xF2, 0x0D, 0x17,0x39, 0x4B, 0xDD, 0x7C, 0x84, 0x97, 0xA2, 0xFD, 0x1C, 0x24, 0x6C, 0xB4, 0xC7, 0x52, 0xF6, 0x01};/* Galois Field Multiplication L-table GF乘法L表 */static const uint8_t Ltab[256]= {/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */0x0, 0x0, 0x19, 0x01, 0x32, 0x02, 0x1A, 0xC6, 0x4B, 0xC7, 0x1B, 0x68, 0x33, 0xEE, 0xDF, 0x03, // 00x64, 0x04, 0xE0, 0x0E, 0x34, 0x8D, 0x81, 0xEF, 0x4C, 0x71, 0x08, 0xC8, 0xF8, 0x69, 0x1C, 0xC1, // 10x7D, 0xC2, 0x1D, 0xB5, 0xF9, 0xB9, 0x27, 0x6A, 0x4D, 0xE4, 0xA6, 0x72, 0x9A, 0xC9, 0x09, 0x78, // 20x65, 0x2F, 0x8A, 0x05, 0x21, 0x0F, 0xE1, 0x24, 0x12, 0xF0, 0x82, 0x45, 0x35, 0x93, 0xDA, 0x8E, // 30x96, 0x8F, 0xDB, 0xBD, 0x36, 0xD0, 0xCE, 0x94, 0x13, 0x5C, 0xD2, 0xF1, 0x40, 0x46, 0x83, 0x38, // 40x66, 0xDD, 0xFD, 0x30, 0xBF, 0x06, 0x8B, 0x62, 0xB3, 0x25, 0xE2, 0x98, 0x22, 0x88, 0x91, 0x10, // 50x7E, 0x6E, 0x48, 0xC3, 0xA3, 0xB6, 0x1E, 0x42, 0x3A, 0x6B, 0x28, 0x54, 0xFA, 0x85, 0x3D, 0xBA, // 60x2B, 0x79, 0x0A, 0x15, 0x9B, 0x9F, 0x5E, 0xCA, 0x4E, 0xD4, 0xAC, 0xE5, 0xF3, 0x73, 0xA7, 0x57, // 70xAF, 0x58, 0xA8, 0x50, 0xF4, 0xEA, 0xD6, 0x74, 0x4F, 0xAE, 0xE9, 0xD5, 0xE7, 0xE6, 0xAD, 0xE8, // 80x2C, 0xD7, 0x75, 0x7A, 0xEB, 0x16, 0x0B, 0xF5, 0x59, 0xCB, 0x5F, 0xB0, 0x9C, 0xA9, 0x51, 0xA0, // 90x7F, 0x0C, 0xF6, 0x6F, 0x17, 0xC4, 0x49, 0xEC, 0xD8, 0x43, 0x1F, 0x2D, 0xA4, 0x76, 0x7B, 0xB7, // A0xCC, 0xBB, 0x3E, 0x5A, 0xFB, 0x60, 0xB1, 0x86, 0x3B, 0x52, 0xA1, 0x6C, 0xAA, 0x55, 0x29, 0x9D, // B0x97, 0xB2, 0x87, 0x90, 0x61, 0xBE, 0xDC, 0xFC, 0xBC, 0x95, 0xCF, 0xCD, 0x37, 0x3F, 0x5B, 0xD1, // C0x53, 0x39, 0x84, 0x3C, 0x41, 0xA2, 0x6D, 0x47, 0x14, 0x2A, 0x9E, 0x5D, 0x56, 0xF2, 0xD3, 0xAB, // D0x44, 0x11, 0x92, 0xD9, 0x23, 0x20, 0x2E, 0x89, 0xB4, 0x7C, 0xB8, 0x26, 0x77, 0x99, 0xE3, 0xA5, // E0x67, 0x4A, 0xED, 0xDE, 0xC5, 0x31, 0xFE, 0x18, 0x0D, 0x63, 0x8C, 0x80, 0xC0, 0xF7, 0x70, 0x07 // F};/* RCON 表 */static const uint32_t Rcon[15]= {0x01000000,0x02000000,0x04000000,0x08000000,0x10000000,0x20000000,0x40000000,0x80000000,0x1B000000,0x36000000,0x6C000000,0xD8000000,0xAB000000,0x4D000000,0x9A000000};/* Functions */void print_state(const uint8_t *s); /* 打印分组数据 */int aes_ShiftRows(uint8_t *state); /* ⾏移位 */int aes_InvShiftRows(uint8_t *state); /* ⾏逆移位 */int aes_ExpRoundKeys(uint8_t Nr, uint8_t Nk, const uint8_t *inkey, uint32_t *keywords); /* 密钥扩展 */int aes_AddRoundKey(uint8_t Nr, uint8_t Nk, uint8_t round, uint8_t *state, const uint32_t *keywords); /* 加植密钥 */ int aes_EncryptState(uint8_t Nr, uint8_t Nk, uint32_t *keywords, uint8_t *state); /* 分组加密 */int aes_DecryptState(uint8_t Nr, uint8_t Nk, uint32_t *keywords, uint8_t *state); /* 分组解密 *//*==============MAIN===============*/int main(void){int i,k;const uint8_t Nb=4; /* 分组长度 Block size in words, 4/4/4 for AES-128/192/256 */uint8_t Nk; /* 密钥长度 column number, as of 4xNk, 4/6/8 for AES-128/192/256 */uint8_t Nr; /* 加密轮数 Number of rounds, 10/12/14 for AES-128/192/256 */uint8_t state[4*4]; /* 分组数据 State array, data in row sequence! */uint64_t ns; /* 总分组数 Total number of states *//* 待加密数据 */const uint8_t input_msg[]= {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xaa,0xbb,0xcc,0xdd,0xee,0xff};/* AES-128/192/256 对应的密钥长度,加密轮数, 输⼊密钥 */#if 0 /* TEST data --- AES-128 */Nk=4;Nr=10;const uint8_t inkey[4*4]= { /* Nb*Nk */0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};#endif#if 0 /* TEST data --- AES-192 */Nk=6;Nr=12;const uint8_t inkey[4*6]= { /* Nb*Nk */0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17};#endif#if 1 /* TEST data --- AES-256 */Nk=8;Nr=14;const uint8_t inkey[4*8]= { /* Nb*Nk */0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f};#endif/* 密钥扩展测试数据------TEST: For Key expansion */#if 0Nk=4;Nr=10;const uint8_t inkey[4*4]= /* Nb*Nk */{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; #endif#if 0Nk=6;Nr=12;const uint8_t inkey[4*6]= /* Nb*Nk */{ 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b,0x80, 0x90, 0x79, 0xe5, 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b };#endif#if 0Nk=8;const uint8_t inkey[4*8]= /* Nb*Nk */{ 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 };#endifuint32_t keywords[Nb*(Nr+1)]; /* ⽤于存放扩展密钥,总共Nr+1把密钥 Nb==4, All expended keys, as of words in a column: 0xb0b1b2b3 *//* 从输⼊密钥产⽣Nk+1个轮密,每轮需要⼀个密钥 Generate round keys */aes_ExpRoundKeys(Nr, Nk, inkey, keywords);/* 数据分组数量,这⾥我们只设定为1组. Cal. total states *///ns=(strlen(input_msg)+15)/16;ns=1;/* 如果是多个分组,那么分别对每个分组进⾏加密,i=0 ~ ns-1 */i=0; /* i=0 ~ ns-1 *//* 将待加密数据放⼊到数据分组state[]中,注意:state[]中数据按column顺序存放! */bzero(state,16);for(k=0; k<16; k++)state[(k%4)*4+k/4]=input_msg[i*16+k];/* 加密数据分组 Encrypt each state */aes_EncryptState(Nr, Nk, keywords, state);/* 打印加密后的分组数据 */printf("***********************************\n");printf("******* Finish Encryption *******\n");printf("***********************************\n");print_state(state);/* 解密数据分组 Decrypt state */aes_DecryptState(Nr, Nk, keywords, state);//printf("Finish decrypt message, Round Nr=%d, KeySize Nk=%d, States ns=%llu.\n", Nr, Nk, ns);/* 打印解密后的分组数据 */printf("***********************************\n");printf("******* Finish Decryption *******\n");printf("***********************************\n");print_state(state);return 0;}/* 打印分组数据 Print state */void print_state(const uint8_t *s){int i,j;for(i=0; i<4; i++) {for(j=0; j<4; j++) {printf("%02x",s[i*4+j]);//printf("'%c'",s[i*4+j]); /* A control key MAY erase previous chars on screen! */printf(" ");}printf("\n");}printf("\n");}/*------------------------------⾏移位Shift operation of the state.Return:0 OK<0 Fails-------------------------------*/int aes_ShiftRows(uint8_t *state){int j,k;uint8_t tmp;if(state==NULL)return -1;for(k=0; k<4; k++) {/* each row shift k times */for(j=0; j<k; j++) {tmp=*(state+4*k); /* save the first byte *///memcpy(state+4*k, state+4*k+1, 3);memmove(state+4*k, state+4*k+1, 3);*(state+4*k+3)=tmp; /* set the last byte */}}return 0;}/*------------------------------⾏逆移位Shift operation of the state.@state[4*4]Return:0 OK<0 Fails-------------------------------*/int aes_InvShiftRows(uint8_t *state){int j,k;uint8_t tmp;if(state==NULL)return -1;for(k=0; k<4; k++) {/* each row shift k times */for(j=0; j<k; j++) {tmp=*(state+4*k+3); /* save the last byte */memmove(state+4*k+1, state+4*k, 3);*(state+4*k)=tmp; /* set the first byte */}}return 0;}/*-------------------------------------------------------------加植密钥Add round key to the state.@Nr: Number of rounds, 10/12/14 for AES-128/192/256 @Nk: Key size, in words.@round: Current round number.@state: Pointer to state.@keywords[Nb*(Nr+1)]: All round keys, in words.int aes_AddRoundKey(uint8_t Nr, uint8_t Nk, uint8_t round, uint8_t *state, const uint32_t *keywords){int k;if(state==NULL || keywords==NULL)return -1;for(k=0; k<4*4; k++)state[k] = ( keywords[round*4+k%4]>>((3-(k>>2))<<3) &0xFF )^state[k];return 0;}/*----------------------------------------------------------------------------------------------------------密钥扩展从输⼊密钥(也称为种⼦密码)扩展出Nr(10/12/14)个密钥,总共是Nr+1个密钥Generate round keys.@Nr: Number of rounds, 10/12/14 for AES-128/192/256@Nk: Key size, in words.@inkey[4*Nk]: Original key, 4*Nk bytes, arranged row by row.@keywords[Nb*(Nr+1)]: Output keys, in words. Nb*(Nr+1)one keywords(32 bytes) as one column of key_bytes(4 bytes)Note:1. The caller MUST ensure enough mem space of input params.Return:0 Ok<0 Fails---------------------------------------------------------------------------------------------------------------*/int aes_ExpRoundKeys(uint8_t Nr, uint8_t Nk, const uint8_t *inkey, uint32_t *keywords){int i;const int Nb=4;uint32_t temp;if(inkey==NULL || keywords==NULL)return -1;/* Re_arrange inkey to keywords, convert 4x8bytes each row_data to a 32bytes keyword, as a complex column_data. */ for( i=0; i<Nk; i++ ) {keywords[i]=(inkey[4*i]<<24)+(inkey[4*i+1]<<16)+(inkey[4*i+2]<<8)+inkey[4*i+3];}/* Expend round keys */for(i=Nk; i<Nb*(Nr+1); i++) {temp=keywords[i-1];if( i%Nk==0 ) {/* RotWord */temp=( temp<<8 )+( temp>>24 );/* Subword */temp=(sbox[temp>>24]<<24) +(sbox[(temp>>16)&0xFF]<<16) +(sbox[(temp>>8)&0xFF]<<8)+sbox[temp&0xFF];/* temp=SubWord(RotWord(temp)) XOR Rcon[i/Nk-1] */temp=temp ^ Rcon[i/Nk-1];}else if (Nk>6 && i%Nk==4 ) {/* Subword */temp=(sbox[temp>>24]<<24) +(sbox[(temp>>16)&0xFF]<<16) +(sbox[(temp>>8)&0xFF]<<8)+sbox[temp&0xFF];}/* Get keywords[i] */}/* Print all keys */for(i=0; i<Nb*(Nr+1); i++)printf("keywords[%d]=0x%08X\n", i, keywords[i]);return 0;}/*----------------------------------------------------------------------数据分组加密Encrypt state.@Nr: Number of rounds, 10/12/14 for AES-128/192/256@Nk: Key length, in words.@keywordss[Nb*(Nr+1)]: All round keys, in words.@state[4*4]: The state block.Note:1. The caller MUST ensure enough mem space of input params.Return:0 Ok<0 Fails------------------------------------------------------------------------*/int aes_EncryptState(uint8_t Nr, uint8_t Nk, uint32_t *keywords, uint8_t *state) {int i,k;uint8_t round;uint8_t mc[4]; /* Temp. var */if(keywords==NULL || state==NULL)return -1;/* 1. AddRoundKey: 加植密钥 */printf(" --- Add Round_key ---\n");aes_AddRoundKey(Nr, Nk, 0, state, keywords);print_state(state);/* 循环Nr-1轮加密运算 Run Nr round functions */for( round=1; round<Nr; round++) { /* Nr *//* 2. SubBytes: 字节代换 Substitue State Bytes with SBOX */printf(" --- SubBytes() Round:%d ---\n",round);for(k=0; k<16; k++)state[k]=sbox[state[k]];print_state(state);/* 3. ShiftRow: ⾏移位 Shift State Rows */printf(" --- ShiftRows() Round:%d ---\n",round);aes_ShiftRows(state);print_state(state);/* 4. MixColumn: 列混合 Mix State Cloumns *//* Galois Field Multiplication, Multi_Matrix:2 3 1 11 2 3 11 12 33 1 1 2Note:1. Any number multiplied by 1 is equal to the number itself.2. Any number multiplied by 0 is 0!*/printf(" --- MixColumn() Round:%d ---\n",round);mc[0]= ( state[i]==0 ? 0 : Etab[(Ltab[state[i]]+Ltab[2])%0xFF] )^( state[i+4]==0 ? 0 : Etab[(Ltab[state[i+4]]+Ltab[3])%0xFF] )^state[i+8]^state[i+12];mc[1]= state[i]^( state[i+4]==0 ? 0 : Etab[(Ltab[state[i+4]]+Ltab[2])%0xFF] )^( state[i+8]==0 ? 0 : Etab[(Ltab[state[i+8]]+Ltab[3])%0xFF] )^state[i+12];mc[2]= state[i]^state[i+4]^( state[i+8]==0 ? 0 : Etab[(Ltab[state[i+8]]+Ltab[2])%0xFF] )^( state[i+12]==0 ? 0 : Etab[(Ltab[state[i+12]]+Ltab[3])%0xFF] );mc[3]= ( state[i]==0 ? 0 : Etab[(Ltab[state[i]]+Ltab[3])%0xFF] )^state[i+4]^state[i+8]^( state[i+12]==0 ? 0 : Etab[(Ltab[state[i+12]]+Ltab[2])%0xFF] );state[i+0]=mc[0];state[i+4]=mc[1];state[i+8]=mc[2];state[i+12]=mc[3];}print_state(state);/* 5. AddRoundKey: 加植密钥 Add State with Round Key */printf(" --- Add Round_key ---\n");aes_AddRoundKey(Nr, Nk, round, state, keywords);print_state(state);} /* END Nr rounds *//* 6. SubBytes: 字节代换 Substitue State Bytes with SBOX */printf(" --- SubBytes() Round:%d ---\n",round);for(k=0; k<16; k++)state[k]=sbox[state[k]];print_state(state);/* 7. ShiftRow: ⾏移位 Shift State Rows */printf(" --- ShiftRows() Round:%d ---\n",round);aes_ShiftRows(state);print_state(state);/* 8. AddRoundKey: 加植密钥 Add State with Round Key */printf(" --- Add Round_key ---\n");aes_AddRoundKey(Nr, Nk, round, state, keywords);print_state(state);return 0;}/*----------------------------------------------------------------------Decrypt the state.@Nr: Number of rounds, 10/12/14 for AES-128/192/256@Nk: Key length, in words.@keywordss[Nb*(Nr+1)]: All round keys, in words.@state[4*4]: The state block.Note:1. The caller MUST ensure enough mem space of input params.Return:0 Ok<0 Fails------------------------------------------------------------------------*/int aes_DecryptState(uint8_t Nr, uint8_t Nk, uint32_t *keywords, uint8_t *state)int i,k;uint8_t round;uint8_t mc[4]; /* Temp. var */if(keywords==NULL || state==NULL)return -1;/* 1. AddRoundKey: 加植密钥 Add round key */printf(" --- Add Round_key ---\n");aes_AddRoundKey(Nr, Nk, Nr, state, keywords); /* From Nr_th round */ print_state(state);/* 循环Nr-1轮加密运算 Run Nr round functions */for( round=Nr-1; round>0; round--) { /* round [Nr-1 1] *//* 2. InvShiftRow: ⾏逆移位 InvShift State Rows */printf(" --- InvShiftRows() Round:%d ---\n",Nr-round);aes_InvShiftRows(state);print_state(state);/* 3. InvSubBytes: 字节逆代换 InvSubstitue State Bytes with R_SBOX */printf(" --- (Inv)SubBytes() Round:%d ---\n",Nr-round);for(k=0; k<16; k++)state[k]=rsbox[state[k]];print_state(state);/* 4. AddRoundKey: 加植密钥 Add State with Round Key */printf(" --- Add Round_key Round:%d ---\n", Nr-round);aes_AddRoundKey(Nr, Nk, round, state, keywords);print_state(state);/* 5. InvMixColumn: 列逆混合 Inverse Mix State Cloumns *//* Galois Field Multiplication, Multi_Matrix:0x0E 0x0B 0x0D 0x090x09 0x0E 0x0B 0x0D0x0D 0x09 0x0E 0x0B0x0B 0x0D 0x09 0x0ENote:1. Any number multiplied by 1 is equal to the number itself.2. Any number multiplied by 0 is 0!*/printf(" --- InvMixColumn() Round:%d ---\n",Nr-round);for(i=0; i<4; i++) { /* i as column index */mc[0]= ( state[i]==0 ? 0 : Etab[(Ltab[state[i]]+Ltab[0x0E])%0xFF] )^( state[i+4]==0 ? 0 : Etab[(Ltab[state[i+4]]+Ltab[0x0B])%0xFF] )^( state[i+8]==0 ? 0 : Etab[(Ltab[state[i+8]]+Ltab[0x0D])%0xFF] )^( state[i+12]==0 ? 0 : Etab[(Ltab[state[i+12]]+Ltab[0x09])%0xFF] );mc[1]= ( state[i]==0 ? 0 : Etab[(Ltab[state[i]]+Ltab[0x09])%0xFF] )^( state[i+4]==0 ? 0 : Etab[(Ltab[state[i+4]]+Ltab[0x0E])%0xFF] )^( state[i+8]==0 ? 0 : Etab[(Ltab[state[i+8]]+Ltab[0x0B])%0xFF] )^( state[i+12]==0 ? 0 : Etab[(Ltab[state[i+12]]+Ltab[0x0D])%0xFF] );mc[2]= ( state[i]==0 ? 0 : Etab[(Ltab[state[i]]+Ltab[0x0D])%0xFF] )^( state[i+4]==0 ? 0 : Etab[(Ltab[state[i+4]]+Ltab[0x09])%0xFF] )^( state[i+8]==0 ? 0 : Etab[(Ltab[state[i+8]]+Ltab[0x0E])%0xFF] )^( state[i+12]==0 ? 0 : Etab[(Ltab[state[i+12]]+Ltab[0x0B])%0xFF] );mc[3]= ( state[i]==0 ? 0 : Etab[(Ltab[state[i]]+Ltab[0x0B])%0xFF] )^( state[i+4]==0 ? 0 : Etab[(Ltab[state[i+4]]+Ltab[0x0D])%0xFF] )^( state[i+8]==0 ? 0 : Etab[(Ltab[state[i+8]]+Ltab[0x09])%0xFF] )^( state[i+12]==0 ? 0 : Etab[(Ltab[state[i+12]]+Ltab[0x0E])%0xFF] );state[i+0]=mc[0];state[i+4]=mc[1];state[i+8]=mc[2];state[i+12]=mc[3];print_state(state);} /* END Nr rounds *//* 6. InvShiftRow: ⾏逆移位 Inverse Shift State Rows */printf(" --- InvShiftRows() Round:%d ---\n",Nr-round);aes_InvShiftRows(state);print_state(state);/* 7. InvSubBytes: 字节逆代换 InvSubstitue State Bytes with SBOX */ printf(" --- InvSubBytes() Round:%d ---\n",Nr-round);for(k=0; k<16; k++)state[k]=rsbox[state[k]];print_state(state);/* 8. AddRoundKey: 加植密钥 Add State with Round Key */printf(" --- Add Round_key Round:%d ---\n",Nr-round);aes_AddRoundKey(Nr, Nk, 0, state, keywords);print_state(state);return 0;}。
浙大中控比较功能块库使用手册
VisualField系统软件比较功能块库使用手册浙江中控技术股份有限公司声明严禁转载本手册的部分或全部内容。
在不经预告和联系的情况下,本手册的内容有可能发生变更,请谅解。
本手册所记载的内容,不排除有误记或遗漏的可能性。
如对本手册内容有疑问,请与我公司联系。
文档标志符定义警告:标示有可能导致人身伤亡或设备损坏的信息。
WARNING: Indicates information that a potentially hazardous situation which, if not avoided,could result in serious injury or death.电击危险:标示有可能产生电击危险的信息。
Risk of electrical shock: Indicates information that Potential shock hazard where HAZARDOUSLIVE voltages greater than 30V RMS, 42.4V peak, or 60V DC may be accessible.防止静电:标示防止静电损坏设备的信息。
ESD HAZARD: Indicates information that Danger of an electro-static discharge to whichequipment may be sensitive. Observe precautions for handling electrostatic sensitive devices注意:提醒需要特别注意的信息。
ATTENTION: Identifies information that requires special consideration.提示:标记对用户的建议或提示。
TIP:Identifies advice or hints for the user.目录1 不相等比较功能块(NE).....................................................................................................................1-11.1 简介...............................................................................................................................................1-11.2 参数说明.......................................................................................................................................1-11.3 算法...............................................................................................................................................1-12 相等比较功能块(EQ).........................................................................................................................2-12.1 简介...............................................................................................................................................2-12.2 参数说明.......................................................................................................................................2-12.3 算法...............................................................................................................................................2-13 大于比较功能块(GT).........................................................................................................................3-13.1 简介...............................................................................................................................................3-13.2 参数说明.......................................................................................................................................3-13.3 算法...............................................................................................................................................3-14 大于等于比较功能块(GE).................................................................................................................4-14.1 简介...............................................................................................................................................4-14.2 参数说明.......................................................................................................................................4-14.3 算法...............................................................................................................................................4-15 小于比较功能块(LT).........................................................................................................................5-15.1 简介...............................................................................................................................................5-15.2 参数说明.......................................................................................................................................5-15.3 算法...............................................................................................................................................5-16 小于等于比较功能块(LE).................................................................................................................6-16.1 简介...............................................................................................................................................6-16.2 参数说明.......................................................................................................................................6-16.3 算法...............................................................................................................................................6-17 INT型不相等比较功能块(NE_INT).................................................................................................7-17.1 简介...............................................................................................................................................7-17.2 参数说明.......................................................................................................................................7-17.3 算法...............................................................................................................................................7-18 INT型相等比较功能块(EQ_INT).....................................................................................................8-18.1 简介...............................................................................................................................................8-18.2 参数说明.......................................................................................................................................8-18.3 算法...............................................................................................................................................8-19 INT型大于比较功能块(GT_INT).....................................................................................................9-19.1 简介...............................................................................................................................................9-19.2 参数说明.......................................................................................................................................9-19.3 算法...............................................................................................................................................9-110 INT型大于等于比较功能块(GE_INT).........................................................................................10-110.1 简介...........................................................................................................................................10-110.2 参数说明...................................................................................................................................10-110.3 算法...........................................................................................................................................10-111 INT型小于比较功能块(LT_INT)..................................................................................................11-111.1 简介...........................................................................................................................................11-111.2 参数说明...................................................................................................................................11-111.3 算法...........................................................................................................................................11-112 INT型小于等于比较功能块(LE_INT)..........................................................................................12-112.1 简介...........................................................................................................................................12-112.2 参数说明...................................................................................................................................12-112.3 算法...........................................................................................................................................12-113 UINT型不相等比较功能块(NE_UINT)........................................................................................13-113.1 简介...........................................................................................................................................13-113.2 参数说明...................................................................................................................................13-113.3 算法...........................................................................................................................................13-114 UINT型相等比较功能块(EQ_UINT)............................................................................................14-114.1 简介...........................................................................................................................................14-114.2 参数说明...................................................................................................................................14-114.3 算法...........................................................................................................................................14-115 UINT型大于比较功能块(GT_UINT)............................................................................................15-115.1 简介...........................................................................................................................................15-115.2 参数说明...................................................................................................................................15-115.3 算法...........................................................................................................................................15-116 UINT型大于等于比较功能块(GE_UINT)....................................................................................16-116.1 简介...........................................................................................................................................16-116.2 参数说明...................................................................................................................................16-116.3 算法...........................................................................................................................................16-117 UINT型小于比较功能块(LT_UINT)............................................................................................17-117.1 简介...........................................................................................................................................17-117.2 参数说明...................................................................................................................................17-117.3 算法...........................................................................................................................................17-118 UINT型小于等于比较功能块(LE_UINT)....................................................................................18-118.1 简介...........................................................................................................................................18-118.2 参数说明...................................................................................................................................18-118.3 算法...........................................................................................................................................18-119 资料版本说明......................................................................................................................................19-1比较功能块库1不相等比较功能块(NE)1.1简介该功能块能够实现两个输入量的不相等比较判断。
2021新人教版五年级上册英语练习册答案
2021新人教版五年级上册英语练习册答案五年级上册英语练习册答案Uint 1Lesson 1I 1. old 2. strict 3. old 4.shortII1.b2.a3.a4.bLesson 2 . 1.C 2.A 3.A 4.C 5.CIII.1. hard-working2. Polite3. shy4.helpful图片顺序(横着)?4??IV 1. He’s our new PE teacher.2.Heis tall and stong, he is very strict.3. Yes, he is .4. His class is funny. Lesson 3 I 1. Your young 2. shy crying1. I2. you your3. Her she4. our me5. III. B D E C AIV. 1. Do you know that old lady? 2. What’s she like?him his 3. Then what’s she like? 4. She’s very kind.Unit 2Lesson 1I. 1. Sunday Sun. 4.Thurday Thur. 7. weekend 2. Tuesday Tues. 5.Friday Fri. 3. Wednesday Wed. 6.Saturday Sat. II. √ × √ √ √ III. 1. A 2.C 3.B 4.C 5.A Lesson 2 II. 1.A 2.B 3.A 4.C 5.Cplay ping-pong Mondays play football Sundays Watch TV read books do my homework Lesson3 I. 1. 2.please green II. homework afternoon blackboard Sunday weekendtoday football basketball workdayIII. Alice’s weekend Activities Saturday do homework play ping-pong Watch TV Sunday read books listen to music wash clothesCindy’s weekend Activities do homework read books Watch TVwash clothes wash clothes Unit 3Lesson 1II. A B B A III.I’m thirsty. I want to drink .... so up milk juice tea waterI .m hungry. I want to eat .... hamburger beef chicken noodles dumplings Lesson 2I. 1. fresh 2. healthy 3. sweet 4. healthy 5.delicious1. ×2. × ×3.√ ×III. and want fruit because father many For (圈出这些单词) Lesson 3 I. 1.yellow 2.II. 1. hungry 2. thirsty 3. healthy 4. sweet 5. deliciousVegetables onions healthy favourite fruit sweet bestBrown Recycle 1II. 1. Wednesday 4.young 2.ice-cream 5.tea3. shy 6.play footballIII. 1.healthy 2. homework 3.Sunday 4.funny 5.sweet 6.strict7.hard--working 8.fresh IV. 1.Who Ms 2. is 3. old 4.an5.on Mondays6. watch7.delicious8.sandwiches V. 1. drink Tea 2.robin 3. wash clothes Tuesday4. eat hamburger5. play footballVI. 1. What usually do you have on Wednesdays? 2. What is ournew teacher like? 3. Onions are delicious but hot. 4.Sweet food isnot very healthy. 5.who is that tall man ? 6.what is you favourite sport? VII. √ √ × √ √Unit4Lesson1I. 1. dance 2. do 3. picture 4.play 5. Sing II. 1. we can sing songs . 2. Who can play the pipa? 3. I can dance 4. They can do kung fu. III. Name Can Candy dance Fay draw cartnoons Lily play pipa Lucy the Sing English songs Ms Li do some kung fu Lesson2II. 1. c an basketball 2. can’t speak English 3. The boys can play ping-pong 4. The robot can’t swim感谢您的阅读,祝您生活愉快。
UPC功能说明书
Standard Features:•Advanced Linear Amplifiers Provide Very Low Voltage Distortion, no Switching Noise, Fast Voltage and Current Slew Rates, Exceptionally Low Output Impedance and High Peak Current Capability• 1, 2, or 3 Phase Output Form selectable from front panel or bus command•20 to 5,000 Hz. Full Power Bandwidth Operation – 5Hz to 50KHz small signal bandwidth, 3dB at 10% of full voltage• Precision Voltage Programming – 0.05% with Continuous Self-Calibration (CSC) engaged • True-RMS Metering of Volts, Amps, and Power • GPIB (IEEE-488.2) or RS-232 Interface • Waveform Library – Arbitrary Waveform Generator• Up to 99 Programs with Associated Transients for Static and Dynamic Test Applications •UPC Studio Software SuiteAvailable Options:• Programmable Output Impedance• Harmonic Analysis and Waveform Synthesis • Peak Inrush Capture and Waveform Analysis (Available on models with UPC3 controller)•UPC Test Manager SoftwareUPC Manager Software SuiteMaster the Power of the Wave!UPC Manager Software gives you the tools neces-sary to quickly and easily operate your AC Power Source. With our graphical interface control all areas of your AC Power Source testing with simple presets, user prompts, test sequences, test plans and custom reports.Model 312AMXFREQUENCY CONVERSION R & D MANUFACTURING AEROSPACE MILITARYCUSTOM1, 2, or 1,200VA 20-5,000 HzModel 312AMXAs a member of Pacific Power’s AMX-Series popular family of high performance Linear AC Power Sources, the 312AMX offers the same low output voltage noise and distortion, ease of installation, and high AC waveform fidelity as found in all of Pacific Power’s Linear AC Power Sources. Control and operational features provide a high degree of versatility and ease of use for applications ranging from simple,manually controlled frequency conversion to harmonic testing and sophisticated programmable transient simulation.AC TEST POWERAll 312AMX models are equipped with a powerful micro-controller with the ability to operate as a fully integrated test system. This enables a variety of power conditions and transients to be applied to the device under test while metering and analyzing all output performance parameters. For higher power requirements, refer to the AMX & ASX series catalog.FREQUENCY/ VOLTAGE CONVERSIONThe 312AMX is an excellent source of stable AC Voltage over the frequency range of 20 to 5,000 Hz when using the high-end UPC-32 controller. Also available in 1,200 Hz maximum output frequency when using UPC3 or Manual controller. The output frequency is quartz-crystal stabilized. Output voltages up to 300V L-L in split phase mode and 260V L-L in three phase mode are available on the 312AMX model.PHASE CONVERSIONWith the ability to provide either single or two phase output, the 312AMX is a good choice to convert one-phase line voltage into precisely controlled split (two-phase) or three-phase output power.UPC SERIES CONTROLLERThree controller models are available in both manual and programmable control version. All controllers provide manual operation from the front panel. Programmable Controllers may be operated from the front panel or from a remote interface via RS 232 or GPIB.The Leader in AC Power TechnologyAn early pioneer in the development solid-state power conversion equipment, Pacific Power Source continues to develop, manufacture, and market both linear and high-performance PWM AC Power Sources. Pacific Power Source’s reputation as a market and technology leader is best demonstrated by its continuing investments in both research and development and world-wide customer support. With corporate owned offices in the United States, France, the United Kingdom, and China, local personalized support is always available.1Ø42Ø43Ø40-150V L-N 0-300V L-L0-150V L-N / 0-260V L-LNOTES:1. Rated output power is based on a combination of nominal output voltage, rated current and load power factor. Values stated represent the maximum capabilities of a given model (maximum power in split phase (Form2) direct coupled mode is 800VA). Consult factory for assistance in determining specific unit capabilities as they might apply to your application.2. Unit is operable as single phase with dual range capability or 3 phase. Output voltage range and 1/2/3 conversions are selected by front panel or bus commands.3. Vmax is output voltage with nominal input and full rated load applied.4. Available current will vary with output voltage and power factor. Current shown is per phase.Output RatingsThermal and Power Factor Rating CurvesAMX Power Source Specifications (PF = 1.0, V out > 25% F.S.)Input Power Requirements (47-63 Hz)312AMXOutput Frequency Line Regulation Load Regulation Ripple and Noise OUTPUT VOLTAGE-AC VOLTS RMSShort term overloads to 150% are permitted. Operating time before thermal shutdown or circuit breaker trip varies from sec-onds to several minutes depending upon line and temperature conditions.THERMAL RATING -AC CURRENT RMSShort tem overloads to 150% of rated current are permitted.Operating time before thermal shutdown or circuit breaker trip varies from seconds to several minutes depending upon line and temperature conditions.Rated Continuous Load Current as a Function of Ambient Temperature and Power Factor and Output Voltage at Nominal Input Line.The UPC Controlleris a highly versatile one, two, or threephase oscillator/signal generator designed to control any ofPacific Power’s AC Power Sources. Three controller models,UPC-3M, UPC-3, or UPC-32 are offered. To use the full 5KHz power bandwidth of the 312AMX, the UPC-32 controller isrequired.Controller ModelsOutput Control SpecificationsTotal Control, Metering, and Analysis of AC Power- Simple, Intuitive OperationWaveform ControlExternal Inputs/OutputsOutput MeteringUsing the front panel keyboard and display , all controllermodels provide for selection of power source output mode, cou-pling, voltage, and frequency. Selecting the correct UPC controller for a given application varies with your test requirement, desired features, and price.Both the UPC-3 and UPC-32 Controllers are available witheither RS-232 or GPIB remote interface. Commands are structured in accordance with SCPI (Standard Commands for Programmable Instruments).© 2012 Pacific Power Source, Inc. Subject to change without notice. #DS312AMX101217692 Fitch, Irvine, CA 92614 USAPhone: +1 949.251.1800 Fax: +1 949.756.0756 T oll Free: 800.854.2433E-mail:**********************19" (483mm)Ordering InformationAvailable Models312AMX-UPC3M312AMX-UPC3312AMX-UPC32 General/EnvironmentalMechanical SpecificationsSoftware/Firmware OptionsProtection and SafetyOrder Example312AMX-UPC32, V IN : 120VAC • 1,200VA, 3-Phase, AC Power Source with UPC-32 programmable controller.• Standard GPIB Interface•120VAC, 1 Phase Input VoltageTypical Delivery Items• AC Power Source• English Manuals (AC Source and Controller)• UPC Studio Software - (Download)• UPC Interactive LabVIEW TM Libraries (Download)• Compliance Certificate with Test data •CE Conformity Document (CE Models)。
断路器ModBUS规约
MCCB ACB VCB
N 相保护选择 00:OFF 01:50% 10:100% 11:保留
MCCB ACB VCB
保留 高字节
保留
保留
热记忆 1=ON 0=OFF
区域联锁 1=ON 0=OFF
MCR 1=ON 0=OFF
MCCB ACB VCB
MCCB ACB VCB
MCCB ACB VCB
MCCB
Bit0
剩余电流 动作超值 1=超过 0=未超
低字节
1=超值 0=未超
值 2 超值 1=超过 0-未超
作电流值 超值 1=超过 0=未超 1=超过 0=未超
1=超过 0=未超
支持设 备
ACB VCB 保留
ACB VCB
ACB VCB 保留
MCCB ACB VCB 保留
MCCB ACB VCB 保留
MCCB ACB VCB 保留
50 51 52 11 9 10
260 V2.61
表 示
MCCB、ACB、VCB MCCB、ACB、VCB MCCB、ACB、VCB MCCB、ACB、VCB MCCB、ACB、VCB MCCB、ACB、VCB
注:1 7 有 6 个有效 字符 注:2 3 最大有 30 个 有效字符 MCCB、ACB、VCB MCCB、ACB、VCB
27
负载监控 1 时间整定值 负载监控 2 时间整定值 负载监控 1 电流整定值 负载监控 2 电流整定值 长延时电流 整定值 Ir
UINT
S
R/W
0×30
14
ACB、VCB
28
UINT
S
R/W
0×31
15
ACB、VCB
新概念英语课程系统介绍
新概念英语青少版——教材介绍,教材征订教材介绍《新概念英语青少版》是“新概念英语”教学体系的新成员,由世界著名英语教学专家路易·亚历山大、朱莉娅·亚历山大、罗伊·金斯伯里专为8岁~14岁青少年以及英语初学者编写。
整套教材分为五个级别个级别,每个级别含A 、B 两个分册。
《新概念英语青少版》在秉承《新概念英语》先进教学理念的基础上,语法大纲更加强调渐进性,凡涉及新的语法结构,都会循环不断地复习前面学过的语法知识。
此外,教材针对青少年的身心特点,采用了和他们生活、学习密切相关的语言材料,主课文以一个英国家庭以及他们的朋友为故事情节,语言精炼幽默,通过精心设计的听力、阅读和写作练习帮助青少年扎实地掌握各项英语知识和能力,逐步能够充满自信地运用英语进行交流!教材征订单全套教材共分为五个级别级别,每个级别含学生用书、练习册、教师用书和课堂用带,其中学生用书和练习册分A 、B 两册。
教材名称 教材名称新概念英语青少版练习册新概念英语青少版练习册新概念英语青少版练习册新概念英语青少版练习册新概念英语青少版练习册新概念英语青少版练习册新概念英语青少版——人物介绍新概念英语青少版——学生用书,练习册,教师用书,动画DVD,课堂用带练习册每级学生用书均配有相应的练习册。
在练习册中,为每个单元提供3页的书面练习。
这些练习形式多样,不仅可供学生在课堂上使用,也可以当作家庭作业留给学生,让他们在课下巩固所学的知识。
教师用书中文版的教师用书方便教师迅速、准确地把握教学活动。
教师用书详细地介绍了本套教材的编写理念、编写大纲,每种练习活动的作用,并提供了非常详细的教学步骤,大大减轻了教师备课的负担。
尤其值得一提的是,教师用书中提供了更多的语言材料和教学资源,如:每单元的语音练习中不仅包括了学生用书中已有的例词、例句,还有更多的词语和句子,让教师更加自如地掌控课堂教学。
动画DVD每本学生用书均附赠动画DVD。
三年级英语北京版UINT THREE I WAS BORN ON MAY 23RD 4
How old…? When… ?
…
Let’s read
All about me
My birthday wish
My name is _L_in_g_l_in_g__. My birthday is on _Ja_n_u_a_r_y_2_1_s_t_. I am__8_ years old.
UNIT THREE I WAS BORN ON MAY 23RD (4)
小学三年级 英语
Let’s answer
● What’s the twelfth month in English?
12 December is the twelfth month.
● What’s the ninth month in English?
We learnt the air, ear, are and ere sound.
Homework
1. Read Now I know the sound on P25.
2. Read the dialogue in Lesson1, Lesson2 and Lesson3.
31
It comes in October.
It runs away(逃跑) in November.
It comes in December. It welcomes New Year in December.
Let’s enjoy the story
The Teddy Bear
There is a teddy bear.
√
×
P24
Let’s ask and answer
Hello Kitty Winnie Mickey Garfield
自己动手写C语言浮点数转换字符串函数
⾃⼰动⼿写C语⾔浮点数转换字符串函数前⼏天,应⼀个⼩友要求,写了⼏个字符串转换函数帮助其进⾏语⾔学习,⾃觉其中的⼏个函数还⽐较满意,故发布在此,可供初学者参考。
浮点数转换字符串函数说简单也简单,说⿇烦,也够烦⼼的,关键看你如何写了。
简单点的⼏⼗⾏代码就⾏,复杂点的恐怕就的⼏百⾏代码了。
如果还要考虑移植性、可读性甚⾄可维护性等就更⿇烦的了。
我⼀贯认为,⼀些事务性的项⽬应着重考虑移植性、可读性和可维护性等,⽽常⽤的带点系统性质的函数代码就应该以执⾏效率为主。
本⽂的浮点数转换字符串函数还是⽐较复杂的,基本可算得上较低层次的转换。
由于我已经习惯了⽤BCB写C/C++代码,因此我写的浮点数转换字符串函数是80位扩展精度浮点数的,但那个⼩友拿回去试了⼀下,说他⽤的VC不⽀持80位扩展精度浮点数,虽然能定义long double变量,但实际上还是64位的,我只好⼜重写了⼀个64位双精度浮点数的,2个版本使⽤条件编译,这也算得上是移植性吧,呵呵。
下⾯是浮点数转换字符串函数的全部代码:#define USE_EXTENDED/**************************************************************************** 定义浮点数转换字符串结构 ****************************************************************************/typedef struct{SHORT exponent; /* 指数(整数位数) */BYTE negative; /* 负数(0正,1负)*/CHAR digits[21]; /* ⼗进制整数字串 */}FloatRec;#define F_DEFDECIMALS 6#define F_MAXDECIMALS 100#ifdef USE_EXTENDED#define F_MAXPRECISION 19#define F_CONEXPONENT 0x3ffftypedef long double EXTENDED, *PExtended, *PEXTENDED;#include <pshpack2.h>typedef struct{UINT64 mantissa;USHORT exponent;}_Extended;#include <poppack.h>static CONST _Extended _tab0[] ={{0x8000000000000000, 0x3FFF}, /* 10**0 */{0xA000000000000000, 0x4002}, /* 10**1 */{0xC800000000000000, 0x4005}, /* 10**2 */{0xFA00000000000000, 0x4008}, /* 10**3 */{0x9C40000000000000, 0x400C}, /* 10**4 */{0xC350000000000000, 0x400F}, /* 10**5 */{0xF424000000000000, 0x4012}, /* 10**6 */{0x9896800000000000, 0x4016}, /* 10**7 */{0xBEBC200000000000, 0x4019}, /* 10**8 */{0xEE6B280000000000, 0x401C}, /* 10**9 */{0x9502F90000000000, 0x4020}, /* 10**10 */{0xBA43B74000000000, 0x4023}, /* 10**11 */{0xE8D4A51000000000, 0x4026}, /* 10**12 */{0x9184E72A00000000, 0x402A}, /* 10**13 */{0xB5E620F480000000, 0x402D}, /* 10**14 */{0xE35FA931A0000000, 0x4030}, /* 10**15 */{0x8E1BC9BF04000000, 0x4034}, /* 10**16 */{0xB1A2BC2EC5000000, 0x4037}, /* 10**17 */{0xDE0B6B3A76400000, 0x403A}, /* 10**18 */{0x8AC7230489E80000, 0x403E}, /* 10**19 */{0xAD78EBC5AC620000, 0x4041}, /* 10**20 */{0xD8D726B7177A8000, 0x4044}, /* 10**21 */{0x878678326EAC9000, 0x4048}, /* 10**22 */{0xA968163F0A57B400, 0x404B}, /* 10**23 */{0xD3C21BCECCEDA100, 0x404E}, /* 10**24 */{0x84595161401484A0, 0x4052}, /* 10**25 */{0xA56FA5B99019A5C8, 0x4055}, /* 10**26 */{0xCECB8F27F4200F3A, 0x4058}, /* 10**27 */{0x813F3978F8940984, 0x405C}, /* 10**28 */{0xA18F07D736B90BE5, 0x405F}, /* 10**29 */{0xC9F2C9CD04674EDF, 0x4062}, /* 10**30 */{0xFC6F7C4045812296, 0x4065} /* 10**31 */};static CONST _Extended _tab1[] ={{0x9DC5ADA82B70B59E, 0x4069}, /* 10**32 */{0xC2781F49FFCFA6D5, 0x40D3}, /* 10**64 */{0xC2781F49FFCFA6D5, 0x40D3}, /* 10**64 */{0xEFB3AB16C59B14A3, 0x413D}, /* 10**96 */{0x93BA47C980E98CE0, 0x41A8}, /* 10**128 */{0xB616A12B7FE617AA, 0x4212}, /* 10**160 */{0xE070F78D3927556B, 0x427C}, /* 10**192 */{0x8A5296FFE33CC930, 0x42E7}, /* 10**224 */{0xAA7EEBFB9DF9DE8E, 0x4351}, /* 10**256 */{0xD226FC195C6A2F8C, 0x43BB}, /* 10**288 */{0x81842F29F2CCE376, 0x4426}, /* 10**320 */{0x9FA42700DB900AD2, 0x4490}, /* 10**352 */{0xC4C5E310AEF8AA17, 0x44FA}, /* 10**384 */{0xF28A9C07E9B09C59, 0x4564}, /* 10**416 */{0x957A4AE1EBF7F3D4, 0x45CF}, /* 10**448 */{0xB83ED8DC0795A262, 0x4639} /* 10**480 */};static CONST _Extended _tab2[] ={{0xE319A0AEA60E91C7, 0x46A3}, /* 10**512 */{0xC976758681750C17, 0x4D48}, /* 10**1024 */{0xB2B8353B3993A7E4, 0x53ED}, /* 10**1536 */{0x9E8B3B5DC53D5DE5, 0x5A92}, /* 10**2048 */{0x8CA554C020A1F0A6, 0x6137}, /* 10**2560 */{0xF9895D25D88B5A8B, 0x67DB}, /* 10**3072 */{0xDD5DC8A2BF27F3F8, 0x6E80}, /* 10**3584 */{0xC46052028A20979B, 0x7525}, /* 10**4096 */{0xAE3511626ED559F0, 0x7BCA} /* 10**4608 */};static CONST EXTENDED _conPrec = 1E19;#else// USE_EXTENDED#define F_MAXPRECISION 17#define F_CONEXPONENT 0x03fftypedef double EXTENDED, *PExtended, *PEXTENDED; static CONST UINT64 _tab0[] ={{0x3FF0000000000000}, /* 10**0 */{0x4024000000000000}, /* 10**1 */{0x4059000000000000}, /* 10**2 */{0x408F400000000000}, /* 10**3 */{0x40C3880000000000}, /* 10**4 */{0x40F86A0000000000}, /* 10**5 */{0x412E848000000000}, /* 10**6 */{0x416312D000000000}, /* 10**7 */{0x4197D78400000000}, /* 10**8 */{0x41CDCD6500000000}, /* 10**9 */{0x4202A05F20000000}, /* 10**10 */{0x42374876E8000000}, /* 10**11 */{0x426D1A94A2000000}, /* 10**12 */{0x42A2309CE5400000}, /* 10**13 */{0x42D6BCC41E900000}, /* 10**14 */{0x430C6BF526340000}, /* 10**15 */{0x4341C37937E08000}, /* 10**16 */{0x4376345785D8A000}, /* 10**17 */{0x43ABC16D674EC800}, /* 10**18 */{0x43E158E460913D00}, /* 10**19 */{0x4415AF1D78B58C40}, /* 10**20 */{0x444B1AE4D6E2EF50}, /* 10**21 */{0x4480F0CF064DD592}, /* 10**22 */{0x44B52D02C7E14AF7}, /* 10**23 */{0x44EA784379D99DB4}, /* 10**24 */{0x45208B2A2C280291}, /* 10**25 */{0x4554ADF4B7320335}, /* 10**26 */{0x4589D971E4FE8402}, /* 10**27 */{0x45C027E72F1F1281}, /* 10**28 */{0x45F431E0FAE6D722}, /* 10**29 */{0x46293E5939A08CEA}, /* 10**30 */{0x465F8DEF8808B024} /* 10**31 */};static CONST UINT64 _tab1[] ={{0x4693B8B5B5056E17}, /* 10**32 */{0x4D384F03E93FF9F5}, /* 10**64 */{0x53DDF67562D8B363}, /* 10**96 */{0x5A827748F9301D32}, /* 10**128 */{0x6126C2D4256FFCC3}, /* 10**160 */{0x67CC0E1EF1A724EB}, /* 10**192 */{0x6E714A52DFFC679A}, /* 10**224 */{0x75154FDD7F73BF3C}, /* 10**256 */{0x7BBA44DF832B8D46}, /* 10**288 */};static CONST EXTENDED _conPrec = 1E17;#endif// !USE_EXTENDED#endif// !USE_EXTENDEDstatic CONST UINT64 _cvttab[F_MAXPRECISION] ={#ifdef USE_EXTENDED0xDE0B6B3A7640000, 0x16345785D8A0000,#endif0x02386F26FC10000, 0x0038D7EA4C68000, 0x0005AF3107A4000, 0x00009184E72A000, 0x00000E8D4A51000, 0x00000174876E800, 0x0000002540BE400, 0x00000003B9ACA00, 0x000000005F5E100, 0x000000000989680, 0x0000000000F4240, 0x0000000000186A0, 0x000000000002710, 0x0000000000003E8, 0x000000000000064, 0x00000000000000A, 0x000000000000001};#define DECIMAL_EXP(exponent) ((((exponent - F_CONEXPONENT) * 0x4d10) >> 16) + 1) static VOID AdjFloatDigits(UINT64 value, INT precision, INT decimals, FloatRec *rec){INT i;// value是F_MAXPRECISION位⼗进制整数,故从最⾼位开始转换为数字串for (i = 0; value; i ++){rec->digits[i] = (CHAR)((value / _cvttab[i]) | 0x30);value %= _cvttab[i];}memset(rec->digits + i, 0, F_MAXPRECISION - i);// 下⾯对数字串作精度处理// 如果总的精度⼩于0,数字串为空串,该数字转换为'0'if ((i = (rec->exponent + decimals)) < 0){rec->exponent = rec->negative = rec->digits[0] = 0;return;}if (i > precision) i = precision;// 如果精度位数⼩于18,同时该位⼤于等于'5',四舍五⼊if (i < F_MAXPRECISION && rec->digits[i] >= '5'){do{rec->digits[i --] = 0;rec->digits[i] ++;}while (i >= 0 && rec->digits[i] > '9');if (i < 0){rec->digits[0] = '1';rec->exponent ++;}}// 否则,去掉数字串尾部多余的'0'else{if (i > F_MAXPRECISION) i = F_MAXPRECISION;do rec->digits[i --] = 0;while (i >= 0 && rec->digits[i] == '0');if (i < 0) rec->negative = 0;}}#ifdef USE_EXTENDED// 解析扩展精度浮点数为⼗进制字符串,并存⼊浮点数记录中// 参数:浮点数指针,精度,⼩数位,浮点数记录VOID FloatResolve(PEXTENDED pvalue, INT precision, INT decimals, FloatRec *rec){INT power;EXTENDED val;// 79位:扩展精度浮点数符号位rec->negative = ((_Extended*)pvalue)->exponent >> 15;// 64-78位:扩展精度浮点数阶码(阶码 - 0x3fff = ⼆进制指数)rec->exponent = ((_Extended*)pvalue)->exponent & 0x7fff;if (!rec->exponent) // *pvalue = 0{rec->negative = rec->digits[0] = 0;return;}if (rec->exponent == 0x7fff)// *pvalue = nan or inf{if (!((*(LPBYTE)pvalue + 7) & 0x80) || !(*(PUINT64)pvalue & 0x7fffffffffffffff)){lstrcpyA(rec->digits, "INF");}else{rec->exponent ++;rec->negative = 0;lstrcpyA(rec->digits, "NAN");}return;}// 阶码转换为⼗进制指数// 阶码转换为⼗进制指数rec->exponent = DECIMAL_EXP(rec->exponent);// 0-63位:扩展精度浮点数尾数转换成F_MAXPRECISION位⼗进制浮点整数格式val = *pvalue;*((LPBYTE)&val + 9) &= 0x7f;// val = fabs(*pvalue)power = F_MAXPRECISION - rec->exponent;if (power > 0) // if (power > 0) val *= (10**power){val *= *(PEXTENDED)&_tab0[power & 31];power >>= 5; // power /= 32;if (power){if (power & 15)val *= *(PEXTENDED)&_tab1[(power & 15) - 1];power >>= 4; // power /= 16;if (power)val *= *(PEXTENDED)&_tab2[power - 1];}}else if (power < 0) // if (power < 0) val /= (10**power){power = -power;val /= *(PEXTENDED)&_tab0[power & 31];power >>= 5; // power /= 32;if (power){if (power & 15)val /= *(PEXTENDED)&_tab1[(power & 15) - 1];power >>= 4; // power /= 16;if (power)val /= *(PEXTENDED)&_tab2[power - 1];}}val += 0.5; // 四舍五⼊if (val >= _conPrec){val /= 10;rec->exponent ++;}// 调整并转换扩展精度浮点数尾数的整数部分rec->digitsAdjFloatDigits(*(PUINT64)&val >> ((((_Extended*)&val)->exponent - 0x3fff) ^ 0x3f), precision, decimals, rec);}#else// USE_EXTENDED// 解析双精度浮点数为⼗进制字符串,并存⼊浮点数记录中// 参数:浮点数指针,精度,⼩数位,浮点数记录VOID FloatResolve(PEXTENDED pvalue, INT precision, INT decimals, FloatRec *rec) {INT power;EXTENDED val;// 63位:双精度浮点数符号位rec->negative = *((LPBYTE)pvalue + 7) >> 7;// 52-62位:双精度浮点数阶码(阶码 - 0x3ff = ⼆进制指数)rec->exponent = (*(PUINT64)pvalue >> 52) & 0x7ff;if (!rec->exponent) // *pvalue = 0{rec->negative = rec->digits[0] = 0;return;}if (rec->exponent == 0x7ff)// *pvalue = nan or inf{if ((*(PUINT64)pvalue & 0xfffffffffffff) == 0){lstrcpyA(rec->digits, "INF");}else{rec->exponent ++;rec->negative = 0;lstrcpyA(rec->digits, "NAN");}return;}// 阶码转换为⼗进制指数rec->exponent = DECIMAL_EXP(rec->exponent);// 0-51位:双精度浮点数尾数转换成F_MAXPRECISION位⼗进制浮点整数格式val = *pvalue;*((LPBYTE)&val + 7) &= 0x7f;// val = fabs(*pvalue)power = F_MAXPRECISION - rec->exponent;if (power > 0) // if (power > 0) val *= (10**power){val *= *(PEXTENDED)&_tab0[power & 31];power >>= 5; // power /= 32;if (power)val *= *(PEXTENDED)&_tab1[power - 1];}else if (power < 0) // if (power < 0) val /= (10**power)else if (power < 0) // if (power < 0) val /= (10**power){power = -power;val /= *(PEXTENDED)&_tab0[power & 31];power >>= 5; // power /= 32;if (power)val /= *(PEXTENDED)&_tab1[power - 1];}// 16位⼗进制浮点整数四舍五⼊val += 0.5;if (val >= _conPrec){val /= 10;rec->exponent ++;}// 调整并转换扩展精度浮点数尾数的整数部分rec->digits// 清除52-63位,加隐藏的⾼位,F_MAXPRECISION=17,⾼位超过52位,所以左移 AdjFloatDigits(((*(PUINT64)&val & 0x000fffffffffffff) | 0x0010000000000000) <<-(52 - ((*(PUINT64)&val >> 52) - 0x3ff)), precision, decimals, rec);}#endif// !USE_EXTENDED// 输出指数字符串到buffer,返回指数字符串长度INT PutExponent(LPSTR buffer, CONST FloatRec *rec){LPSTR p = buffer;INT e, exp = rec->digits[0]? rec->exponent - 1 : 0;*p ++ = rec->negative & 0x80? 'E' : 'e';if (exp < 0){exp = -exp;*p ++ = '-';}else *p ++ = '+';if ((e = (exp / 1000)) != 0){*p ++ = e + 0x30;exp %= 1000;}*p ++ = exp / 100 + 0x30;exp %= 100;*(PUSHORT)p = (((exp % 10) << 8) | (exp / 10)) + 0x3030;return (INT)(p - buffer + 2);}// 浮点数转换为字符串。
numpy无符号整数数据类型
numpy是Python中用于科学计算的一个非常重要的库,其中包含了丰富的数据类型和数值计算工具。
在numpy中,经常会涉及到各种数据类型的操作,包括有符号整数和无符号整数。
本文将重点介绍numpy中无符号整数数据类型的相关内容。
1. 无符号整数数据类型概述在计算机中,整数可以分为有符号整数和无符号整数两种类型。
有符号整数可以表示正负数,而无符号整数只能表示非负数(0及正数)。
在numpy中,无符号整数数据类型以"u"开头,后面跟着表示位数的数字(比如"u8"表示8位无符号整数)。
2. 无符号整数数据类型的种类在numpy中,提供了多种不同位数的无符号整数数据类型,包括但不限于:uint8、uint16、uint32、uint64等。
本文将主要介绍uint8和uint16两种常用的无符号整数数据类型。
3. uint8无符号整数数据类型uint8是一种8位无符号整数数据类型,在numpy中通常用来表示范围在0~255之间的非负数。
在图像处理等领域,uint8类型经常被用来表示像素的灰度值。
在numpy中,可以使用如下方式定义一个uint8类型的数组:```pythonimport numpy as nparr = np.array([0, 100, 200, 255], dtype=np.uint8)```4. uint16无符号整数数据类型uint16是一种16位无符号整数数据类型,在numpy中可以用来表示更大范围内的非负数。
在需要表示较大数值范围的计算中,uint16类型经常被使用。
在numpy中,可以使用如下方式定义一个uint16类型的数组:```pythonarr = np.array([0, 1000, 2000, 65535], dtype=np.uint16)```5. 无符号整数数据类型的应用场景无符号整数数据类型在实际应用中有着广泛的应用场景,比如在图像处理、信号处理、物理实验数据处理等领域中,经常需要处理非负数值数据,此时无符号整数数据类型就可以发挥作用。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
课题:Unit3 Section B 3a
课型:New lesson 备课时间:8.10 主备:高树香学习目标:1.初步认识语态。
2.掌握几种时态的被动语态重点:be allowed to do; agree and disagree.
【一】预习导学
ⅠFind and remember the phrases.
1.几天前____________
2.穿我们自己的衣服___________
3.更多的关注学习___________
4.感觉更舒服___________
5.向…学习___________
6.允许我们设计自己的校服_______
7.对…有益_____________
8.目前_____________
9.相互学到很多_____________
10.使老师和学生都高兴_________
11.有一个做某事的(良)机________ 12穿校服____________
Ⅱ.Find and memorize the sentences:
1.我们有时吵闹但我们互相了很多。
_____________________________
2.我们会过多的关注衣服而不是学习。
____________________________
3.对我来说那将是一次很好的经历。
______________________________
4.学校校规应该改了。
________________________________
5.在英语俱乐部,允许会员使用英英词典。
__________________________
6.那将是让老师和学生都快乐的好方法。
___________________________ 【三】主动探究、拓展延伸
Ⅰ.Read 3a quickly and write down T or F
1. At our school, we needn’t wear uniforms every day. ( )
2. Our teachers believes we would concentrate more on our studies than
our clothes if we wear our own clothes. ( )
3. Allowing teenagers to study in groups during the evening is also
probably a good idea for parents.. ( )
4 . Although we get noisy sometimes, yet we learn a lot from each other. ( )
5 .The writer don’t think that vacations should be longe r. ( )
Ⅱ. Read carefully and answer the five questions in 3a .
1._______________________________________________________
2._______________________________________________________
3._________________________________________________________
4._______________________________________________________
5._______________________________________________________
Ⅲ.Master the key points.
1.The other day,my friends and I talked about the rules that we have in school.
“几天以前;前几天”= a few days ago 表示过去的时间状语
the other morning _____________ the other week _____________
the other month __________________ (不久前的一个______)
1. We would concentrate more on our clothes than our studies.
集中(精力、思想、注意力)、聚集在
He ________________ his work. 他倾全力在工作上了。
3. be good for 对…有益处(反)be bad for
be good at 擅长…,在某方面好(同)do well in
be good to 对…好,宾语一般是人(同)be kind to
①_______ an apple every day ___ _____ ______ your health.
(每天一个苹果对你的健康有益。
)
②____ she good ____ _______ or _______ ?她是擅长唱歌还是擅长跳舞?
③She ___ very ______ ______ ____ students. 她对我们学生很好。
4.I know we get noisy sometimes, but we learn a lot from each other.
sometimes 频度副词“有时;时而”可用于现在或过去” =at times
sometime 副词,“在某一时侯”“某时”表示不确定的时间
some times 名词词组,“好几次”=several times
some time 名词词组,”一段时间”
①I have been to Qingdao ___________.
②He __________ goes to school on foot.
③I will go to Shanghai __________ next week.
④I saw him ___________ in May last year.
⑤How long will you be away ? I’ll be away for ___________.
【二】达标自测
1. Rice __________(grow) in South China.
2. A talk on the differences between English and American _____ (give)
next month.
3. Eating more vegetables can keep us _______ (health).
4. These books should ________ (take) to the classroom.
5. My watch doesn’t work. I’ll get it ________ (repair) tomorrow.
【五】拓展升华( 你能正确改回主动语态吗?)
1.Are business letters written by them in English?
_______ they _______ business letters in English?
2.The children shouldn’t be allowed to go out at night by parents.
________ ________ ________ the children to go out at night.。