ics1
20240 09 14
hw1
1
2
2.1
- 73 01001001
- 46 00101110
- -115 10001101
2.24
- 01011010 90
- 11110110 -10
- 10000110 -122
3
- \((11)_B+(01010101)_B = 1+85=86\)
- \((01001)_B-(111010)_B = 9-6=3\)
- \((1010)_B-(01011)_B = 6-11 = -5\)
4
- \((1111111)_B=(127)_D\)
- \((-10000000)_B=(-128)_D\)
- \((111\dots 111)_B(n-1 \texttt{位})=(2^{n-1}-1)_D\)
- \((-100\dots 000)_B(n \texttt{位})=(-2^{n-1})_D\)
5
- 两个正数相加得到结果为负数,或两个负数相加得到结果为正数。
- 得到的结果小于两个加数。
6
- 符号为正,指数 \(2^{10010010_B-127}=2^19\),底数 \(1.0111_B=1.4375\)。结果为 \(753664\)
- 符合为负,指数 \(2^{1110_B-127}=2^{-113}\),底数 \(1.10011_B=1.59375\)。结果为 \(-1.5347\times 10^{-34}\)
- \(5.375=101.011_B=1.01011\times 2^2\),表示为 0 10000001 01011000000000000000000
- \(-10\frac{9}{32}=1010.01001_B=1.01001001\times 2^3\),表示为 1 10000010 01001001000000000000000
7
- 最大指数:\(255-127=128\)。最小指数:\(0-127=-127\)。
- 最小:\(-1.11111111111111111111111_B\times 2^{128}\)。最小正数:\(1.0_B\times 2^{-127}\)。
8
- \((0011 \texttt{ AND } 0110) \texttt{ AND } 1101=0000=0_H\)
- \(0101 0111 \texttt{ OR } \texttt{NOT }(1101 0111)=0111 1111=7f_H\)
- \((1101 0010 \texttt{ OR } 0001 1001) \texttt{ OR } \texttt{NOT }(0110 1101 \texttt{ AND } 1010 1110)=1101 1011=db_H\)
strategy:分别将两个二进制数为 0 的位置置为 0。
9
- mask: \(11111011\), op: and
- mask: \(01000100\), op: or
- mask: \(00000000\), op: and
- mask: \(11111111\), op: or
- \(a \leftarrow \texttt{ BUSYNESS} \texttt{ AND } 00100000\),则答案为 \(a \texttt{ ADD } a \texttt{ ADD } a \texttt{ ADD } a\)
10
x | y | z | Q1 | Q2 |
---|---|---|---|---|
0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 0 | 0 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 0 | 0 |
1 | 1 | 0 | 1 | 0 |
1 | 1 | 1 | 0 | 0 |