CMPSC 64 Lecture Notes - Lecture 3: Instruction Register, Program Counter, Multiplication Algorithm
Document Summary
Take the unsigned (abs) value and convert it to binary. In two"s complement, if the number"s most significant bit is 1, then that means it is a negative number, and if it"s 0, then the number is positive. When we talk of twos complement, we must also mention the number of bits involved. The range represented by number of bits differs between positive and negative binary numbers. 0 to +2% 1 for positive numbers. 2%() to +2%() 1 for twos complement negative numbers. Apply the mathematical principle of carrying over numbers in addition. Black box perspective of any n-bit binary adder. For unsigned (positive) numbers, cout indicates if the result did not fit all the way into the number of bits alloted. Could be used as an error condition for software. The carry bit/flag works only for unsigned (positive) numbers.