首页 > 其他分享 >计算机结构 week2

计算机结构 week2

时间:2022-10-15 18:23:26浏览次数:62  
标签:进制 计算机 二进制 补码 symbols base week2 bits 结构

记住单词: 一些进制

• 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.

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

 

标签:进制,计算机,二进制,补码,symbols,base,week2,bits,结构
From: https://www.cnblogs.com/Lamboofhome/p/16794714.html

相关文章