Find the contents of register R20 after each of the followin

Find the contents of register R20 after each of the following instructions:(a) LDI R20, 0 times 65 LDI R21, 0 times 76 AND R20, R21 (b) LDI R20, 0 times 70 LDI R21, 0 times 63 Or R20, R21 (c) LDI R20, 0 times 95 LDI R21, 0 times AA EOR R20, R21 (d) LDI R20, 0 times 5D LDI R21, 0 times 75 AND R20, R21 (e) LDI R20, 0 times 0C5 LDI R21, 0 times 12 OR R20, R21 (f) LDI R20, 0 times 6A LDI R21, 0 times 6E EOR R20, R21 (g) LDI R20, 0 times 37 LDI R21, 0 times 26 OR R20, R21

Solution

19 Ans)

(a) AND operation 0x65-binary 0x0110 0101

0x76-binary 0x0111 0110

-------------------------------------------------------------------

0x0110 0100---0x64

so answer 0x64 in R20 register

---------------------------------------------------------------

(b)

OR operation 0x70-binary 0x0111 0000

0x6B-binary 0x0110 1011

-------------------------------------------------------------------

0x0111 1011---0x7B

so answer 0x7B in R20 register

---------------------------------------------------------------

(c)

Ex-OR operation 0x95-binary 0x1001 0101

0xAA-binary0x1010 1010

-------------------------------------------------------------------

0x0011 1111---0x3F

so answer 0x3F in R20 register

---------------------------------------------------------------

(d)

AND operation 0x5D-binary 0x0101 1101

0x75-binary 0x0111 0101

-------------------------------------------------------------------

0x0101 0101---0x55

so answer 0x55 in R20 register

---------------------------------------------------------------

(e)

OR operation 0xC5-binary 0x1100 0101

0x12-binary 0x0001 0010

-------------------------------------------------------------------

0x1101 0111---0xD7

so answer 0xD7 in R20 register

---------------------------------------------------------------

(f)

Ex-OR operation 0x6A-binary 0x0110 1010

0x6E-binary 0x1110 1110

-------------------------------------------------------------------

0x1000 0100---0x84

so answer 0x84 in R20 register

---------------------------------------------------------------

(g)

OR operation 0x37-binary 0x0011 0111

0x26-binary 0x0010 0110

-------------------------------------------------------------------

0x0011 0111---0x37

so answer 0x37 in R20 register

---------------------------------------------------------------

 Find the contents of register R20 after each of the following instructions:(a) LDI R20, 0 times 65 LDI R21, 0 times 76 AND R20, R21 (b) LDI R20, 0 times 70 LDI
 Find the contents of register R20 after each of the following instructions:(a) LDI R20, 0 times 65 LDI R21, 0 times 76 AND R20, R21 (b) LDI R20, 0 times 70 LDI

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site