COA Notes
COA Notes
ARCHITECTURE
• Memory Write
The write operation transfers the content of a data
register to a memory word M selected by the address.
Write: M[AR] DR
Types of Microoperations
1. Register transfer microoperations
2. Arithmetic Microoperations
3. Logic Microoperations
4. Shift Microoperations
D =A+ Y + Cin
Addition
• When S1S0 = 00, the value of B is applied to
the Y inputs of the adder.
• If Cin = O, the output D =A+ B.
• If Cin = 1, output D =A+ B + 1.
• Both cases perform the add microoperation
with or without adding the input carry.
Subtraction
• When S1S0 = 01, the complement of B is
applied to the Y inputs of the adder.
• If Cin = 1, then D =A + B + 1. This produces A
plus the 2's complement of B, which is
equivalent to a subtraction of A-B.
• When Cin = 0, then D = A + B. This is equivalent
to a subtract with borrow, that is, A - B - 1.
Increment
• When S1S0 = 10, the inputs from B are
neglected, and instead, all O's are inserted into
the Y inputs. The output becomes D = A + 0 + Cin·
• This gives D = A when Cin = 0 and D = A + 1 when
Cin = 1.
• In the first case we have a direct transfer from
input A to output D.
• In the second case, the value of A is
incremented by 1.
Decrement, Transfer
• When S1So = 11, all 1' s are inserted into the Y inputs of
the adder to produce the decrement operation D = A - 1
when Cin = 0. This is because a number with all 1's is equal
to the 2's complement of 1 (the 2's complement of binary
0001 is 1111). Adding a number A to the 2's complement
of 1 produces F =A + 2's complement of 1 = A - 1.
• When Cin = 1, then D =A - 1 + 1 = A, which causes a direct
transfer from input A to output D.
• Note that the microoperation D = A is generated twice,
so there are only seven distinct microoperations in the
arithmetic circuit.
Logic Microoperations
• Logic microoperations specify binary
operations for strings of bits stored in
registers. These operations consider each bit
of the register separately and treat them as
binary variables.
AND (^), OR(v), COMPLEMENT(-)
Hardware Implementation
Some Applications of Logic microoperations
1. Selective-set
The selective-set operation sets to 1 the bits
in register A where there are corresponding
1's in register B. It does not affect bit
positions that have 0's in B.
2. Selective-complement
• The selective-complement operation
complements bits in A where there are
corresponding 1's in B. It does not affect bit
positions that have D's in B.
3. Selective-clear
• The selective-clear operation clears to 0 the
bits in A only where there are corresponding
1's in B.
4. Mask operation
• The mask operation is similar to the selective-
clear operation except that the bits of A are
cleared only where there are corresponding
0's in B.
5. Insert operation
• The insert operation inserts a new value into a group of bits.
This is done by first masking the bits and then ORing them
with the required value. For example, suppose that an A
register contains eight bits, 0110 1010. To replace the four
leftmost bits by the value 1001 we first mask the four
unwanted bits: