Assume that a digital system has two 8bit registers R0 and R
Assume that a digital system has two 8-bit registers R0 and R1. Give the micro\'s required to implement the following: Complement all odd numbered bits in R0 (assume bit 7 is the MSB and bit 0 is the LSB). Complement all even numbered bits in R1 (assume bit 7 is the MSB and bit 0 is the LSB).
Solution
Ans: We have two 8-bit registers R0 and R1. We required to find the microops
1) To complement all odd numbered bit in R0
we know that from the truth table of XOR gate i.e.,
A B A(XOR)B
0 0 0
0 1 1
1 0 1
1 1 0
We can observe that when one of the input to the XOR gate is 1 then output is complement of other input and when one of the input is 0 output is just other input.
So to get complement of odd numbered bits in R0 we just do R0 R10 10101010. So required Microoperation is A A B where B is 10101010 and A is R0.
b) And to complement even numbered bits in R1 we just do
R1 R1 01010101. So required Microoperation is A A B where B is 01010101 and A is R1.
