Question

Provide the RTL notation for the following ARM instruction RSB r2, r3, r4

Provide the RTL notation for the following ARM instruction RSB r2, r3, r4

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

The subtract instruction subtracts the first source operand from the second source operand and puts the result in the destination.

SUB r2,r1,r0 performs [r2] ← [r1] - [r0].

A subtract with borrow, SBC r2,r1,r0 performs [r2] ← [r1] - [r0] - C (the carry bit is also subtracted from the result). This is entirely analogous to the corresponding add with carry instruction and is used in the same way to perform extended arithmetic.

The ARM processor has a most unusual variant of the subtract instruction, RSB (reverse subtract) that performs a reverse subtraction in which the operands are reversed; that is,

Register-transfer language (RTL) is an algebraic notation that describes how information is accessed from memories and registers and how it is operated on. You should appreciate that RTL is just a notation and not a programming language. RTL uses square brackets to indicate the contents of a memory location; for example

SBC r2,r1,r0 performs [r2] ← [r1] - [r0] (normal subtraction)

RSB r2,r3,r4 performs [r2] ← [r4] - [r3] (reverse subtraction)

At first sight, this instruction seems pointless. After all, if you want to reverse the order of the operands, you can just write them the other way round and write SUB r2,r1,r0 or SUB r2,r0,r1 as required. However, ARM instructions that specify a literal operand are always of the form ADD r1,r2,#12 and the position of the literal cannot be changed. Therefore, the reverse subtraction allows you to perform the operation, say, 123 - r0 by writing RSB r0,r0,#123

So RSB is reverse Subtraction

And i have Given RTL notation above

I have tried my best to answer your question

If you have any doubt then please ask me in comment section

I will try my best to answer your query

ThankYou!

Happy Learning:)

.

Add a comment
Know the answer?
Add Answer to:
Provide the RTL notation for the following ARM instruction RSB r2, r3, r4
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
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