big IDEAs
- Abstraction
- Moore's Law
- Principle of Locality/Memory Hierarchy
- Parallelism
- Performance Measurement and Improvement
- Dependability VIA Redundancy
old conventional wisdom
Moore's Law t+ Dennard Scaling = faster, cheaper, low-power
signed &unsigned Intergers
unsigned
e.g. for unsigned int: adresses
0000 0000 0000 0001\(_{two}\) = \(1_{ten}\)
0111 1111 1111 1111\(_{two}\) = \(2^{11}-1\ _{ten}\)
signed
e.g. for signed int: int x,y,z;
1000 0000 0000 0000\(_{two}\) = \(-2^{11}\ _{ten}\)
main idea
want \(\frac{1}{2}\) of the int >=0, \(\frac{1}{2}\) of the int <0
two complement
basic ideas
for 3\(_{ten}\)=0011\(_{two}\)
for 10000\(_{two}\)-0011\(_{two}\)=1\(_{two}\)+1111\(_{two}\)-0011\(_{two}\)=1101\(_{two}\)
more e.g.
Assume for simplicity 4 bit width, -8 to +7
represented
There's an overflow here
Overflow when magnitude of result too big to fit into result representation
Carry in = carry form less significant bits
Carry out = carry to more significant bits
take care of the MSB(Most significant bits)
to detect overflow is to check whether carry in = carry out in the MSB