Top Banner
Assignment 1 AIM OF THE ASSIGNMENT: To find the differences between ARM families and programming in ARM assembly ASSIGNMENT DESCRIPTION: 1. Explain about ARM7 and ARM9 families. Explain major differences in their architecture especially about their pipeline structures. 2. Explain RISC and CISC processors in details. Take one sample processor each and compare their features. CISC 8086 or 8085 and RISC ARM 3. Write an Assembly language program for adding three numbers and finding the average of the sum. TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours. DELIVERABLES FOR THE ASSIGNMENT: Document contains following points Architectural differences between ARM7 and ARM9 RISC and CISC architecture details Assembly program to find the sum and average of three numbers EVALUATION CRITERIA: The assignment is evaluated for 10 marks. 5 Marks are awarded for the architectural differences 5 Marks are awarded for the assembly program SKILL MATRIX Remember Understand Apply Analyze Evaluate Create Factual Knowledge Conceptual Knowledge Procedural Knowledge Meta cognitive Knowledge
13

ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Apr 02, 2018

Download

Documents

vantuong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 1

AIM OF THE ASSIGNMENT:

To find the differences between ARM families and programming in ARM assembly

ASSIGNMENT DESCRIPTION:

1. Explain about ARM7 and ARM9 families. Explain major differences in their architecture

especially about their pipeline structures.

2. Explain RISC and CISC processors in details. Take one sample processor each and

compare their features. CISC – 8086 or 8085 and RISC – ARM

3. Write an Assembly language program for adding three numbers and finding the average of

the sum.

TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Architectural differences between ARM7 and ARM9

RISC and CISC architecture details

Assembly program to find the sum and average of three numbers

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

5 Marks are awarded for the architectural differences

5 Marks are awarded for the assembly program

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 2: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 2

AIM OF THE ASSIGNMENT:

Verify the below conditions (CZNV) for each of the conditional checks used by the ARM processor.

ASSIGNMENT DESCRIPTION:

Perform arithmetic by taking sample numbers and verify the conditional checks using ARM instructions with the help of ARMSim# simulator. For example: (sample code for verifying EQ condition) MOV r0, #0x02 ; can be any number MOV r1, #0x02 CMP r0, r1 ; note that CMP instructions always affect the condition flags

; Look at the Condition flags after this instruction for its correctness BLEQ same SWI 0x11 ; to terminate the execution and return control back to user Same: SWI 0x11 ; Single step the code to see where the control goes In the above, example, since r0 and r1 are having the same contents, BLEQ will be true and the control branches to the label same. Exercises: Similar to the above BLEQ conditional check, perform checks for other conditions, like BLNE, BLCS, BLHS, etc. by initializing the r0, r1 registers with appropriate signed and unsigned values and performing check and running it on the simulator. Each student should try out different set of numbers on r0 and r1 then look at the Condition flags (CZNV) and verify their states by performing the operation themselves manually too. Note: The CMP is the Compare instruction which subtracts Operand2 from Operand1 and based on the status of conditional flags (as shown in the table below) branches to the label mentioned in the code. In the above example, (r0 – r1) is performed, without changing the contents of r0 and r1. Based on the conditional flags set, branch is taken or not taken. Ref: the table is in the next page.

Page 3: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 6 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Programs for each conditional check using the given instruction

Status of the each flag C,Z,N,V after the program is executed and explanation

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 4: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 3

AIM OF THE ASSIGNMENT:

Implement arithmetic and logical operations using ARM assembly language.

ASSIGNMENT DESCRIPTION:

1) Implement the following functions in Assembly.

a) Where out, a, b, c are all Unsigned Integers of 32 bits wide Assume that the variables are initialized with the following values: a = 0xF0000000 b = 0xF1 c = 0x22 Verify the values assigned to out after these operations performed in each case. i) out = (a + b) - c;

ii) out = a * (b+c);

iii) out = (a << 2) | (b & 15);

iv) out = (a >> 4) && (b << 16) && (c << 24) b) Assumed the following variables are of Signed Integers of 32 bits wide There are to be initialized with the following values i = -20 j = -48 k = 100 out = 0 Verify the values assigned to out after these operations are performed in each case. i) out = (I >> 2) + (j >> 3);

ii) out = (~I) ^ (~j) ^ (k) ; ; Please note that ^ is an ExOR operator, ~ is invert operator

iii) out = (i/2) + (j/4) + (k/4) ; perform this by using logical operations

iv) out = (I << 2) + (j << 5) + (k << 8) TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

The document should contain programs for all the operations mentioned above and results should be

there for both signed and unsigned values.

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

5 Marks are awarded for the arithmetic operations

5 Marks are awarded for the logical operations

Page 5: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 6: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 4

AIM OF THE ASSIGNMENT:

Perform multiplication on two operands without using MUL instruction in ARM assembly language

ASSIGNMENT DESCRIPTION:

Without using MUL instruction, perform multiplication operation on any two operands, with both of them being: Verify the values computed. a. Positive numbers

b. One positive and other negative number

c. Both negative numbers TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Assembly program for ARM micro controller to perform multiplication operation

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 7: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 5

AIM OF THE ASSIGNMENT:

To compare three values for largest, smallest and equality

ASSIGNMENT DESCRIPTION:

Compare three register values in r0, r1 and r2 for the largest, the smallest and equality conditions by suitably initializing them with both negative and positive values. a. All combinations need to be checked TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Assembly program to find smallest, largest and equality

Conditions should be checked for all combinations of the numbers i.e. for all negative

and positive value combinations

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 8: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 6

AIM OF THE ASSIGNMENT:

To describe condition of CPSR flags using different assembly programs

ASSIGNMENT DESCRIPTION:

Explain CPSR register in detail with examples for all the condition flags (CZNV) Perform the following functions to set the specific CZNV flags a. Arithmetic operations (ADD, SUB, RSB)

b. CMP instructions by comparing preset values in registers

c. TST instruction by testing specific bits set in registers

d. Logical operations (LSL, LSR, ASR, ROR, RRX)

e. Perform these special operations and justify the results got (LSL #0, LSR #0, ASR #0, ROR #0) 2) Explain the following ASM code in detail, giving the reasons for the status of flags (CZNV) after every instruction is executed. Initialize: R1 = 0x0F, R2 = 0xFFFFFFF0 (assume them as unsigned values) ADD r0, r1, r2 ; ADDS r0, r1, r2 ; ADDSCS r0, r1, r2 ; CMP r0, r1 ; ADD r1, #0x1 ADD r0, r1, r2 ; ADDS r0, r1, r2 ; ADDSCS r0, r1, r2 ; CMP r0, r1 TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Condition of CPSR flags for all the operations mentioned above.

Condition of CPSR flags for the each and every instruction in the above program.

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 9: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 7

AIM OF THE ASSIGNMENT:

To write assembly program to swap the contents of two registers and to reverse a given

string.

ASSIGNMENT DESCRIPTION:

1) Write an assembly language program to swap the contents of register r0 and r1. Note: Do not use the SWP instruction.

2) Write a program to reverse a given string in a known location in memory and writing

the reversed string in another location in memory.

TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Assembly program to swap register contents without using SWP instruction

Assembly program to reverse a given string.

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

5 Marks are awarded for swapping the register contents

5 Marks are awarded for reversing the string

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 10: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 8

AIM OF THE ASSIGNMENT:

To copy data from one memory location to another memory location using ARM assembly

language programming

ASSIGNMENT DESCRIPTION:

1) Write a program to copy a block of 64 bytes from any memory address location to

another memory location. Set the source and destination registers with suitable

addresses. Use the simulator to initialize those locations with known values and

verify the destination address is copied with those values after executing the

program.

a. Use all the supported addressing modes to perform this memory copy and

verify the contents at the destination address.

b. Verify the behaviour when the starting and/or destination addresses are:

1.b.i. word aligned

1.b.ii. half-word aligned

1.b.iii. byte aligned

TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Program to copy contents from one memory location to another memory location

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 11: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 9

AIM OF THE ASSIGNMENT:

To perform different operations on the values stored in the memory locations

ASSIGNMENT DESCRIPTION:

Having initialized with a known values in a known locations in memory, perform the

following operations on their contents by writing assembly programs for each and verify by

looking at those values using the simulator:

a. Complement all the bits

b. Initialize them with all zeros

c. Initialize them with all ones

d. If a byte value is odd, add one (1) to it

e. Initialize it with ASCII alphabets, both small and capital letters, then change them

all too capital letters

TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Program complement all the bits in a memory location

Program to initialize values with 1’s and 0’s. Program to change small letters to capital letters and change odd number to even

number EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta

cognitive

Knowledge

Page 12: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...

Assignment 10

AIM OF THE ASSIGNMENT:

To perform different operations on memory elements and strings

ASSIGNMENT DESCRIPTION:

1) Initialize 256 bytes in memory with the following values and find number of zeros and

ones in them by writing the count of 1's and 0's in two registers

a. All zeros

b. All ones

c. A string or known values

2) write two different strings in two different locations in memory, of length 64 bytes each.

Then write assembly programs to perform the following operations:

a. Interchange the strings without saving them into any other location in memory

b. Write the appended string in another location in memory (s1 + s2)

c. Create a new string in another location of 64 bytes, with odd byte locations from

s1 and even byte locations from s2

TIME LINES OF THE ASSIGNMENT: The duration of the assignment is 3 Hours.

DELIVERABLES FOR THE ASSIGNMENT:

Document contains following points

Program to implement the operations on the memory elements

Program to perform string operations

EVALUATION CRITERIA: The assignment is evaluated for 10 marks.

5 Marks are awarded for the architectural differences

5 Marks are awarded for the assembly program

SKILL MATRIX

Remember Understand Apply Analyze Evaluate Create

Factual

Knowledge

Conceptual

Knowledge

Procedural

Knowledge

Meta cognitive

Knowledge

Page 13: ASSIGNMENT DESCRIPTION - NPTEL Assignment/ARM Assignments...unsigned values and performing check and running it on the ... Assembly program for ARM micro controller to perform ...