Day 01 7.11
:::warning
Why Boolean type is 8-bit in C / C++ ?
1 Byte is the minimum element of memory addressing.
8-bit is the most efficient way for memory addressing.
:::
:::warning
An ISA can have multiple microarchitecture.
:::
:::warning
Compiler vs. Assembler
Assemble language is bijective to ISA, but programming language are not.
Compiler transform high level programming language to machine code.
Assemble transform assemble language to machine code.
:::
:::warning
Value Representation
Signed Magnitide 源码
most intuitive, but can not do calculation.
1’s Complement 反码
can do calculation, but have +0 and -0, which wastes.
2’s Complement 补码
can do calculation, no waste binary number.
-16 is 2’s complement is itself
:::
:::warning
Scope of some reprentations
Unsigned
2’s complement
:::
:::warning
Overflow
A trick to judge overflow :
two number adds, if positive gets negative, or vice versa, then it overflows.
A positive number plus a negative number never overflows.
:::
:::warning
How to move left ?
:::
:::warning
Operation Law of logic variable
xor operation is recursive.
Provided that, then if two variable is known, the rest one can be determined.
A way to exchange X, Y
:::
Day 02 7.12
:::warning
取位 X AND M
打开位 X OR M
关闭位 X AND (NOT (M))
:::
:::warning
Single Presicion 32-bit
Normalized Form
is called offset.
for other forms
Other Precision
Double Precision 64-bit
Half Precision 16-bit
:::
:::warning
Logical Completeness
Not more 1 or 0 signal can be considered. :::