Question

Problem 5 (15pts): Describe what the following program is doing (Do not need to explain each line of instruction. Just show m
Problem 6 (10pts): For the following sequence of instructions, (1) show all values corresponding to each register in each lin
Problem 5 (15pts): Describe what the following program is doing (Do not need to explain each line of instruction. Just show me the purpose of this code). .equ LEDS, Ox100000 10 # define LEDS Ox10000010 .text global start #base address of LEDS on DEO-Nano start: movia r2, LEDS movi r3, 0b00000001 movi r4, OX7FFF slli r4, r4, 3 add r4, r4, r4 load: movi r5, 0b10000000 loop: stw rs, o(r2) mov r6, ro count: addi r6, r6, 1 bne r6, r4, count beq r5, r3, load roli r5, r5, -1 br loop
Problem 6 (10pts): For the following sequence of instructions, (1) show all values corresponding to each register in each line after the instruction in each line is executed. and (2) use one math equation with 4 parameters, A, B, C, and D to describe what calculation in general this following program represents, .equ B, 4 .equ D, 6 .text global start start: movia r2, A Idw r2, 0(r2) movi r3, B movia r4, C Idw r4, O(r4) movi r5, D div r6, r2, r3 mul r7, r4, r5 add r8, r6, r7 movia r9, ANSWER stw r8, ANSWER(rO) Done: br Done .data A: .word 15 C: word 5 ANSWER: word 4
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 5:

  • This program will initialize all the LED bits then access the address like 0b00001 and value of register 0x7fff and then will shift left immediately.
  • Then add that value and this will turn on the LED then after that it will access the address 0b0001.
  • Then increment each value till of branch not equal and will lighten the LED's and if the branch is equal.
  • Then it will off the LED's again load the address and will repeat the process.
Add a comment
Know the answer?
Add Answer to:
Problem 5 (15pts): Describe what the following program is doing (Do not need to explain each line of instruction....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • third photo is problem 8 pt 2. anything would help please Problem 7 (15pts) Convert this...

    third photo is problem 8 pt 2. anything would help please Problem 7 (15pts) Convert this following pseudo-code in high level language into a piece of an assembly code (NIOS 2). In the following pseudo-code in high level language, r4, r5, r6, and r10 represent registers 4,5, 6, and 10, respectively Consider this pseudo-code in high level language: If ! (r4 >r5 or rs <r6) r10=r10+1 else r10- r10-1 This becomes the following piece in assembly code (put you answers...

  • 5.3 Rewrite the following program fragment that is written using the GPR instruction set for execution...

    5.3 Rewrite the following program fragment that is written using the GPR instruction set for execution on a CISC processor that provides the same instruction set as the GPR processor but allows the register addressing mode to be used on the input operands or destination of any instruction. (Yes, the code fragment will execute correctly as written on such a processor. Your goal should be to reduce the number of instructions as much as possible. ) Assume that the program...

  • Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at...

    Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...

  • Helloo Who can help with this problem Consider the following DLX assembler program: start: LW R1,...

    Helloo Who can help with this problem Consider the following DLX assembler program: start: LW R1, 2020 (R0) ADD R2, R0, R0 ADD R5, R0, R0 loop: LW R3, 1000 (R2) ADDI R2, R2, # 4 SEQ R4, R1, R3 BEQZ R4, loop2 ADDI R5, R5, # 1 loop2: SEQI R4, R2, # 1000 BEQZ R4, loop end: SW 2000 (R0), R5 STOP Give in a short sentence what the program calculates And do not forget to comment each line

  • Compute the correct CPU computations and actions. Write the final updated values for each memory, register...

    Compute the correct CPU computations and actions. Write the final updated values for each memory, register and flags after the given instruction executes in the space provided. There are multiple parts of this problem. Endianness: Check for endianness in case of loads and stores, in each part of the question. If the question does not specify the endianness, you can assume little-endian. MOVT R3, #OxBD34 Orig. Updated Data Updated Data R6 Memory Address Ox84F0 0x84F1 0x8452 Ox84F3 Ox8454 Ox84F5 Ox84F6...

  • ARM assembly language Write the final updated values for each memory and register after the given...

    ARM assembly language Write the final updated values for each memory and register after the given instruction executes in the space provided.There are multiple parts of this problem. Note Only write the change values if the values didn't change. Leave the updated cell blank. please explain (as simple as possible ) whats going on after the given command is executed . Q.5.4 Bring to class LSL R6, R6, #3 Updated Data Updated Data Memory Address Ox84F0 Ox 841 Ox84F2 Ox843...

  • Explain how the program is working each line please. Thanks, Given the following program, what is...

    Explain how the program is working each line please. Thanks, Given the following program, what is the value of the SP after the program execution? text .global STRT mov.w #0x300,SP STRT StopWDT mov.w #WDTPW+WDTHOLD,WDTCTL push R6 jmp ed ed Given the following program, what is the value of the SP after the program execution? text .global STRT mov.w #0x300,SP STRT StopWDT mov.w #WDTPW+WDTHOLD,WDTCTL push R6 jmp ed ed

  • Consider a VEX-executing VLIW machine with the following characteristics: The machine supports 4 slots (4-wide machine)...

    Consider a VEX-executing VLIW machine with the following characteristics: The machine supports 4 slots (4-wide machine) with the following resources: 2 memory units each with a load latency of 3 cycles 2 integer-add/sub functional units with a latency of 2 cycle 1 integer-multiply functional unit with a latency of 4 cycles Each functional unit in the machine is pipelined and can be issued a new operation at each cycle. However, the results of an operation are only available after the...

  • 5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2,...

    5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2, $0, 11 add $t3, $t1,$t2 move $t4, $t3 The following image shows a screen shot of QtSPIM page when this program is loaded, and executed in step-by step fashion. Current instruction is highlighted. Data Text x Text Regs Int Regs [16] Int Regs [16] PC = 400028 EPC 0 Cause = 0 BadAddr = 0 Status = 3000ff10 HI LO = 0 = 0...

  • Create a program that performs the following operations: 1. Prompt for and accept a string of...

    Create a program that performs the following operations: 1. Prompt for and accept a string of up to 80 characters from the user. • The memory buffer for this string is created by: buffer: .space 80 #create space for string input The syscall to place input into the buffer looks like: li $v0,8 # code for syscall read_string la $a0, buffer #tell syscall where the buffer is li $a1, 80 # tell syscall how big the buffer is syscall 2....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT