Question

Problem 4. [10 pts] Find the result and resulting NZCV flags for each 16-bit operation. operation result 0x8004 0x8005 0x8000

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

Answer 4)

0x8004 - 0x8005 = 0xFFFF (-1 in 2's complement format)

Therefore N = 1 (as the result is negative)

Z = 0 (as the result is non-zero)

C = 0 (as the result fits in 16 bits)

V = 0 (there is no overflow)

Please note that overflow bit is set when addition of two positive (P) number gives a negative number or addition of two negative (N) numbers gives a positive number

Also in case of subtraction

if P - N = N then there is overflow

or if N - P = P then also there is overflow

Likewise

0x8000 + 0x6000 = 0xE000

N = 1 (result is negative)

Z = 0

C = 0

V = 0 as this is case of adding a negative number 0x8000 with a positive number 0X6000

Next

0xA000 + 0x6000 = 0x10000

N = 0 (the result in 0 which non-negative)

Z = 1 as the lower sixteen bits have become 0

C = 1 as the result of adding two 16-bit numbers in this case cannot be contained in 16 bits.

V = 0, there is no overflow here

Next

0x3000 - 0xA000 = 0x9000

N = 1, the result is negative

Z = 0

C = 1 ( a borrow is generated)

V = 1 (this is a case of Positive - Negative subtraction, and the result is negative. This indicates that overflow has taken place)

Answer 5)

Endian-ness refers to how we store the bytes of a multibyte number in memory. Endian-ness comes in two flavours - Little Endian and Big Endian. I think an example will help you understand the difference immediately:

Suppose we wish too store a 16-bit number 0x1234 in the memory, starting at address 0x00

In Little Endian system this storage will be as shown below:

Address Content

00 Hex 34 Hex

01 Hex 12 Hex

So in this case the lower address stores the lower order byte of the data

In Big Endian system the same number would be stored as

Address Content

00 Hex 12 Hex

01 Hex 34 Hex

So here the higher order byte is stored at the lower address

Answer 6

The term breakpoint generally refers to an address (or addresses) in a program where programmer wishes the program execution to halt temporarily. This is typically done when debugging a program. When the execution is halted at a particular location to let the programmer can examine the contents of various registers, I/O port and memory location to check if these are as expected. This, as you can imagine, would not be possible if program execution was happening at full-speed. These type of breakpoints are called Instruction Breakpoint.

For example consider the following set of instructions:

Instruction 1

Instruction 2

Instruction 3

Instruction 4

Instruction 5

................

Here the programmer has set the breakpoint at Instruction 3. So the execution halts just short of executing this instruction. After that the programmer can examine the registers etc and/or execute instruction 4, 5 one by one (i.e. in single-step mode).

There can also be data breakpoint. In this case the program execution stops when value of a variable or contents of a register /Data memory location acquire a certain value.

Hope this helps.

Add a comment
Know the answer?
Add Answer to:
Problem 4. [10 pts] Find the result and resulting NZCV flags for each 16-bit operation. operation...
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
  • (20 pts) Perform the following operation: • (4−12)10, Using signed binary, 8–bit 2’s complement arithmetic.

    (20 pts) Perform the following operation: • (4−12)10, Using signed binary, 8–bit 2’s complement arithmetic.

  • Exercise 1. What is the size of the memory for the microprocessor if it has 24-bit...

    Exercise 1. What is the size of the memory for the microprocessor if it has 24-bit address lines (bus)? Furthermore, give the starting address and the last address of the memory. 2. List the operation modes of the ARM Cortex-M3. 3. What is the function of register R13? Register R14? Register R15? 4. On an ARM Cortex-M3, in any given mode, how many registers does a programmer see at one time? 5. Which bits of the ARM Cortex-M3 status registers...

  • Data Structures and Algorithm Analysis illustrate the result of each operation in the sequence PUSH(S, 4),...

    Data Structures and Algorithm Analysis illustrate the result of each operation in the sequence PUSH(S, 4), PUSH(S, 2), POP(), PUSH(S, 3), PUSH(S, 9), POP(), and PUSH(S, 0) on an initially empty stack S stored in array S[1..6]. 1 2 3 4 5 6 7 1 2 3 4 5 6 7 15 6 2 9 17 3 S15 6 29 173 top[S] = 4 top[S] = 6 top[S] = 5

  • • P1 (10 pts) Show the result of inserting 2, 9, 5, 8, 6, 4, 3,...

    • P1 (10 pts) Show the result of inserting 2, 9, 5, 8, 6, 4, 3, 1 into an initially empty AVL tree (draw a resulting tree after inserting each number; you need to draw 8 AVL trees). • P2 (5 pts) What is the minimum number of nodes in an AVL tree of height 8? • P3 (5 pts) Show the result of deleting the element with key 9' from the following splay tree. • P4 (5 pts) Show...

  • Assembly questions 1. Each of the 8 32-bit general purpose registers in the 80x86 family contains...

    Assembly questions 1. Each of the 8 32-bit general purpose registers in the 80x86 family contains 8 16 bit registers, and 8 8 bit registers. True or false? 2. When we need to see if a math operation resulted in a zero answer, we may use:    a. ESP    b. keyboard latch    c. memory address bus    d. EFLAGS 3. The operation:   add (radius, eax) ;    a. changes the contents of radius.    b. changes the contents...

  • 1. (10 pts) Find safe states/safe executing sequences. If none, explain why. Show your calculation step...

    1. (10 pts) Find safe states/safe executing sequences. If none, explain why. Show your calculation step by step. Three types of resources: A, B, and C. Six processes: PO, P1, P2, P3, P4, and P5. The 'has', 'max', and 'free' tables are as follows. (Stepwise calculation is 6 pts and the result is 4 pts.) Has Max Free A B C A B C | B C PO 1 O 1 2 9 5 L 5 2 P1 1 1...

  • #1,5,9,13,17,21 please :) 1-16, find each of the following dot products ←1,3):(4, 10) 8. (10, 8)...

    #1,5,9,13,17,21 please :) 1-16, find each of the following dot products ←1,3):(4, 10) 8. (10, 8) .(12,-6) (-7,-4)-(-2,-7) 10.(5,-2). (-1,-1) 11. (V3.-2). (3v5-1) 15. (0.8, -0.5) (2,6) 12. (4v2.Vi) . (-v 2.-Vi》 16. (-18, 3)-(10,-300) 13 (5, a) (-3a, 2) 1 14. (4x, 3y). (2y, -5x) In Exercises 17-32, find the angle e (0 s e s 180; round to the nearest degree) between each pair of vectors (2. -4) and (4, -1) 17 (-4,3) and (-5,-9) (-4, 6) and(-6,8)...

  • Question 33 10 pts For a direct mapped cache of 4 blocks with a cache block...

    Question 33 10 pts For a direct mapped cache of 4 blocks with a cache block size of 1 byte, in which cache block will each memory location map to? The order of accesses if given by the operation number. Indicate if each access is a hit or a miss, and what the tag value is for each entry. Assume that the cache is initially empty, and the accesses are in order of appearance. REDRAW AND COMPLETE THE CACHE TABLE...

  • the problem and it's solution is given please derive the steps Problem 4 (30 pts) The...

    the problem and it's solution is given please derive the steps Problem 4 (30 pts) The input to the circuit of the following Figure is a square wave having a period of 1s, maximum value of 5 V, and minimum value of 0 V. Assume all flip-flops are initially in the RESET state +5 V J J J J K K Q K Input pulse train Output # 1 Output #2 Output #3 Output #4 (1) Explain what the circuit...

  • (3 pts) This problem tests your knowledge about coding schemes.  What is the binary bit pattern for...

    (3 pts) This problem tests your knowledge about coding schemes.  What is the binary bit pattern for the letter 'h' using? The answers should give the whole bit string (including leading 0s). ASCII encoding (7-bits) EBCDIC encoding (8-bits) UNICODE encoding (16 bits)   ______________________________________________________________________________   (3 pts) Show how each of the following floating point values would be stored using IEEE-754 single precision (be sure to indicate the sign bit, the exponent, and the significand fields): (show your work) 12.5   −1.5   0.75 26.625...

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