In: Computer Science
Suppose r0=0x0F0F0F0F and r1=0xFEDCBA98, find the result of the following operations. Note that the below instructions are not part of a program. Each instruction runs independently, without influencing each other.
i) EOR R4,R1,R0 ii) ORR R4,R1,R0
1)
EOR stands for Exclusive OR
In EOR if two bits are same, the result is 0
If the two bits are different, the result is 1
It is given that,
R0=0x0F0F0F0F and R1=0xFEDCBA98
EOR R4,R1,R0
This instruction performs Exclusive OR between the contents of register R0 and R1 and stores the result in register R4
Converting contents of R0 to binary
R0 = 0000 1111 0000 1111 0000 1111 0000 1111
Converting contents of R1 to binary
R1 = 1111 1110 1101 1100 1011 1010 1001 1000
The Exclusive OR between the two will give the following output
1111 0001 1101 0011 1011 0101 1001 0111
Converting back to Hex
R4 = 0xF1D3B597
2)
EOR stands for Inclusive OR
In ORR if two bits are 0, the result is 0
If the any of the two bits is 1, the result is 1
It is given that,
R0=0x0F0F0F0F and R1=0xFEDCBA98
ORR R4,R1,R0
This instruction performs Inclusive OR between the contents of register R0 and R1 and stores the result in register R4
Converting contents of R0 to binary
R0 = 0000 1111 0000 1111 0000 1111 0000 1111
Converting contents of R1 to binary
R1 = 1111 1110 1101 1100 1011 1010 1001 1000
The Inclusive OR between the two will give the following output
1111 1111 1101 1111 1011 1111 1001 1111
Converting back to Hex
R4 = 0xFFDFBF9F