cmp - 2024.2 English

MicroBlaze Processor Reference Guide (UG984)

Document ID
UG984
Release Date
2024-11-27
Version
2024.2 English
Figure 1. cmp

Description

The contents of register rA are subtracted from the contents of register rB and the result is placed into register rD.

The MSB bit of rD is adjusted to shown true relation between rA and rB. If the U bit is set, rA and rB is considered unsigned values. If the U bit is clear, rA and rB is considered signed values.

Pseudocode

(rD) ← (rB) + (rA) + 1
(rD)(MSB) ← (rA) > (rB)

Registers Altered

  • rD

Latency

1 cycle