EasyManuals Logo

Xilinx MicroBlaze Reference Guide

Xilinx MicroBlaze
316 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #197 background imageLoading...
Page #197 background image
MicroBlaze Processor Reference Guide 198
UG984 (v2018.2) June 21, 2018 www.xilinx.com
Chapter 5: MicroBlaze Instruction Set Architecture
addi
Arithmetic Add Immediate
addi
rD, rA, IMM
Add Immediate
addic
rD, rA, IMM
Add Immediate with Carry
addik
rD, rA, IMM
Add Immediate and Keep Carry
addikc
rD, rA, IMM
Add Immediate with Carry and Keep Carry
0 0 1 K C 0 rD rA
IMM
0 6 11 16
31
Description
The sum of the contents of registers rA and the value in the IMM field, sign-extended to 32 bits, is
placed into register rD. Bit 3 of the instruction (labeled as K in the figure) is set to one for the
mnemonic addik. Bit 4 of the instruction (labeled as C in the figure) is set to one for the mnemonic
addic. Both bits are set to one for the mnemonic addikc.
When an addi instruction has bit 3 set (addik, addikc), the carry flag will keep its previous value
regardless of the outcome of the execution of the instruction. If bit 3 is cleared (addi, addic), then the
carry flag will be affected by the execution of the instruction.
When bit 4 of the instruction is set to one (addic, addikc), the content of the carry flag (MSR[C]) affects
the execution of the instruction. When bit 4 is cleared (addi, addik), the content of the carry flag does
not affect the execution of the instruction (providing a normal addition).
Pseudocode
if C = 0 then
(rD) (rA) + sext(IMM)
else
(rD)
(rA) + sext(IMM) + MSR[C]
if K = 0 then
MSR[C]
CarryOut
Registers Altered
•rD
•MSR[C]
Latency
1 cycle
Notes
The C bit in the instruction opcode is not the same as the carry bit in the MSR.
By default, Type B Instructions take the 16-bit IMM field value and sign extend it to 32 bits to use as
the immediate operand. This behavior can be overridden by preceding the Type B instruction with an
imm instruction. See the instruction
“imm,” page 241 for details on using 32-bit immediate values.
Send Feedback

Table of Contents

Other manuals for Xilinx MicroBlaze

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Xilinx MicroBlaze and is the answer not in the manual?

Xilinx MicroBlaze Specifications

General IconGeneral
Architecture32-bit RISC
CacheConfigurable Instruction and Data Cache
CategorySoft Processor Core
Data Width32-bit
Memory Management Unit (MMU)Optional
Floating Point Unit (FPU)Optional
Interrupt ControllerConfigurable
Memory ManagementOptional MMU
ConfigurabilityHighly Configurable
Pipeline Stages3-stage
FPGA IntegrationXilinx FPGAs
Bus InterfacePLB
Debug InterfaceJTAG
Typical Clock SpeedVaries depending on FPGA and configuration (e.g., 100-400+ MHz)
ImplementationSoft core (synthesized logic)
Maximum PerformanceVaries with FPGA and configuration
Debug SupportIntegrated Debug Module

Related product manuals