Functions Arithmetic logic unit
1 functions
1.1 arithmetic operations
1.2 bitwise logical operations
1.3 bit shift operations
functions
a number of basic arithmetic , bitwise logic functions commonly supported alus. basic, general purpose alus typically include these operations in repertoires:
arithmetic operations
add: , b summed , sum appears @ y , carry-out.
add carry: a, b , carry-in summed , sum appears @ y , carry-out.
subtract: b subtracted (or vice versa) , difference appears @ y , carry-out. function, carry-out borrow indicator. operation may used compare magnitudes of , b; in such cases y output may ignored processor, interested in status bits (particularly 0 , negative) result operation.
subtract borrow: b subtracted (or vice versa) borrow (carry-in) , difference appears @ y , carry-out (borrow out).
two s complement (negate): (or b) subtracted 0 , difference appears @ y.
increment: (or b) increased 1 , resulting value appears @ y.
decrement: (or b) decreased 1 , resulting value appears @ y.
pass through: bits of (or b) appear unmodified @ y. operation typically used determine parity of operand or whether 0 or negative, or load operand processor register.
bitwise logical operations
and: bitwise , of , b appears @ y.
or: bitwise or of , b appears @ y.
exclusive-or: bitwise xor of , b appears @ y.
ones complement: bits of (or b) inverted , appear @ y.
bit shift operations
alu shift operations cause operand (or b) shift left or right (depending on opcode) , shifted operand appears @ y. simple alus typically can shift operand 1 bit position, whereas more complex alus employ barrel shifters allow them shift operand arbitrary number of bits in 1 operation. in single-bit shift operations, bit shifted out of operand appears on carry-out; value of bit shifted operand depends on type of shift.
arithmetic shift: operand treated 2 s complement integer, meaning significant bit sign bit , preserved.
logical shift: logic 0 shifted operand. used shift unsigned integers.
rotate: operand treated circular buffer of bits least , significant bits adjacent.
rotate through carry: carry bit , operand collectively treated circular buffer of bits.
Comments
Post a Comment