Adsense

Write a ARM cortex M0+ assembly language code based on arithmatc and logical instructions.

 Problem 1: Implement following code conversions to convert binary no 0x89ABCDEF(32-bits) into

a) BCD (64-bits)  

b) Gray (32-bits)

Problem 2: Realize following boolean expressions for 32-bits input R1, R2 and R3.

Sum/ Diff  = R1 ^ R2 ^ R3

Carry = (R1 ^ R2) . R3 + R1 .R2

 Borrow = ( R1 ^ R2)' .R3  + ( R1') . R2

Problem 3: Write a assembly language code to multiply 32-bit data stored on R1 and R2 and 64-bit  result will generated and stored into R3(H) and R4(L). Please refer the below figure to implement the same.

 

 

Arithmetic instructions sample code: https://embedded4everyone.blogspot.com/2021/01/write-assembly-code-to-perform.html

Logical Instruction Sample code: https://embedded4everyone.blogspot.com/2021/01/write-assembly-code-to-perform-logical.html

Data transfer instruction with memory: https://embedded4everyone.blogspot.com/2021/01/write-assembly-language-code-to-program.html


Write Embedded C code for FRDMKL25Z to interface four switches to perform the operation mentioned in below table and store the results to the locations.

 Table

SW1

SW2

SW3

SW4

Operation

Result stored on location

OFF

OFF

OFF

OFF

No operation

-

ON

OFF

OFF

OFF

Addition

0x1FFFF100 – 0x1FFFF103

OFF

ON

OFF

OFF

Subtraction

0x1FFFF104 – 0x1FFFF107

OFF

OFF

ON

OFF

Multiplication

0x1FFFF108 – 0x1FFFF10F

OFF

OFF

OFF

ON

Division

0x1FFFF110 – 0x1FFFF113

 

Steps to implement the experiment:

1) Configure the SW1, SW2, SW3 and SW4 as an input.

2) Take the two numbers i.e.  unsigned int X= 0x32, Y= 0x04.

3) Implement the switch pressed detected inclined to the operations.

4) Implement the above mentioned table and store the results to the mentioned locations.

5) Continuously check for the switch pressed. Repeat the steps 3 and 4. 


Write a ARM cortex M0+ assembly language code based on arithmatc and logical instructions.

 Problem 1: Implement following code conversions to convert binary no 0x89ABCDEF(32-bits) into a) BCD (64-bits)   b) Gray (32-bits) Problem...