计算机结构 week2

记住单词: 一些进制

• Denary/Decimal or base ten - ten symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

• Binary or base two - two symbols 0, 1

• Hexadecimal or base 16 - sixteen symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

• Octal or base 8 - eight symbols 0, 1, 2, 3, 4, 5, 6, 7.

 

• Bit - binary digit

• Byte - 8 bits

• Word - 32 bits or 64 bits

 

进制转化直接用那一套就行了

浮点数, 十进制转化为二进制或者其他进制, 先把他转化成分数, 然后用最大的分母去康康就行了

 

Binary coded decimal (BCD)

  • 将十进制的每一位 弄成 4位的二进制就行了

 

Signed integer representation Options: 

 • Sign-magnitude representation  (首位直接表示正负)

 • Twos complement (most common).

利用补码表示的优势: 

  •  只有一个0的表示方法
  •  弄个负数的时候直接 正数 +1 , 然后左边全部补 1 即可

补码范围: -2^(n-1) ~ 2^(n-1)-1

加法 正常加, 减法 先变成负数在弄.

 

科学计数法 二进制表示:

Floating point in the computer

A typical floating point format: • 32 bits

• The first bit is the sign bit, 0 for positive

• The next 8 bits represent the exponent, in 127-bias notation , 指数

• This leaves 23 bits for the mantissa. 

his format will be able to represent numbers in the range ≈ 10−38 to 1038 with approximately 7 decimal digits of precision.

问题 : 科学计数法 二进制表示的负数 是用补码表示吗,还是直接用 符号表示

二进制表示浮点数的操作: 

 

 32位中 1 8 23 

浮点数的运算步骤
浮点数的加减运算一般由以下五个步骤完成:对阶(小对大)、尾数运算()、规格化、舍入处理、溢出判断

推荐博客阅读

 

注意标准化 二进制 为 1.+小数, 因为左边一直有一个1,所以1就不表示了.

二进制浮点数以及二进制浮点数算术运算_shang_ch的博客-CSDN博客_二进制浮点数运算

 

posted @ 2022-10-15 18:11  VxiaohuanV  阅读(19)  评论(0编辑  收藏  举报