Question

8. (8 pt) After executing each group of instructions, write down if the branch is taken or not-taken (i.e., write down if the

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Write the branch outcome for each of the following independent set of instructions:

R1 = FFFF FFFF16

R2 = 0000 000116

(1) slt R3, R1, R2

beq R3, R0, target

Branch outcome: not-taken branch (branch condition is false)

Description:

• slt R3, R1, R2 ; Set on less than. if R1 < R2 then set register R3 = 1 otherwise R3 = 0.

• beq R3, R0, target ; if R3 = R0 that means if R3 = 0 then Branch to target

• This instruction compares the register R1 and R2 in 2's complement form.

• According to two's complement form, R1 represents -1 and R2 represents +1 value.

• Here, R1 < R2 means -1 < +1 is true. So, set the register R3 = 1.

• Branch will not be taken as R3 = 1.

(2) sltu R3, R1, R2

beq R3, R0, target

Branch outcome: taken branch (branch condition is true)

Description:

• sltu R3, R1, R2    ; Set on less than Unsigned. if R1 < R2 then set register R3 = 1 otherwise R3 = 0.

• beq R3, R0, target ; if R3 = R0 that means if R3 = 0 then Branch to target

• This instruction compares the register R1 and R2 in natural number form.

• According to natural number form, R1 represents 4294967295 and R2 represents 1 value.

• Here, R1 < R2 is false. So, the register R3 = 0.

• Branch will be taken as R3 = 0.

(3) slti R3, R1, 8

beq R3, R0, target

Branch outcome: not-taken branch (branch condition is false)

Description:

• slti R3, R1, 8     ; Set on less than Immediate. if R1 < 8 then set register R3 = 1 otherwise R3 = 0.

• beq R3, R0, target ; if R3 = R0 that means if R3 = 0 then Branch to target

• This instruction compares the register R1 and the immediate 8 in 2's complement form.

• According to two's complement form, R1 represents -1 value.

• Here, R1 < R2 means -1 < 8 is true. So, set the register R3 = 1.

• Branch will not be taken as R3 = 1.

(4) sltui R3, R1, 8

beq R3, R0, target

Branch outcome: taken branch (branch condition is true)

Description:

• sltui R3, R1, 8 ; Set on less than Unsigned Immediate. if R1 < 8 then set R3 = 1 otherwise R3 = 0.

• beq R3, R0, target ; if R3 = R0 that means if R3 = 0 then Branch to target

• This instruction compares the register R1 and immediate 8 in natural number form.

• According to natural number form, R1 represents 4294967295 value.

• Here, 4294967295 < 8 is false. So, the register R3 = 0.

• Branch will be taken as R3 = 0.

Add a comment
Know the answer?
Add Answer to:
8. (8 pt) After executing each group of instructions, write down if the branch is taken...
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
  • . (10 pt) Registers R1 and R2 hold the values given below. Write down the values...

    . (10 pt) Registers R1 and R2 hold the values given below. Write down the values in R3 and R4 after executing each group of instructions given below. Assume that each group of instructions is independent of each other and each group uses the register values given below. Show your work. Rl = 00AA BB1116 R2 0000 0010016 multu R1, R2 mfhi R3 R3= 16 mflo R4 R4 = 16 divu R1, R2 mfhi R3 R3= 16 mflo R4 R4=...

  • The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2,...

    The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2, F(n + 1) = F(n) + F(n − 1) i.e., the (n + 1)th value is given by the sum of the nth value and the (n − 1)th value. 1. Write an assembly program typical of RISC machines for computing the kth value F(k), where k is a natural number greater than 2 loaded from a memory location M, and storing the result...

  • 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...

  • 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...

  • Note: The question needs to be answered in "C Programming Languange ". And after the question fin...

    Note: The question needs to be answered in "C Programming Languange ". And after the question find 3 pages for needed informations. Spring CE4717 Language Processors Q1. Consider the following LEx program. return R1 return R2 return R3 return R4 return R5; return R6; IA-2a-z)[A-Za-z0-9]- -2 10-91+ 10-9a-EA-FI Ihi] [01] [01] 이삐 t Vtin) int main (void) int tcode; do f tcode -yylex()i printf ("token type td \"%s\"\n", tcode, yytext); ) while (tcode)i return 0; i. Explain the steps needed...

  • I need help with my very last assignment of this term PLEASE!!, and here are the instructions: After reading Chapter T...

    I need help with my very last assignment of this term PLEASE!!, and here are the instructions: After reading Chapter Two, “Keys to Successful IT Governance,” from Roger Kroft and Guy Scalzi’s book entitled, IT Governance in Hospitals and Health Systems, please refer to the following assignment instructions below. This chapter consists of interviews with executives identifying mistakes that are made when governing healthcare information technology (IT). The chapter is broken down into subheadings listing areas of importance to understand...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

  • Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around...

    Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...

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