Skip to content

§ 4.3.3. ALU32

ALU32 is the complete combinational arithmetic/logic reference. RV32I Execute uses its ALU32Core variant: the same arithmetic, logic, shifting, and comparison network without the result-flag outputs that Execute never reads. Its five-bit operation encoding is not the ALU8 encoding. There is no carry input, multiplication, division, rotation, or invalid-operation output.

The single-cycle Execute stage has one instance at CORE.EXECUTE.ALU, shared by arithmetic, address calculation, branch comparison, and JAL/JALR target calculation. PC+4 and the concurrent branch-target addition use separate adders; Writeback supplies jump links.

Component Description Structural Behavioral
AddSub32 Shared addition/subtraction with carry and overflow Yes Yes
Logic32 Parallel AND, OR, and XOR Yes Yes
Shifter32 Logical left/right and arithmetic right shifts Yes Yes
ALU32ControlDecoder Opcode split and local controls Yes No
ALU32CompareUnit Comparison flags and Boolean result words from subtraction Yes No
ALU32ResultSelector Selects the operation result Yes No
ALU32FlagUnit Result flags and arithmetic-flag qualification Yes No
ALU32 Complete unit with the RV32I ALU interface Yes Yes
ALU32Core CPU datapath variant with result and branch-comparison outputs Yes Yes

Columns describe registered simulator implementations, not the C++ examples. The examples describe settled binary behavior, omit delays and X/Z, and can be compiled together in page order. Arithmetic uses unsigned 32-bit words and wraps modulo \(2^{32}\).

4.3.3.1. AddSub32

IO pins

Pin Direction Width Description
A, B Input 32 each Operands
SUB Input 1 0: addition; 1: subtraction
OUT Output 32 Wrapped result
CARRY_OUT Output 1 Addition carry; subtraction no borrow
OVERFLOW Output 1 Signed overflow

Behavior

The shared adder computes A + (B XOR {32{SUB}}) + SUB. Subtraction therefore sets carry when unsigned A >= B. Overflow is independent of unsigned carry.

C++ example

#include <array>
#include <cstdint>
namespace alu32_example {
struct Arithmetic { uint32_t OUT; bool CARRY_OUT, OVERFLOW; };
Arithmetic addsub(uint32_t a, uint32_t b, bool sub) {
    const uint64_t wide = uint64_t(a) + (sub ? ~b : b) + sub;
    const uint32_t out = uint32_t(wide);
    const bool overflow = ((sub ? (a ^ b) : ~(a ^ b)) & (a ^ out) & 0x80000000U) != 0;
    return {out, bool(wide >> 32), overflow};
}
}

Unknown inputs and timing

Each bit follows XOR/AND/OR full-adder logic. A known controlling zero or one can mask an unknown; the entire word is not automatically discarded. Structural carries propagate through a prefix network. The catalog-selected behavioral implementation uses gate-derived path delays; a supported delay twin can time how far the carry propagates for the current operands.

Implementation

Structural implementation

Each B bit passes through an XOR with SUB; SUB also supplies carry-in to the shared prefix adder. A joiner collects sums. XOR of the carry into and out of bit 31 produces overflow. The optional ripple reference instead uses 32 chained FullAdder stages.

The default structural implementation uses ParallelPrefixAdder32: HalfAdder bit generate/propagate signals, five grouped carry-prefix levels (distances 1, 2, 4, 8, 16), then carry-in application and sum XORs. CarryCombine contains only AND/OR gates. Overflow remains carry into bit 31 XOR carry out. Adder32 uses the same prefix component, so all cores receive the arithmetic improvement. The original ripple structure remains constructible with Component::create<AddSub32>("RIPPLE", false) (and likewise Adder32) for comparison.

The default layout follows connectivity. Prefix levels are expandable groups rather than one flat gate diagram. ArithmeticTimingOptimizationTest compares both structures on binary and four-state inputs; the five-level carry network changes propagation time, not the settled arithmetic contract.

Behavioral implementation

AddSub32Behavioral evaluates that same full-adder recurrence with four-state bit values, without constructing its internal gates.

Examples

All 80 recorded rows of AddSub32Test, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (16dc1c073540b939). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units AInput · 32 bit BInput · 32 bit SUBInput · 1 bit CARRY_OUTExpected output · 1 bit OUTExpected output · 32 bit OVERFLOWExpected output · 1 bit
#0row-018 0x00000000 0x00000000 0 0 0x00000000 0
#1row-131 0x00000001 0x00000002 0 0 0x00000003 0
#2row-254 0xFFFFFFFF 0x00000001 0 1 0x00000000 0
#3row-370 0xFFFFFFFF 0xFFFFFFFF 0 1 0xFFFFFFFE 0
#4row-493 0x55555555 0xAAAAAAAA 0 0 0xFFFFFFFF 0
#5row-5111 0x55555555 0xAAAAAAAA 1 0 0xAAAAAAAB 1
#6row-6132 0x7FFFFFFF 0x00000001 0 0 0x80000000 1
#7row-7150 0x80000000 0x80000000 0 1 0x00000000 1
#8row-8169 0x7FFFFFFF 0xFFFFFFFF 0 1 0x7FFFFFFE 0
#9row-9191 0x00000005 0x00000003 1 1 0x00000002 0
#10row-10211 0x00000000 0x00000001 1 0 0xFFFFFFFF 0
#11row-11227 0x80000000 0x00000001 1 1 0x7FFFFFFF 1
#12row-12246 0x7FFFFFFF 0xFFFFFFFF 1 0 0x80000000 1
#13row-13264 0x80000000 0x7FFFFFFF 1 1 0x00000001 1
#14row-14283 0xFFFFFFFF 0xFFFFFFFF 1 1 0x00000000 0
#15row-15302 0x00000001 0x00000001 0 0 0x00000002 0
#16row-16323 0x00000002 0x00000001 1 1 0x00000001 0
#17row-17341 0x00000003 0x00000001 0 0 0x00000004 0
#18row-18362 0x00000004 0x00000001 1 1 0x00000003 0
#19row-19380 0x00000007 0x00000001 0 0 0x00000008 0
#20row-20401 0x00000008 0x00000001 1 1 0x00000007 0
#21row-21419 0x0000000F 0x00000001 0 0 0x00000010 0
#22row-22440 0x00000010 0x00000001 1 1 0x0000000F 0
#23row-23458 0x0000001F 0x00000001 0 0 0x00000020 0
#24row-24479 0x00000020 0x00000001 1 1 0x0000001F 0
#25row-25497 0x0000003F 0x00000001 0 0 0x00000040 0
#26row-26518 0x00000040 0x00000001 1 1 0x0000003F 0
#27row-27536 0x0000007F 0x00000001 0 0 0x00000080 0
#28row-28557 0x00000080 0x00000001 1 1 0x0000007F 0
#29row-29575 0x000000FF 0x00000001 0 0 0x00000100 0
#30row-30596 0x00000100 0x00000001 1 1 0x000000FF 0
#31row-31614 0x000001FF 0x00000001 0 0 0x00000200 0
#32row-32635 0x00000200 0x00000001 1 1 0x000001FF 0
#33row-33653 0x000003FF 0x00000001 0 0 0x00000400 0
#34row-34674 0x00000400 0x00000001 1 1 0x000003FF 0
#35row-35692 0x000007FF 0x00000001 0 0 0x00000800 0
#36row-36713 0x00000800 0x00000001 1 1 0x000007FF 0
#37row-37731 0x00000FFF 0x00000001 0 0 0x00001000 0
#38row-38752 0x00001000 0x00000001 1 1 0x00000FFF 0
#39row-39770 0x00001FFF 0x00000001 0 0 0x00002000 0
#40row-40791 0x00002000 0x00000001 1 1 0x00001FFF 0
#41row-41809 0x00003FFF 0x00000001 0 0 0x00004000 0
#42row-42830 0x00004000 0x00000001 1 1 0x00003FFF 0
#43row-43849 0x00007FFF 0x00000001 0 0 0x00008000 0
#44row-44870 0x00008000 0x00000001 1 1 0x00007FFF 0
#45row-45890 0x0000FFFF 0x00000001 0 0 0x00010000 0
#46row-46911 0x00010000 0x00000001 1 1 0x0000FFFF 0
#47row-47931 0x0001FFFF 0x00000001 0 0 0x00020000 0
#48row-48951 0x00020000 0x00000001 1 1 0x0001FFFF 0
#49row-49971 0x0003FFFF 0x00000001 0 0 0x00040000 0
#50row-50991 0x00040000 0x00000001 1 1 0x0003FFFF 0
#51row-511011 0x0007FFFF 0x00000001 0 0 0x00080000 0
#52row-521031 0x00080000 0x00000001 1 1 0x0007FFFF 0
#53row-531051 0x000FFFFF 0x00000001 0 0 0x00100000 0
#54row-541071 0x00100000 0x00000001 1 1 0x000FFFFF 0
#55row-551091 0x001FFFFF 0x00000001 0 0 0x00200000 0
#56row-561111 0x00200000 0x00000001 1 1 0x001FFFFF 0
#57row-571131 0x003FFFFF 0x00000001 0 0 0x00400000 0
#58row-581151 0x00400000 0x00000001 1 1 0x003FFFFF 0
#59row-591171 0x007FFFFF 0x00000001 0 0 0x00800000 0
#60row-601191 0x00800000 0x00000001 1 1 0x007FFFFF 0
#61row-611211 0x00FFFFFF 0x00000001 0 0 0x01000000 0
#62row-621231 0x01000000 0x00000001 1 1 0x00FFFFFF 0
#63row-631251 0x01FFFFFF 0x00000001 0 0 0x02000000 0
#64row-641270 0x02000000 0x00000001 1 1 0x01FFFFFF 0
#65row-651290 0x03FFFFFF 0x00000001 0 0 0x04000000 0
#66row-661309 0x04000000 0x00000001 1 1 0x03FFFFFF 0
#67row-671329 0x07FFFFFF 0x00000001 0 0 0x08000000 0
#68row-681348 0x08000000 0x00000001 1 1 0x07FFFFFF 0
#69row-691368 0x0FFFFFFF 0x00000001 0 0 0x10000000 0
#70row-701387 0x10000000 0x00000001 1 1 0x0FFFFFFF 0
#71row-711407 0x1FFFFFFF 0x00000001 0 0 0x20000000 0
#72row-721425 0x20000000 0x00000001 1 1 0x1FFFFFFF 0
#73row-731445 0x3FFFFFFF 0x00000001 0 0 0x40000000 0
#74row-741463 0x40000000 0x00000001 1 1 0x3FFFFFFF 0
#75row-751484 0x7FFFFFFF 0x00000001 0 0 0x80000000 1
#76row-761501 0x80000000 0x00000001 1 1 0x7FFFFFFF 1
#77row-771519 0b00000000000000000000000000X00000 0x00000000 0 0 0b00000000000000000000000000X00000 0
#78row-781522 0b00000000000000000000000000Z00000 0x00000000 0 0 0b00000000000000000000000000X00000 0
#79row-791540 0x00000000 0x00000000 X X 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open AddSub32

Tests

AddSub32Test checks arithmetic boundaries and flags in both implementations. The table contains every checkpoint of the displayed scenario, with its recorded time.

4.3.3.2. Logic32

IO pins

Pin Direction Width Description
A, B Input 32 each Operands
AND_OUT, OR_OUT, XOR_OUT Output 32 each Three simultaneous bitwise results

Behavior

All three outputs are active together; there is no opcode or enable.

C++ example

namespace alu32_example {
struct Logic { uint32_t AND_OUT, OR_OUT, XOR_OUT; };
Logic logic(uint32_t a, uint32_t b) { return {a & b, a | b, a ^ b}; }
}

Unknown inputs and timing

AND with zero produces zero; OR with one produces one. Other indeterminate cases produce X, including XOR with X or Z. Operations are independent per bit.

Implementation

Structural implementation

Two splitters, 32 gates of each operation, and three joiners provide three parallel paths.

Behavioral implementation

Logic32Behavioral applies the same four-state gate rules per bit and publishes when the gate-level form would have settled for the same inputs.

Examples

All 69 recorded rows of Logic32Test, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (6c28b35478130092). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units AInput · 32 bit BInput · 32 bit AND_OUTExpected output · 32 bit OR_OUTExpected output · 32 bit XOR_OUTExpected output · 32 bit
#0row-02 0xF0F0F0F0 0x0FF00FF0 0x00F000F0 0xFFF0FFF0 0xFF00FF00
#1row-15 0xFFFFFFFF 0x00000000 0x00000000 0xFFFFFFFF 0xFFFFFFFF
#2row-28 0xAAAAAAAA 0x55555555 0x00000000 0xFFFFFFFF 0xFFFFFFFF
#3row-311 0x80000000 0x7FFFFFFF 0x00000000 0xFFFFFFFF 0xFFFFFFFF
#4row-414 0x00000001 0x00000000 0x00000000 0x00000001 0x00000001
#5row-517 0x00000001 0x00000001 0x00000001 0x00000001 0x00000000
#6row-620 0x00000002 0x00000000 0x00000000 0x00000002 0x00000002
#7row-723 0x00000002 0x00000002 0x00000002 0x00000002 0x00000000
#8row-826 0x00000004 0x00000000 0x00000000 0x00000004 0x00000004
#9row-929 0x00000004 0x00000004 0x00000004 0x00000004 0x00000000
#10row-1032 0x00000008 0x00000000 0x00000000 0x00000008 0x00000008
#11row-1135 0x00000008 0x00000008 0x00000008 0x00000008 0x00000000
#12row-1238 0x00000010 0x00000000 0x00000000 0x00000010 0x00000010
#13row-1341 0x00000010 0x00000010 0x00000010 0x00000010 0x00000000
#14row-1444 0x00000020 0x00000000 0x00000000 0x00000020 0x00000020
#15row-1547 0x00000020 0x00000020 0x00000020 0x00000020 0x00000000
#16row-1650 0x00000040 0x00000000 0x00000000 0x00000040 0x00000040
#17row-1753 0x00000040 0x00000040 0x00000040 0x00000040 0x00000000
#18row-1856 0x00000080 0x00000000 0x00000000 0x00000080 0x00000080
#19row-1959 0x00000080 0x00000080 0x00000080 0x00000080 0x00000000
#20row-2062 0x00000100 0x00000000 0x00000000 0x00000100 0x00000100
#21row-2165 0x00000100 0x00000100 0x00000100 0x00000100 0x00000000
#22row-2268 0x00000200 0x00000000 0x00000000 0x00000200 0x00000200
#23row-2371 0x00000200 0x00000200 0x00000200 0x00000200 0x00000000
#24row-2474 0x00000400 0x00000000 0x00000000 0x00000400 0x00000400
#25row-2577 0x00000400 0x00000400 0x00000400 0x00000400 0x00000000
#26row-2680 0x00000800 0x00000000 0x00000000 0x00000800 0x00000800
#27row-2783 0x00000800 0x00000800 0x00000800 0x00000800 0x00000000
#28row-2886 0x00001000 0x00000000 0x00000000 0x00001000 0x00001000
#29row-2989 0x00001000 0x00001000 0x00001000 0x00001000 0x00000000
#30row-3092 0x00002000 0x00000000 0x00000000 0x00002000 0x00002000
#31row-3195 0x00002000 0x00002000 0x00002000 0x00002000 0x00000000
#32row-3298 0x00004000 0x00000000 0x00000000 0x00004000 0x00004000
#33row-33101 0x00004000 0x00004000 0x00004000 0x00004000 0x00000000
#34row-34104 0x00008000 0x00000000 0x00000000 0x00008000 0x00008000
#35row-35107 0x00008000 0x00008000 0x00008000 0x00008000 0x00000000
#36row-36110 0x00010000 0x00000000 0x00000000 0x00010000 0x00010000
#37row-37113 0x00010000 0x00010000 0x00010000 0x00010000 0x00000000
#38row-38116 0x00020000 0x00000000 0x00000000 0x00020000 0x00020000
#39row-39119 0x00020000 0x00020000 0x00020000 0x00020000 0x00000000
#40row-40122 0x00040000 0x00000000 0x00000000 0x00040000 0x00040000
#41row-41125 0x00040000 0x00040000 0x00040000 0x00040000 0x00000000
#42row-42128 0x00080000 0x00000000 0x00000000 0x00080000 0x00080000
#43row-43131 0x00080000 0x00080000 0x00080000 0x00080000 0x00000000
#44row-44134 0x00100000 0x00000000 0x00000000 0x00100000 0x00100000
#45row-45137 0x00100000 0x00100000 0x00100000 0x00100000 0x00000000
#46row-46140 0x00200000 0x00000000 0x00000000 0x00200000 0x00200000
#47row-47143 0x00200000 0x00200000 0x00200000 0x00200000 0x00000000
#48row-48146 0x00400000 0x00000000 0x00000000 0x00400000 0x00400000
#49row-49149 0x00400000 0x00400000 0x00400000 0x00400000 0x00000000
#50row-50152 0x00800000 0x00000000 0x00000000 0x00800000 0x00800000
#51row-51155 0x00800000 0x00800000 0x00800000 0x00800000 0x00000000
#52row-52158 0x01000000 0x00000000 0x00000000 0x01000000 0x01000000
#53row-53161 0x01000000 0x01000000 0x01000000 0x01000000 0x00000000
#54row-54164 0x02000000 0x00000000 0x00000000 0x02000000 0x02000000
#55row-55167 0x02000000 0x02000000 0x02000000 0x02000000 0x00000000
#56row-56170 0x04000000 0x00000000 0x00000000 0x04000000 0x04000000
#57row-57173 0x04000000 0x04000000 0x04000000 0x04000000 0x00000000
#58row-58176 0x08000000 0x00000000 0x00000000 0x08000000 0x08000000
#59row-59179 0x08000000 0x08000000 0x08000000 0x08000000 0x00000000
#60row-60182 0x10000000 0x00000000 0x00000000 0x10000000 0x10000000
#61row-61185 0x10000000 0x10000000 0x10000000 0x10000000 0x00000000
#62row-62188 0x20000000 0x00000000 0x00000000 0x20000000 0x20000000
#63row-63191 0x20000000 0x20000000 0x20000000 0x20000000 0x00000000
#64row-64194 0x40000000 0x00000000 0x00000000 0x40000000 0x40000000
#65row-65197 0x40000000 0x40000000 0x40000000 0x40000000 0x00000000
#66row-66200 0x80000000 0x00000000 0x00000000 0x80000000 0x80000000
#67row-67203 0x80000000 0x80000000 0x80000000 0x80000000 0x00000000
#68row-68206 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 0b10ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX 0bX0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0 0b1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open Logic32

Tests

Logic32Test checks all three outputs and selected four-state cases against both implementations.

4.3.3.3. Shifter32

IO pins

Pin Direction Width Description
A Input 32 Word being shifted
B Input 32 Shift amount is only B[4:0]
LEFT Input 1 1: left; 0: right
ARITHMETIC Input 1 Sign-fill for right shifts; ignored for left shifts
OUT Output 32 Shifted word

Behavior

Shift distance is 0–31. Left shifts and logical right shifts fill with zero; arithmetic right shifts fill with the original sign bit. A distance of zero preserves the word. There is no shifted-out carry output.

C++ example

namespace alu32_example {
uint32_t shift(uint32_t a, uint32_t b, bool left, bool arithmetic) {
    const unsigned n = b & 31;
    if (left) return a << n;
    uint32_t out = a >> n;
    if (n && arithmetic && (a & 0x80000000U)) out |= ~uint32_t{0} << (32 - n);
    return out;
}
}

Unknown inputs and timing

B[31:5] are unused, even when unknown. The remaining bits follow the gate-based mux network; an unknown selector does not necessarily preserve equal one-valued mux inputs. Left shifting disables sign fill. The structural path includes five selectable shift stages.

Implementation

Structural implementation

A shared right-shift network selects distances 1, 2, 4, 8, and 16. Input/output reversal muxes reuse it for left shifts. Fill is A[31] AND ARITHMETIC AND NOT LEFT.

Behavioral implementation

Shifter32Behavioral reproduces the reversal, each mux stage, and fill logic using four-state values. Catalog construction gives it gate-derived output delays, with a delay twin where supported to time the current shift and data.

Examples

All 447 recorded rows of Shifter32Test, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (62729ffe071d2eb3). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units AInput · 32 bit ARITHMETICInput · 1 bit BInput · 32 bit LEFTInput · 1 bit OUTExpected output · 32 bit
#0row-015 0x80000001 0 0x00000000 1 0x80000001
#1row-131 0x80000001 0 0x00000000 0 0x80000001
#2row-235 0x80000001 1 0x00000000 0 0x80000001
#3row-351 0x7FFFFFFF 0 0x00000000 1 0x7FFFFFFF
#4row-467 0x7FFFFFFF 0 0x00000000 0 0x7FFFFFFF
#5row-569 0x7FFFFFFF 1 0x00000000 0 0x7FFFFFFF
#6row-684 0xFFFFFFFF 0 0x00000000 1 0xFFFFFFFF
#7row-7100 0xFFFFFFFF 0 0x00000000 0 0xFFFFFFFF
#8row-8104 0xFFFFFFFF 1 0x00000000 0 0xFFFFFFFF
#9row-9120 0x00000001 0 0x00000000 1 0x00000001
#10row-10136 0x00000001 0 0x00000000 0 0x00000001
#11row-11138 0x00000001 1 0x00000000 0 0x00000001
#12row-12153 0x80000001 0 0x00000001 1 0x00000002
#13row-13169 0x80000001 0 0x00000001 0 0x40000000
#14row-14184 0x80000001 1 0x00000001 0 0xC0000000
#15row-15200 0x7FFFFFFF 0 0x00000001 1 0xFFFFFFFE
#16row-16216 0x7FFFFFFF 0 0x00000001 0 0x3FFFFFFF
#17row-17218 0x7FFFFFFF 1 0x00000001 0 0x3FFFFFFF
#18row-18233 0xFFFFFFFF 0 0x00000001 1 0xFFFFFFFE
#19row-19249 0xFFFFFFFF 0 0x00000001 0 0x7FFFFFFF
#20row-20264 0xFFFFFFFF 1 0x00000001 0 0xFFFFFFFF
#21row-21280 0x00000001 0 0x00000001 1 0x00000002
#22row-22295 0x00000001 0 0x00000001 0 0x00000000
#23row-23297 0x00000001 1 0x00000001 0 0x00000000
#24row-24312 0x80000001 0 0x00000002 1 0x00000004
#25row-25328 0x80000001 0 0x00000002 0 0x20000000
#26row-26341 0x80000001 1 0x00000002 0 0xE0000000
#27row-27357 0x7FFFFFFF 0 0x00000002 1 0xFFFFFFFC
#28row-28373 0x7FFFFFFF 0 0x00000002 0 0x1FFFFFFF
#29row-29375 0x7FFFFFFF 1 0x00000002 0 0x1FFFFFFF
#30row-30390 0xFFFFFFFF 0 0x00000002 1 0xFFFFFFFC
#31row-31406 0xFFFFFFFF 0 0x00000002 0 0x3FFFFFFF
#32row-32419 0xFFFFFFFF 1 0x00000002 0 0xFFFFFFFF
#33row-33435 0x00000001 0 0x00000002 1 0x00000004
#34row-34450 0x00000001 0 0x00000002 0 0x00000000
#35row-35452 0x00000001 1 0x00000002 0 0x00000000
#36row-36467 0x80000001 0 0x00000003 1 0x00000008
#37row-37483 0x80000001 0 0x00000003 0 0x10000000
#38row-38498 0x80000001 1 0x00000003 0 0xF0000000
#39row-39514 0x7FFFFFFF 0 0x00000003 1 0xFFFFFFF8
#40row-40530 0x7FFFFFFF 0 0x00000003 0 0x0FFFFFFF
#41row-41532 0x7FFFFFFF 1 0x00000003 0 0x0FFFFFFF
#42row-42547 0xFFFFFFFF 0 0x00000003 1 0xFFFFFFF8
#43row-43563 0xFFFFFFFF 0 0x00000003 0 0x1FFFFFFF
#44row-44578 0xFFFFFFFF 1 0x00000003 0 0xFFFFFFFF
#45row-45594 0x00000001 0 0x00000003 1 0x00000008
#46row-46609 0x00000001 0 0x00000003 0 0x00000000
#47row-47611 0x00000001 1 0x00000003 0 0x00000000
#48row-48626 0x80000001 0 0x00000004 1 0x00000010
#49row-49642 0x80000001 0 0x00000004 0 0x08000000
#50row-50653 0x80000001 1 0x00000004 0 0xF8000000
#51row-51669 0x7FFFFFFF 0 0x00000004 1 0xFFFFFFF0
#52row-52685 0x7FFFFFFF 0 0x00000004 0 0x07FFFFFF
#53row-53687 0x7FFFFFFF 1 0x00000004 0 0x07FFFFFF
#54row-54702 0xFFFFFFFF 0 0x00000004 1 0xFFFFFFF0
#55row-55718 0xFFFFFFFF 0 0x00000004 0 0x0FFFFFFF
#56row-56729 0xFFFFFFFF 1 0x00000004 0 0xFFFFFFFF
#57row-57745 0x00000001 0 0x00000004 1 0x00000010
#58row-58760 0x00000001 0 0x00000004 0 0x00000000
#59row-59762 0x00000001 1 0x00000004 0 0x00000000
#60row-60777 0x80000001 0 0x00000005 1 0x00000020
#61row-61793 0x80000001 0 0x00000005 0 0x04000000
#62row-62808 0x80000001 1 0x00000005 0 0xFC000000
#63row-63824 0x7FFFFFFF 0 0x00000005 1 0xFFFFFFE0
#64row-64840 0x7FFFFFFF 0 0x00000005 0 0x03FFFFFF
#65row-65842 0x7FFFFFFF 1 0x00000005 0 0x03FFFFFF
#66row-66857 0xFFFFFFFF 0 0x00000005 1 0xFFFFFFE0
#67row-67873 0xFFFFFFFF 0 0x00000005 0 0x07FFFFFF
#68row-68888 0xFFFFFFFF 1 0x00000005 0 0xFFFFFFFF
#69row-69904 0x00000001 0 0x00000005 1 0x00000020
#70row-70919 0x00000001 0 0x00000005 0 0x00000000
#71row-71921 0x00000001 1 0x00000005 0 0x00000000
#72row-72936 0x80000001 0 0x00000006 1 0x00000040
#73row-73952 0x80000001 0 0x00000006 0 0x02000000
#74row-74965 0x80000001 1 0x00000006 0 0xFE000000
#75row-75981 0x7FFFFFFF 0 0x00000006 1 0xFFFFFFC0
#76row-76997 0x7FFFFFFF 0 0x00000006 0 0x01FFFFFF
#77row-77999 0x7FFFFFFF 1 0x00000006 0 0x01FFFFFF
#78row-781014 0xFFFFFFFF 0 0x00000006 1 0xFFFFFFC0
#79row-791030 0xFFFFFFFF 0 0x00000006 0 0x03FFFFFF
#80row-801043 0xFFFFFFFF 1 0x00000006 0 0xFFFFFFFF
#81row-811059 0x00000001 0 0x00000006 1 0x00000040
#82row-821074 0x00000001 0 0x00000006 0 0x00000000
#83row-831076 0x00000001 1 0x00000006 0 0x00000000
#84row-841091 0x80000001 0 0x00000007 1 0x00000080
#85row-851107 0x80000001 0 0x00000007 0 0x01000000
#86row-861122 0x80000001 1 0x00000007 0 0xFF000000
#87row-871138 0x7FFFFFFF 0 0x00000007 1 0xFFFFFF80
#88row-881154 0x7FFFFFFF 0 0x00000007 0 0x00FFFFFF
#89row-891156 0x7FFFFFFF 1 0x00000007 0 0x00FFFFFF
#90row-901171 0xFFFFFFFF 0 0x00000007 1 0xFFFFFF80
#91row-911187 0xFFFFFFFF 0 0x00000007 0 0x01FFFFFF
#92row-921202 0xFFFFFFFF 1 0x00000007 0 0xFFFFFFFF
#93row-931218 0x00000001 0 0x00000007 1 0x00000080
#94row-941233 0x00000001 0 0x00000007 0 0x00000000
#95row-951235 0x00000001 1 0x00000007 0 0x00000000
#96row-961250 0x80000001 0 0x00000008 1 0x00000100
#97row-971266 0x80000001 0 0x00000008 0 0x00800000
#98row-981275 0x80000001 1 0x00000008 0 0xFF800000
#99row-991291 0x7FFFFFFF 0 0x00000008 1 0xFFFFFF00
#100row-1001307 0x7FFFFFFF 0 0x00000008 0 0x007FFFFF
#101row-1011309 0x7FFFFFFF 1 0x00000008 0 0x007FFFFF
#102row-1021324 0xFFFFFFFF 0 0x00000008 1 0xFFFFFF00
#103row-1031340 0xFFFFFFFF 0 0x00000008 0 0x00FFFFFF
#104row-1041349 0xFFFFFFFF 1 0x00000008 0 0xFFFFFFFF
#105row-1051365 0x00000001 0 0x00000008 1 0x00000100
#106row-1061380 0x00000001 0 0x00000008 0 0x00000000
#107row-1071382 0x00000001 1 0x00000008 0 0x00000000
#108row-1081397 0x80000001 0 0x00000009 1 0x00000200
#109row-1091413 0x80000001 0 0x00000009 0 0x00400000
#110row-1101428 0x80000001 1 0x00000009 0 0xFFC00000
#111row-1111444 0x7FFFFFFF 0 0x00000009 1 0xFFFFFE00
#112row-1121460 0x7FFFFFFF 0 0x00000009 0 0x003FFFFF
#113row-1131462 0x7FFFFFFF 1 0x00000009 0 0x003FFFFF
#114row-1141477 0xFFFFFFFF 0 0x00000009 1 0xFFFFFE00
#115row-1151493 0xFFFFFFFF 0 0x00000009 0 0x007FFFFF
#116row-1161508 0xFFFFFFFF 1 0x00000009 0 0xFFFFFFFF
#117row-1171524 0x00000001 0 0x00000009 1 0x00000200
#118row-1181539 0x00000001 0 0x00000009 0 0x00000000
#119row-1191541 0x00000001 1 0x00000009 0 0x00000000
#120row-1201556 0x80000001 0 0x0000000A 1 0x00000400
#121row-1211572 0x80000001 0 0x0000000A 0 0x00200000
#122row-1221585 0x80000001 1 0x0000000A 0 0xFFE00000
#123row-1231601 0x7FFFFFFF 0 0x0000000A 1 0xFFFFFC00
#124row-1241617 0x7FFFFFFF 0 0x0000000A 0 0x001FFFFF
#125row-1251619 0x7FFFFFFF 1 0x0000000A 0 0x001FFFFF
#126row-1261634 0xFFFFFFFF 0 0x0000000A 1 0xFFFFFC00
#127row-1271650 0xFFFFFFFF 0 0x0000000A 0 0x003FFFFF
#128row-1281663 0xFFFFFFFF 1 0x0000000A 0 0xFFFFFFFF
#129row-1291679 0x00000001 0 0x0000000A 1 0x00000400
#130row-1301694 0x00000001 0 0x0000000A 0 0x00000000
#131row-1311696 0x00000001 1 0x0000000A 0 0x00000000
#132row-1321711 0x80000001 0 0x0000000B 1 0x00000800
#133row-1331727 0x80000001 0 0x0000000B 0 0x00100000
#134row-1341742 0x80000001 1 0x0000000B 0 0xFFF00000
#135row-1351758 0x7FFFFFFF 0 0x0000000B 1 0xFFFFF800
#136row-1361774 0x7FFFFFFF 0 0x0000000B 0 0x000FFFFF
#137row-1371776 0x7FFFFFFF 1 0x0000000B 0 0x000FFFFF
#138row-1381791 0xFFFFFFFF 0 0x0000000B 1 0xFFFFF800
#139row-1391807 0xFFFFFFFF 0 0x0000000B 0 0x001FFFFF
#140row-1401822 0xFFFFFFFF 1 0x0000000B 0 0xFFFFFFFF
#141row-1411838 0x00000001 0 0x0000000B 1 0x00000800
#142row-1421853 0x00000001 0 0x0000000B 0 0x00000000
#143row-1431855 0x00000001 1 0x0000000B 0 0x00000000
#144row-1441870 0x80000001 0 0x0000000C 1 0x00001000
#145row-1451886 0x80000001 0 0x0000000C 0 0x00080000
#146row-1461897 0x80000001 1 0x0000000C 0 0xFFF80000
#147row-1471913 0x7FFFFFFF 0 0x0000000C 1 0xFFFFF000
#148row-1481929 0x7FFFFFFF 0 0x0000000C 0 0x0007FFFF
#149row-1491931 0x7FFFFFFF 1 0x0000000C 0 0x0007FFFF
#150row-1501946 0xFFFFFFFF 0 0x0000000C 1 0xFFFFF000
#151row-1511962 0xFFFFFFFF 0 0x0000000C 0 0x000FFFFF
#152row-1521973 0xFFFFFFFF 1 0x0000000C 0 0xFFFFFFFF
#153row-1531989 0x00000001 0 0x0000000C 1 0x00001000
#154row-1542004 0x00000001 0 0x0000000C 0 0x00000000
#155row-1552006 0x00000001 1 0x0000000C 0 0x00000000
#156row-1562021 0x80000001 0 0x0000000D 1 0x00002000
#157row-1572037 0x80000001 0 0x0000000D 0 0x00040000
#158row-1582052 0x80000001 1 0x0000000D 0 0xFFFC0000
#159row-1592068 0x7FFFFFFF 0 0x0000000D 1 0xFFFFE000
#160row-1602084 0x7FFFFFFF 0 0x0000000D 0 0x0003FFFF
#161row-1612086 0x7FFFFFFF 1 0x0000000D 0 0x0003FFFF
#162row-1622101 0xFFFFFFFF 0 0x0000000D 1 0xFFFFE000
#163row-1632117 0xFFFFFFFF 0 0x0000000D 0 0x0007FFFF
#164row-1642132 0xFFFFFFFF 1 0x0000000D 0 0xFFFFFFFF
#165row-1652148 0x00000001 0 0x0000000D 1 0x00002000
#166row-1662163 0x00000001 0 0x0000000D 0 0x00000000
#167row-1672165 0x00000001 1 0x0000000D 0 0x00000000
#168row-1682180 0x80000001 0 0x0000000E 1 0x00004000
#169row-1692196 0x80000001 0 0x0000000E 0 0x00020000
#170row-1702209 0x80000001 1 0x0000000E 0 0xFFFE0000
#171row-1712225 0x7FFFFFFF 0 0x0000000E 1 0xFFFFC000
#172row-1722241 0x7FFFFFFF 0 0x0000000E 0 0x0001FFFF
#173row-1732243 0x7FFFFFFF 1 0x0000000E 0 0x0001FFFF
#174row-1742258 0xFFFFFFFF 0 0x0000000E 1 0xFFFFC000
#175row-1752274 0xFFFFFFFF 0 0x0000000E 0 0x0003FFFF
#176row-1762287 0xFFFFFFFF 1 0x0000000E 0 0xFFFFFFFF
#177row-1772303 0x00000001 0 0x0000000E 1 0x00004000
#178row-1782318 0x00000001 0 0x0000000E 0 0x00000000
#179row-1792320 0x00000001 1 0x0000000E 0 0x00000000
#180row-1802335 0x80000001 0 0x0000000F 1 0x00008000
#181row-1812351 0x80000001 0 0x0000000F 0 0x00010000
#182row-1822366 0x80000001 1 0x0000000F 0 0xFFFF0000
#183row-1832382 0x7FFFFFFF 0 0x0000000F 1 0xFFFF8000
#184row-1842398 0x7FFFFFFF 0 0x0000000F 0 0x0000FFFF
#185row-1852400 0x7FFFFFFF 1 0x0000000F 0 0x0000FFFF
#186row-1862415 0xFFFFFFFF 0 0x0000000F 1 0xFFFF8000
#187row-1872431 0xFFFFFFFF 0 0x0000000F 0 0x0001FFFF
#188row-1882446 0xFFFFFFFF 1 0x0000000F 0 0xFFFFFFFF
#189row-1892462 0x00000001 0 0x0000000F 1 0x00008000
#190row-1902477 0x00000001 0 0x0000000F 0 0x00000000
#191row-1912479 0x00000001 1 0x0000000F 0 0x00000000
#192row-1922494 0x80000001 0 0x00000010 1 0x00010000
#193row-1932510 0x80000001 0 0x00000010 0 0x00008000
#194row-1942517 0x80000001 1 0x00000010 0 0xFFFF8000
#195row-1952533 0x7FFFFFFF 0 0x00000010 1 0xFFFF0000
#196row-1962549 0x7FFFFFFF 0 0x00000010 0 0x00007FFF
#197row-1972551 0x7FFFFFFF 1 0x00000010 0 0x00007FFF
#198row-1982566 0xFFFFFFFF 0 0x00000010 1 0xFFFF0000
#199row-1992582 0xFFFFFFFF 0 0x00000010 0 0x0000FFFF
#200row-2002589 0xFFFFFFFF 1 0x00000010 0 0xFFFFFFFF
#201row-2012605 0x00000001 0 0x00000010 1 0x00010000
#202row-2022620 0x00000001 0 0x00000010 0 0x00000000
#203row-2032622 0x00000001 1 0x00000010 0 0x00000000
#204row-2042637 0x80000001 0 0x00000011 1 0x00020000
#205row-2052653 0x80000001 0 0x00000011 0 0x00004000
#206row-2062668 0x80000001 1 0x00000011 0 0xFFFFC000
#207row-2072684 0x7FFFFFFF 0 0x00000011 1 0xFFFE0000
#208row-2082700 0x7FFFFFFF 0 0x00000011 0 0x00003FFF
#209row-2092702 0x7FFFFFFF 1 0x00000011 0 0x00003FFF
#210row-2102717 0xFFFFFFFF 0 0x00000011 1 0xFFFE0000
#211row-2112733 0xFFFFFFFF 0 0x00000011 0 0x00007FFF
#212row-2122748 0xFFFFFFFF 1 0x00000011 0 0xFFFFFFFF
#213row-2132764 0x00000001 0 0x00000011 1 0x00020000
#214row-2142779 0x00000001 0 0x00000011 0 0x00000000
#215row-2152781 0x00000001 1 0x00000011 0 0x00000000
#216row-2162796 0x80000001 0 0x00000012 1 0x00040000
#217row-2172812 0x80000001 0 0x00000012 0 0x00002000
#218row-2182825 0x80000001 1 0x00000012 0 0xFFFFE000
#219row-2192841 0x7FFFFFFF 0 0x00000012 1 0xFFFC0000
#220row-2202857 0x7FFFFFFF 0 0x00000012 0 0x00001FFF
#221row-2212859 0x7FFFFFFF 1 0x00000012 0 0x00001FFF
#222row-2222874 0xFFFFFFFF 0 0x00000012 1 0xFFFC0000
#223row-2232890 0xFFFFFFFF 0 0x00000012 0 0x00003FFF
#224row-2242903 0xFFFFFFFF 1 0x00000012 0 0xFFFFFFFF
#225row-2252919 0x00000001 0 0x00000012 1 0x00040000
#226row-2262934 0x00000001 0 0x00000012 0 0x00000000
#227row-2272936 0x00000001 1 0x00000012 0 0x00000000
#228row-2282951 0x80000001 0 0x00000013 1 0x00080000
#229row-2292967 0x80000001 0 0x00000013 0 0x00001000
#230row-2302982 0x80000001 1 0x00000013 0 0xFFFFF000
#231row-2312998 0x7FFFFFFF 0 0x00000013 1 0xFFF80000
#232row-2323014 0x7FFFFFFF 0 0x00000013 0 0x00000FFF
#233row-2333016 0x7FFFFFFF 1 0x00000013 0 0x00000FFF
#234row-2343031 0xFFFFFFFF 0 0x00000013 1 0xFFF80000
#235row-2353047 0xFFFFFFFF 0 0x00000013 0 0x00001FFF
#236row-2363062 0xFFFFFFFF 1 0x00000013 0 0xFFFFFFFF
#237row-2373078 0x00000001 0 0x00000013 1 0x00080000
#238row-2383093 0x00000001 0 0x00000013 0 0x00000000
#239row-2393095 0x00000001 1 0x00000013 0 0x00000000
#240row-2403110 0x80000001 0 0x00000014 1 0x00100000
#241row-2413126 0x80000001 0 0x00000014 0 0x00000800
#242row-2423137 0x80000001 1 0x00000014 0 0xFFFFF800
#243row-2433153 0x7FFFFFFF 0 0x00000014 1 0xFFF00000
#244row-2443169 0x7FFFFFFF 0 0x00000014 0 0x000007FF
#245row-2453171 0x7FFFFFFF 1 0x00000014 0 0x000007FF
#246row-2463186 0xFFFFFFFF 0 0x00000014 1 0xFFF00000
#247row-2473202 0xFFFFFFFF 0 0x00000014 0 0x00000FFF
#248row-2483213 0xFFFFFFFF 1 0x00000014 0 0xFFFFFFFF
#249row-2493229 0x00000001 0 0x00000014 1 0x00100000
#250row-2503244 0x00000001 0 0x00000014 0 0x00000000
#251row-2513246 0x00000001 1 0x00000014 0 0x00000000
#252row-2523261 0x80000001 0 0x00000015 1 0x00200000
#253row-2533277 0x80000001 0 0x00000015 0 0x00000400
#254row-2543292 0x80000001 1 0x00000015 0 0xFFFFFC00
#255row-2553308 0x7FFFFFFF 0 0x00000015 1 0xFFE00000
#256row-2563324 0x7FFFFFFF 0 0x00000015 0 0x000003FF
#257row-2573326 0x7FFFFFFF 1 0x00000015 0 0x000003FF
#258row-2583341 0xFFFFFFFF 0 0x00000015 1 0xFFE00000
#259row-2593357 0xFFFFFFFF 0 0x00000015 0 0x000007FF
#260row-2603372 0xFFFFFFFF 1 0x00000015 0 0xFFFFFFFF
#261row-2613388 0x00000001 0 0x00000015 1 0x00200000
#262row-2623403 0x00000001 0 0x00000015 0 0x00000000
#263row-2633405 0x00000001 1 0x00000015 0 0x00000000
#264row-2643420 0x80000001 0 0x00000016 1 0x00400000
#265row-2653436 0x80000001 0 0x00000016 0 0x00000200
#266row-2663449 0x80000001 1 0x00000016 0 0xFFFFFE00
#267row-2673465 0x7FFFFFFF 0 0x00000016 1 0xFFC00000
#268row-2683481 0x7FFFFFFF 0 0x00000016 0 0x000001FF
#269row-2693483 0x7FFFFFFF 1 0x00000016 0 0x000001FF
#270row-2703498 0xFFFFFFFF 0 0x00000016 1 0xFFC00000
#271row-2713514 0xFFFFFFFF 0 0x00000016 0 0x000003FF
#272row-2723527 0xFFFFFFFF 1 0x00000016 0 0xFFFFFFFF
#273row-2733543 0x00000001 0 0x00000016 1 0x00400000
#274row-2743558 0x00000001 0 0x00000016 0 0x00000000
#275row-2753560 0x00000001 1 0x00000016 0 0x00000000
#276row-2763575 0x80000001 0 0x00000017 1 0x00800000
#277row-2773591 0x80000001 0 0x00000017 0 0x00000100
#278row-2783606 0x80000001 1 0x00000017 0 0xFFFFFF00
#279row-2793622 0x7FFFFFFF 0 0x00000017 1 0xFF800000
#280row-2803638 0x7FFFFFFF 0 0x00000017 0 0x000000FF
#281row-2813640 0x7FFFFFFF 1 0x00000017 0 0x000000FF
#282row-2823655 0xFFFFFFFF 0 0x00000017 1 0xFF800000
#283row-2833671 0xFFFFFFFF 0 0x00000017 0 0x000001FF
#284row-2843686 0xFFFFFFFF 1 0x00000017 0 0xFFFFFFFF
#285row-2853702 0x00000001 0 0x00000017 1 0x00800000
#286row-2863717 0x00000001 0 0x00000017 0 0x00000000
#287row-2873719 0x00000001 1 0x00000017 0 0x00000000
#288row-2883734 0x80000001 0 0x00000018 1 0x01000000
#289row-2893750 0x80000001 0 0x00000018 0 0x00000080
#290row-2903759 0x80000001 1 0x00000018 0 0xFFFFFF80
#291row-2913775 0x7FFFFFFF 0 0x00000018 1 0xFF000000
#292row-2923791 0x7FFFFFFF 0 0x00000018 0 0x0000007F
#293row-2933793 0x7FFFFFFF 1 0x00000018 0 0x0000007F
#294row-2943808 0xFFFFFFFF 0 0x00000018 1 0xFF000000
#295row-2953824 0xFFFFFFFF 0 0x00000018 0 0x000000FF
#296row-2963833 0xFFFFFFFF 1 0x00000018 0 0xFFFFFFFF
#297row-2973849 0x00000001 0 0x00000018 1 0x01000000
#298row-2983864 0x00000001 0 0x00000018 0 0x00000000
#299row-2993866 0x00000001 1 0x00000018 0 0x00000000
#300row-3003881 0x80000001 0 0x00000019 1 0x02000000
#301row-3013897 0x80000001 0 0x00000019 0 0x00000040
#302row-3023912 0x80000001 1 0x00000019 0 0xFFFFFFC0
#303row-3033928 0x7FFFFFFF 0 0x00000019 1 0xFE000000
#304row-3043944 0x7FFFFFFF 0 0x00000019 0 0x0000003F
#305row-3053946 0x7FFFFFFF 1 0x00000019 0 0x0000003F
#306row-3063961 0xFFFFFFFF 0 0x00000019 1 0xFE000000
#307row-3073977 0xFFFFFFFF 0 0x00000019 0 0x0000007F
#308row-3083992 0xFFFFFFFF 1 0x00000019 0 0xFFFFFFFF
#309row-3094008 0x00000001 0 0x00000019 1 0x02000000
#310row-3104023 0x00000001 0 0x00000019 0 0x00000000
#311row-3114025 0x00000001 1 0x00000019 0 0x00000000
#312row-3124040 0x80000001 0 0x0000001A 1 0x04000000
#313row-3134056 0x80000001 0 0x0000001A 0 0x00000020
#314row-3144069 0x80000001 1 0x0000001A 0 0xFFFFFFE0
#315row-3154085 0x7FFFFFFF 0 0x0000001A 1 0xFC000000
#316row-3164101 0x7FFFFFFF 0 0x0000001A 0 0x0000001F
#317row-3174103 0x7FFFFFFF 1 0x0000001A 0 0x0000001F
#318row-3184118 0xFFFFFFFF 0 0x0000001A 1 0xFC000000
#319row-3194134 0xFFFFFFFF 0 0x0000001A 0 0x0000003F
#320row-3204147 0xFFFFFFFF 1 0x0000001A 0 0xFFFFFFFF
#321row-3214163 0x00000001 0 0x0000001A 1 0x04000000
#322row-3224178 0x00000001 0 0x0000001A 0 0x00000000
#323row-3234180 0x00000001 1 0x0000001A 0 0x00000000
#324row-3244195 0x80000001 0 0x0000001B 1 0x08000000
#325row-3254211 0x80000001 0 0x0000001B 0 0x00000010
#326row-3264226 0x80000001 1 0x0000001B 0 0xFFFFFFF0
#327row-3274242 0x7FFFFFFF 0 0x0000001B 1 0xF8000000
#328row-3284258 0x7FFFFFFF 0 0x0000001B 0 0x0000000F
#329row-3294260 0x7FFFFFFF 1 0x0000001B 0 0x0000000F
#330row-3304275 0xFFFFFFFF 0 0x0000001B 1 0xF8000000
#331row-3314291 0xFFFFFFFF 0 0x0000001B 0 0x0000001F
#332row-3324306 0xFFFFFFFF 1 0x0000001B 0 0xFFFFFFFF
#333row-3334322 0x00000001 0 0x0000001B 1 0x08000000
#334row-3344337 0x00000001 0 0x0000001B 0 0x00000000
#335row-3354339 0x00000001 1 0x0000001B 0 0x00000000
#336row-3364354 0x80000001 0 0x0000001C 1 0x10000000
#337row-3374370 0x80000001 0 0x0000001C 0 0x00000008
#338row-3384381 0x80000001 1 0x0000001C 0 0xFFFFFFF8
#339row-3394397 0x7FFFFFFF 0 0x0000001C 1 0xF0000000
#340row-3404413 0x7FFFFFFF 0 0x0000001C 0 0x00000007
#341row-3414415 0x7FFFFFFF 1 0x0000001C 0 0x00000007
#342row-3424430 0xFFFFFFFF 0 0x0000001C 1 0xF0000000
#343row-3434446 0xFFFFFFFF 0 0x0000001C 0 0x0000000F
#344row-3444457 0xFFFFFFFF 1 0x0000001C 0 0xFFFFFFFF
#345row-3454473 0x00000001 0 0x0000001C 1 0x10000000
#346row-3464488 0x00000001 0 0x0000001C 0 0x00000000
#347row-3474490 0x00000001 1 0x0000001C 0 0x00000000
#348row-3484505 0x80000001 0 0x0000001D 1 0x20000000
#349row-3494521 0x80000001 0 0x0000001D 0 0x00000004
#350row-3504536 0x80000001 1 0x0000001D 0 0xFFFFFFFC
#351row-3514552 0x7FFFFFFF 0 0x0000001D 1 0xE0000000
#352row-3524568 0x7FFFFFFF 0 0x0000001D 0 0x00000003
#353row-3534570 0x7FFFFFFF 1 0x0000001D 0 0x00000003
#354row-3544585 0xFFFFFFFF 0 0x0000001D 1 0xE0000000
#355row-3554601 0xFFFFFFFF 0 0x0000001D 0 0x00000007
#356row-3564616 0xFFFFFFFF 1 0x0000001D 0 0xFFFFFFFF
#357row-3574632 0x00000001 0 0x0000001D 1 0x20000000
#358row-3584647 0x00000001 0 0x0000001D 0 0x00000000
#359row-3594649 0x00000001 1 0x0000001D 0 0x00000000
#360row-3604664 0x80000001 0 0x0000001E 1 0x40000000
#361row-3614680 0x80000001 0 0x0000001E 0 0x00000002
#362row-3624693 0x80000001 1 0x0000001E 0 0xFFFFFFFE
#363row-3634709 0x7FFFFFFF 0 0x0000001E 1 0xC0000000
#364row-3644725 0x7FFFFFFF 0 0x0000001E 0 0x00000001
#365row-3654727 0x7FFFFFFF 1 0x0000001E 0 0x00000001
#366row-3664742 0xFFFFFFFF 0 0x0000001E 1 0xC0000000
#367row-3674758 0xFFFFFFFF 0 0x0000001E 0 0x00000003
#368row-3684771 0xFFFFFFFF 1 0x0000001E 0 0xFFFFFFFF
#369row-3694787 0x00000001 0 0x0000001E 1 0x40000000
#370row-3704802 0x00000001 0 0x0000001E 0 0x00000000
#371row-3714804 0x00000001 1 0x0000001E 0 0x00000000
#372row-3724819 0x80000001 0 0x0000001F 1 0x80000000
#373row-3734835 0x80000001 0 0x0000001F 0 0x00000001
#374row-3744850 0x80000001 1 0x0000001F 0 0xFFFFFFFF
#375row-3754865 0x7FFFFFFF 0 0x0000001F 1 0x80000000
#376row-3764880 0x7FFFFFFF 0 0x0000001F 0 0x00000000
#377row-3774882 0x7FFFFFFF 1 0x0000001F 0 0x00000000
#378row-3784897 0xFFFFFFFF 0 0x0000001F 1 0x80000000
#379row-3794913 0xFFFFFFFF 0 0x0000001F 0 0x00000001
#380row-3804928 0xFFFFFFFF 1 0x0000001F 0 0xFFFFFFFF
#381row-3814943 0x00000001 0 0x0000001F 1 0x80000000
#382row-3824958 0x00000001 0 0x0000001F 0 0x00000000
#383row-3834960 0x00000001 1 0x0000001F 0 0x00000000
#384row-3844975 0x80000001 0 0x00000020 1 0x80000001
#385row-3854991 0x80000001 0 0x00000020 0 0x80000001
#386row-3864995 0x80000001 1 0x00000020 0 0x80000001
#387row-3875011 0x7FFFFFFF 0 0x00000020 1 0x7FFFFFFF
#388row-3885027 0x7FFFFFFF 0 0x00000020 0 0x7FFFFFFF
#389row-3895029 0x7FFFFFFF 1 0x00000020 0 0x7FFFFFFF
#390row-3905044 0xFFFFFFFF 0 0x00000020 1 0xFFFFFFFF
#391row-3915060 0xFFFFFFFF 0 0x00000020 0 0xFFFFFFFF
#392row-3925064 0xFFFFFFFF 1 0x00000020 0 0xFFFFFFFF
#393row-3935080 0x00000001 0 0x00000020 1 0x00000001
#394row-3945096 0x00000001 0 0x00000020 0 0x00000001
#395row-3955098 0x00000001 1 0x00000020 0 0x00000001
#396row-3965113 0x80000001 0 0x00000021 1 0x00000002
#397row-3975129 0x80000001 0 0x00000021 0 0x40000000
#398row-3985144 0x80000001 1 0x00000021 0 0xC0000000
#399row-3995160 0x7FFFFFFF 0 0x00000021 1 0xFFFFFFFE
#400row-4005176 0x7FFFFFFF 0 0x00000021 0 0x3FFFFFFF
#401row-4015178 0x7FFFFFFF 1 0x00000021 0 0x3FFFFFFF
#402row-4025193 0xFFFFFFFF 0 0x00000021 1 0xFFFFFFFE
#403row-4035209 0xFFFFFFFF 0 0x00000021 0 0x7FFFFFFF
#404row-4045224 0xFFFFFFFF 1 0x00000021 0 0xFFFFFFFF
#405row-4055240 0x00000001 0 0x00000021 1 0x00000002
#406row-4065255 0x00000001 0 0x00000021 0 0x00000000
#407row-4075257 0x00000001 1 0x00000021 0 0x00000000
#408row-4085272 0x80000001 0 0x0000003F 1 0x80000000
#409row-4095288 0x80000001 0 0x0000003F 0 0x00000001
#410row-4105303 0x80000001 1 0x0000003F 0 0xFFFFFFFF
#411row-4115318 0x7FFFFFFF 0 0x0000003F 1 0x80000000
#412row-4125333 0x7FFFFFFF 0 0x0000003F 0 0x00000000
#413row-4135335 0x7FFFFFFF 1 0x0000003F 0 0x00000000
#414row-4145350 0xFFFFFFFF 0 0x0000003F 1 0x80000000
#415row-4155366 0xFFFFFFFF 0 0x0000003F 0 0x00000001
#416row-4165381 0xFFFFFFFF 1 0x0000003F 0 0xFFFFFFFF
#417row-4175396 0x00000001 0 0x0000003F 1 0x80000000
#418row-4185411 0x00000001 0 0x0000003F 0 0x00000000
#419row-4195413 0x00000001 1 0x0000003F 0 0x00000000
#420row-4205428 0x80000001 0 0xFFFFFFFF 1 0x80000000
#421row-4215444 0x80000001 0 0xFFFFFFFF 0 0x00000001
#422row-4225459 0x80000001 1 0xFFFFFFFF 0 0xFFFFFFFF
#423row-4235474 0x7FFFFFFF 0 0xFFFFFFFF 1 0x80000000
#424row-4245489 0x7FFFFFFF 0 0xFFFFFFFF 0 0x00000000
#425row-4255491 0x7FFFFFFF 1 0xFFFFFFFF 0 0x00000000
#426row-4265506 0xFFFFFFFF 0 0xFFFFFFFF 1 0x80000000
#427row-4275522 0xFFFFFFFF 0 0xFFFFFFFF 0 0x00000001
#428row-4285537 0xFFFFFFFF 1 0xFFFFFFFF 0 0xFFFFFFFF
#429row-4295552 0x00000001 0 0xFFFFFFFF 1 0x80000000
#430row-4305567 0x00000001 0 0xFFFFFFFF 0 0x00000000
#431row-4315569 0x00000001 1 0xFFFFFFFF 0 0x00000000
#432row-4325585 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 0 0x00000000 1 0bXX10XX10XX10XX10XX10XX10XX10XX10
#433row-4335601 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 0 0x00000000 0 0bXX10XX10XX10XX10XX10XX10XX10XX10
#434row-4345605 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 1 0x00000000 0 0bXX10XX10XX10XX10XX10XX10XX10XX10
#435row-4355621 0b0ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX1 0 0x00000005 1 0bXX10XX10XX10XX10XX10XX10XX100000
#436row-4365637 0b0ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX1 0 0x00000005 0 0b000000XX10XX10XX10XX10XX10XX10XX
#437row-4375639 0b0ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX1 1 0x00000005 0 0b000000XX10XX10XX10XX10XX10XX10XX
#438row-4385655 0bX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10Z 0 0x0000001F 1 0bX0000000000000000000000000000000
#439row-4395671 0bX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10Z 0 0x0000001F 0 0b0000000000000000000000000000000X
#440row-4405686 0bX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10Z 1 0x0000001F 0 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#441row-4415702 0x00000000 0 0b00000000000000000000000000000X00 1 0x00000000
#442row-4425705 0x00000000 0 0b00000000000000000000000000000X00 0 0x00000000
#443row-4435707 0x00000000 1 0b00000000000000000000000000000X00 0 0x00000000
#444row-4445710 0x00000000 0 0b00000000000000000000000000000Z00 1 0x00000000
#445row-4455713 0x00000000 0 0b00000000000000000000000000000Z00 0 0x00000000
#446row-4465715 0x00000000 1 0b00000000000000000000000000000Z00 0 0x00000000

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open Shifter32

Tests

Shifter32Test exercises directions, sign fill, distances, ignored upper amount bits, and selected four-state inputs.

4.3.3.4. ALU32ControlDecoder

IO pins

Pin Direction Width Description
OP Input 5 Complete opcode
LOCAL_OP Output 3 OP[2:0]
HIGH_HALF, OUT_OF_RANGE Output 1 each OP[3], OP[4]
ARITHMETIC_ENABLE Output 1 Qualifies carry and overflow
SUB Output 1 Requests subtraction and enables comparisons
SHIFT_LEFT, SHIFT_ARITHMETIC Output 1 each Shifter controls

Behavior

Arithmetic flags are enabled for 0, 1, 8, 9; subtraction for 1, 8, 9. Shift controls are raw Boolean functions, not shift-operation enable flags. They can be high when another result source is selected. OUT_OF_RANGE only detects 16–31; selectors also map reserved 13–15 to zero.

C++ example

namespace alu32_example {
struct Control {
    unsigned LOCAL_OP;
    bool HIGH_HALF, OUT_OF_RANGE, ARITHMETIC_ENABLE, SUB, SHIFT_LEFT, SHIFT_ARITHMETIC;
};
Control control(unsigned op) { // OP is a five-bit input.
    const bool arithmetic = !(op & 16) && !(op & 4) && !(op & 2);
    return {op & 7, bool(op & 8), bool(op & 16), arithmetic,
            arithmetic && bool(op & 9), !(op & 2), bool(op & 1)};
}
}

Unknown inputs and timing

Rewired selector bits preserve X/Z; logic-derived controls follow their gates. Outputs are combinational and need time to settle.

Implementation

Structural implementation

A splitter and selector joiner expose opcode bits; NOT/AND/OR gates derive the enables. No behavioral implementation is registered for this helper.

Examples

All 32 recorded rows of ALU32ControlDecoderTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (438e8bc4f19a50b2). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units OPInput · 5 bit ARITHMETIC_ENABLEExpected output · 1 bit HIGH_HALFExpected output · 1 bit LOCAL_OPExpected output · 3 bit OUT_OF_RANGEExpected output · 1 bit SHIFT_ARITHMETICExpected output · 1 bit SHIFT_LEFTExpected output · 1 bit SUBExpected output · 1 bit
#0row-05 0x00 1 0 0x0 0 0 1 0
#1row-19 0x01 1 0 0x1 0 1 1 1
#2row-214 0x02 0 0 0x2 0 0 0 0
#3row-318 0x03 0 0 0x3 0 1 0 0
#4row-424 0x04 0 0 0x4 0 0 1 0
#5row-528 0x05 0 0 0x5 0 1 1 0
#6row-632 0x06 0 0 0x6 0 0 0 0
#7row-736 0x07 0 0 0x7 0 1 0 0
#8row-842 0x08 1 1 0x0 0 0 1 1
#9row-945 0x09 1 1 0x1 0 1 1 1
#10row-1050 0x0A 0 1 0x2 0 0 0 0
#11row-1153 0x0B 0 1 0x3 0 1 0 0
#12row-1259 0x0C 0 1 0x4 0 0 1 0
#13row-1362 0x0D 0 1 0x5 0 1 1 0
#14row-1466 0x0E 0 1 0x6 0 0 0 0
#15row-1569 0x0F 0 1 0x7 0 1 0 0
#16row-1673 0x10 0 0 0x0 1 0 1 0
#17row-1777 0x11 0 0 0x1 1 1 1 0
#18row-1881 0x12 0 0 0x2 1 0 0 0
#19row-1985 0x13 0 0 0x3 1 1 0 0
#20row-2089 0x14 0 0 0x4 1 0 1 0
#21row-2193 0x15 0 0 0x5 1 1 1 0
#22row-2297 0x16 0 0 0x6 1 0 0 0
#23row-23101 0x17 0 0 0x7 1 1 0 0
#24row-24105 0x18 0 1 0x0 1 0 1 0
#25row-25108 0x19 0 1 0x1 1 1 1 0
#26row-26112 0x1A 0 1 0x2 1 0 0 0
#27row-27115 0x1B 0 1 0x3 1 1 0 0
#28row-28119 0x1C 0 1 0x4 1 0 1 0
#29row-29122 0x1D 0 1 0x5 1 1 1 0
#30row-30126 0x1E 0 1 0x6 1 0 0 0
#31row-31129 0x1F 0 1 0x7 1 1 0 0

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open ALU32ControlDecoder

Tests

ALU32ControlDecoderTest covers every binary opcode and every output control.

4.3.3.5. ALU32CompareUnit

IO pins

Pin Direction Width Description
DIFF Input 32 A - B from the shared subtractor
CARRY_IN, OVERFLOW_IN Input 1 each Subtraction no-borrow and signed overflow
ENABLE Input 1 Enable comparisons
EQ, LT_SIGNED, LT_UNSIGNED Output 1 each Comparison flags
SLT_RESULT, SLTU_RESULT Output 32 each Corresponding less-than flag in bit 0; bits 31:1 zero

Behavior

This helper consumes an existing subtraction; it is not an independent two-operand comparator. Signed comparison corrects the difference sign using overflow. All comparisons are zero when disabled. The 32-bit outputs are ALU result words, not 32-bit flags.

C++ example

namespace alu32_example {
struct Compare { bool EQ, LT_SIGNED, LT_UNSIGNED; uint32_t SLT_RESULT, SLTU_RESULT; };
Compare compare(uint32_t diff, bool carry, bool overflow, bool enable) {
    const bool s = enable && (bool(diff >> 31) != overflow);
    const bool u = enable && !carry;
    return {enable && diff == 0, s, u, uint32_t(s), uint32_t(u)};
}
}

Unknown inputs and timing

Disabled AND outputs mask unknown arithmetic inputs. Enabled flags use four-state zero-detection, XOR, and inversion. Upper Boolean-result bits remain constant zero.

Implementation

Structural implementation

ZeroDetect32 forms equality; a sign splitter, XOR, NOT, and AND gates form less-than flags. Joiners extend those flags to words. No behavioral implementation is registered for this helper.

Examples

All 34 recorded rows of ALU32CompareUnitTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (c569123cf5f46ffc). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units CARRY_INInput · 1 bit DIFFInput · 32 bit ENABLEInput · 1 bit OVERFLOW_INInput · 1 bit EQExpected output · 1 bit LT_SIGNEDExpected output · 1 bit LT_UNSIGNEDExpected output · 1 bit SLTU_RESULTExpected output · 32 bit SLT_RESULTExpected output · 32 bit
#0row-08 0 0x00000000 0 0 0 0 0 0x00000000 0x00000000
#1row-117 0 0x00000001 0 0 0 0 0 0x00000000 0x00000000
#2row-224 0 0x80000000 0 0 0 0 0 0x00000000 0x00000000
#3row-331 0 0xFFFFFFFF 0 0 0 0 0 0x00000000 0x00000000
#4row-440 0 0x00000000 1 0 1 0 1 0x00000001 0x00000000
#5row-549 0 0x00000001 1 0 0 0 1 0x00000001 0x00000000
#6row-656 0 0x80000000 1 0 0 1 1 0x00000001 0x00000001
#7row-763 0 0xFFFFFFFF 1 0 0 1 1 0x00000001 0x00000001
#8row-872 1 0x00000000 0 0 0 0 0 0x00000000 0x00000000
#9row-981 1 0x00000001 0 0 0 0 0 0x00000000 0x00000000
#10row-1088 1 0x80000000 0 0 0 0 0 0x00000000 0x00000000
#11row-1195 1 0xFFFFFFFF 0 0 0 0 0 0x00000000 0x00000000
#12row-12104 1 0x00000000 1 0 1 0 0 0x00000000 0x00000000
#13row-13113 1 0x00000001 1 0 0 0 0 0x00000000 0x00000000
#14row-14120 1 0x80000000 1 0 0 1 0 0x00000000 0x00000001
#15row-15127 1 0xFFFFFFFF 1 0 0 1 0 0x00000000 0x00000001
#16row-16136 0 0x00000000 0 1 0 0 0 0x00000000 0x00000000
#17row-17145 0 0x00000001 0 1 0 0 0 0x00000000 0x00000000
#18row-18152 0 0x80000000 0 1 0 0 0 0x00000000 0x00000000
#19row-19159 0 0xFFFFFFFF 0 1 0 0 0 0x00000000 0x00000000
#20row-20168 0 0x00000000 1 1 1 1 1 0x00000001 0x00000001
#21row-21177 0 0x00000001 1 1 0 1 1 0x00000001 0x00000001
#22row-22184 0 0x80000000 1 1 0 0 1 0x00000001 0x00000000
#23row-23191 0 0xFFFFFFFF 1 1 0 0 1 0x00000001 0x00000000
#24row-24200 1 0x00000000 0 1 0 0 0 0x00000000 0x00000000
#25row-25209 1 0x00000001 0 1 0 0 0 0x00000000 0x00000000
#26row-26216 1 0x80000000 0 1 0 0 0 0x00000000 0x00000000
#27row-27223 1 0xFFFFFFFF 0 1 0 0 0 0x00000000 0x00000000
#28row-28232 1 0x00000000 1 1 1 1 0 0x00000000 0x00000001
#29row-29241 1 0x00000001 1 1 0 1 0 0x00000000 0x00000001
#30row-30248 1 0x80000000 1 1 0 0 0 0x00000000 0x00000000
#31row-31255 1 0xFFFFFFFF 1 1 0 0 0 0x00000000 0x00000000
#32row-32264 X 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0 X 0 0 0 0x00000000 0x00000000
#33row-33267 Z 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0 Z 0 0 0 0x00000000 0x00000000

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open ALU32CompareUnit

Tests

ALU32CompareUnitTest checks enable masking, zero, sign/overflow correction, and Boolean word outputs.

4.3.3.6. ALU32ResultSelector

IO pins

Pin Direction Width Description
ARITHMETIC_RESULT, AND_RESULT, OR_RESULT, XOR_RESULT, SHIFT_RESULT Input 32 each Operation-unit results
SLT_RESULT, SLTU_RESULT, A, B Input 32 each Comparison results and pass-through operands
LOCAL_OP Input 3 Index within a group
HIGH_HALF Input 1 Choose high group
OUT_OF_RANGE Input 1 Force zero
OUT Output 32 Selected word

Behavior

Low-group sources are arithmetic, arithmetic, AND, OR, XOR, shift, shift, shift. High-group sources are SLT, SLTU, A, B, zero, zero, zero, zero. OUT_OF_RANGE overrides both groups with zero. Inputs are independently meaningful even when no decoder is attached.

C++ example

namespace alu32_example {
uint32_t select(uint32_t arithmetic, uint32_t and_result, uint32_t or_result,
                uint32_t xor_result, uint32_t shifted, uint32_t slt, uint32_t sltu,
                uint32_t a, uint32_t b, unsigned local, bool high, bool invalid) {
    const std::array<uint32_t,8> low{arithmetic,arithmetic,and_result,or_result,xor_result,shifted,shifted,shifted};
    const std::array<uint32_t,8> upper{slt,sltu,a,b,0,0,0,0};
    return invalid ? 0 : (high ? upper : low).at(local);
}
}

Unknown inputs and timing

Known controls mask unselected paths; unknown controls follow the original mux gate equations. The decoded AND/OR network preserves those equations, including repeated arithmetic/shift choices with unknown selector bits. Outputs settle after gate propagation.

Implementation

Structural implementation

Parallel opcode minterms qualify nine result sources. BIT_0 through BIT_31 are expandable ALU32ResultBit slices: each masks the nine source bits and combines them with a balanced OR tree. Invalid operations select no source and produce zero. Selection has no serial mux chain or stored state. No behavioral implementation is registered for this helper.

RV32ILogicOptimizationTest compares this circuit with the former mux tree across all 1,024 four-state selector combinations, each with four data patterns (4,096 rows).

Examples

All 66 recorded rows of ALU32ResultSelectorTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (056387bf0a8256d0). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units AInput · 32 bit AND_RESULTInput · 32 bit ARITHMETIC_RESULTInput · 32 bit BInput · 32 bit HIGH_HALFInput · 1 bit LOCAL_OPInput · 3 bit OR_RESULTInput · 32 bit OUT_OF_RANGEInput · 1 bit SHIFT_RESULTInput · 32 bit SLTU_RESULTInput · 32 bit SLT_RESULTInput · 32 bit XOR_RESULTInput · 32 bit OUTExpected output · 32 bit
#0row-011 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x0 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x12345678
#1row-118 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x1 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x12345678
#2row-229 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x2 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x03254769
#3row-340 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x3 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x3016745A
#4row-451 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x4 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x2107654B
#5row-563 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x5 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x5670123C
#6row-676 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x6 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x5670123C
#7row-784 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x7 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x5670123C
#8row-895 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x0 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x4761032D
#9row-9106 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x1 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x7452301E
#10row-10117 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x2 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x6543210F
#11row-11128 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x3 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x9ABCDEF0
#12row-12135 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x4 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#13row-13140 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x5 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#14row-14145 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x6 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#15row-15150 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x7 0x3016745A 0 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#16row-16156 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x0 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#17row-17162 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x1 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#18row-18168 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x2 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#19row-19174 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x3 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#20row-20180 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x4 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#21row-21186 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x5 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#22row-22192 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x6 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#23row-23198 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 0 0x7 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#24row-24204 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x0 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#25row-25210 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x1 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#26row-26216 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x2 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#27row-27222 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x3 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#28row-28227 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x4 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#29row-29232 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x5 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#30row-30237 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x6 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#31row-31242 0x6543210F 0x03254769 0x12345678 0x9ABCDEF0 1 0x7 0x3016745A 1 0x5670123C 0x7452301E 0x4761032D 0x2107654B 0x00000000
#32row-32254 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x0 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xEDCBA987
#33row-33261 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x1 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xEDCBA987
#34row-34272 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x2 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xFCDAB896
#35row-35283 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x3 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xCFE98BA5
#36row-36294 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x4 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xDEF89AB4
#37row-37306 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x5 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xA98FEDC3
#38row-38319 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x6 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xA98FEDC3
#39row-39327 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x7 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xA98FEDC3
#40row-40338 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x0 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0xB89EFCD2
#41row-41349 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x1 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x8BADCFE1
#42row-42360 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x2 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x9ABCDEF0
#43row-43371 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x3 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x6543210F
#44row-44378 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x4 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#45row-45383 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x5 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#46row-46388 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x6 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#47row-47393 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x7 0xCFE98BA5 0 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#48row-48399 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x0 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#49row-49405 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x1 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#50row-50411 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x2 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#51row-51417 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x3 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#52row-52423 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x4 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#53row-53429 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x5 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#54row-54435 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x6 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#55row-55441 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 0 0x7 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#56row-56447 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x0 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#57row-57453 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x1 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#58row-58459 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x2 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#59row-59465 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x3 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#60row-60470 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x4 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#61row-61475 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x5 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#62row-62480 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x6 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#63row-63485 0x9ABCDEF0 0xFCDAB896 0xEDCBA987 0x6543210F 1 0x7 0xCFE98BA5 1 0xA98FEDC3 0x8BADCFE1 0xB89EFCD2 0xDEF89AB4 0x00000000
#64row-64491 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0 0x0 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 1 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0x00000000
#65row-65494 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0 0x0 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 1 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 0x00000000

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open ALU32ResultSelector

Tests

ALU32ResultSelectorTest checks all local indices and both group/override controls with distinguishable source words.

4.3.3.7. ALU32FlagUnit

IO pins

Pin Direction Width Description
RESULT Input 32 Selected final result
ARITHMETIC_ENABLE Input 1 Enables arithmetic flags
ARITH_CARRY, ARITH_OVERFLOW Input 1 each Shared adder flags
ZERO, NEGATIVE, CARRY_OUT, OVERFLOW Output 1 each Result and qualified arithmetic flags

Behavior

Zero and negative always describe the final result. Carry and overflow are passed only when enabled. Comparison flags do not belong to this block.

C++ example

namespace alu32_example {
struct Flags { bool ZERO, NEGATIVE, CARRY_OUT, OVERFLOW; };
Flags flags(uint32_t result, bool enable, bool carry, bool overflow) {
    return {result == 0, bool(result >> 31), enable && carry, enable && overflow};
}
}

Unknown inputs and timing

Negative directly exposes result bit 31, including Z; zero uses a gate reduction. Disabled carry/overflow are zero even if their arithmetic inputs are unknown.

Implementation

Structural implementation

ZeroDetect32, a SIGN_BIT rewire, and two AND gates implement the block. The rewire has one 32-bit input (RESULT) and one 1-bit output (SIGN), mapping only RESULT[31] to NEGATIVE; it does not expose 31 unused outputs. This is zero-delay routing, including for X and Z, rather than a logic gate. No behavioral implementation is registered for this helper.

Examples

All 42 recorded rows of ALU32FlagUnitTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (59427f8ce65a0ac4). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units ARITHMETIC_ENABLEInput · 1 bit ARITH_CARRYInput · 1 bit ARITH_OVERFLOWInput · 1 bit RESULTInput · 32 bit CARRY_OUTExpected output · 1 bit NEGATIVEExpected output · 1 bit OVERFLOWExpected output · 1 bit ZEROExpected output · 1 bit
#0row-07 0 0 0 0x00000000 0 0 0 1
#1row-115 0 0 0 0x00000001 0 0 0 0
#2row-222 0 0 0 0x80000000 0 1 0 0
#3row-329 0 0 0 0xFFFFFFFF 0 1 0 0
#4row-437 1 0 0 0x00000000 0 0 0 1
#5row-545 1 0 0 0x00000001 0 0 0 0
#6row-652 1 0 0 0x80000000 0 1 0 0
#7row-759 1 0 0 0xFFFFFFFF 0 1 0 0
#8row-867 0 1 0 0x00000000 0 0 0 1
#9row-975 0 1 0 0x00000001 0 0 0 0
#10row-1082 0 1 0 0x80000000 0 1 0 0
#11row-1189 0 1 0 0xFFFFFFFF 0 1 0 0
#12row-1297 1 1 0 0x00000000 1 0 0 1
#13row-13105 1 1 0 0x00000001 1 0 0 0
#14row-14112 1 1 0 0x80000000 1 1 0 0
#15row-15119 1 1 0 0xFFFFFFFF 1 1 0 0
#16row-16127 0 0 1 0x00000000 0 0 0 1
#17row-17135 0 0 1 0x00000001 0 0 0 0
#18row-18142 0 0 1 0x80000000 0 1 0 0
#19row-19149 0 0 1 0xFFFFFFFF 0 1 0 0
#20row-20157 1 0 1 0x00000000 0 0 1 1
#21row-21165 1 0 1 0x00000001 0 0 1 0
#22row-22172 1 0 1 0x80000000 0 1 1 0
#23row-23179 1 0 1 0xFFFFFFFF 0 1 1 0
#24row-24187 0 1 1 0x00000000 0 0 0 1
#25row-25195 0 1 1 0x00000001 0 0 0 0
#26row-26202 0 1 1 0x80000000 0 1 0 0
#27row-27209 0 1 1 0xFFFFFFFF 0 1 0 0
#28row-28217 1 1 1 0x00000000 1 0 1 1
#29row-29225 1 1 1 0x00000001 1 0 1 0
#30row-30232 1 1 1 0x80000000 1 1 1 0
#31row-31239 1 1 1 0xFFFFFFFF 1 1 1 0
#32row-32247 0 X X 0x00000000 0 0 0 1
#33row-33249 0 Z Z 0x00000000 0 0 0 1
#34row-34257 0 0 0 0b0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1 0 0 0 0
#35row-35264 0 0 0 0b1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1 0 1 0 0
#36row-36271 0 0 0 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1 0 X 0 0
#37row-37274 0 0 0 0bZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1 0 Z 0 0
#38row-38277 0 0 0 0b0ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1 0 0 0 0
#39row-39284 0 0 0 0b1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1 0 1 0 0
#40row-40291 0 0 0 0bXZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1 0 X 0 0
#41row-41294 0 0 0 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1 0 Z 0 0

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open ALU32FlagUnit

Tests

ALU32FlagUnitTest checks result classes, enable masking, carry/overflow combinations, and all four sign-bit values with unrelated lower bits set to X or Z. ALUHierarchyTest verifies the single-bit rewire's interface and exact bit mapping.

4.3.3.8. ALU32

IO pins

Pin Direction Width Description
A, B Input 32 each Operands
OP Input 5 Operation
OUT Output 32 Result
ZERO, NEGATIVE Output 1 each Result zero/sign
CARRY_OUT, OVERFLOW Output 1 each Qualified arithmetic flags
EQ, LT_SIGNED, LT_UNSIGNED Output 1 each Qualified subtraction comparisons

Behavior

OP Operation OUT Carry/overflow Comparison flags
0 ADD A + B Addition Zero
1 SUB A - B Subtraction Valid
2 AND A & B Zero Zero
3 OR A \| B Zero Zero
4 XOR A ^ B Zero Zero
5 SLL A << B[4:0] Zero Zero
6 SRL Logical A >> B[4:0] Zero Zero
7 SRA Arithmetic A >> B[4:0] Zero Zero
8 SLT Signed A < B, extended to 32 bits Subtraction Valid
9 SLTU Unsigned A < B, extended to 32 bits Subtraction Valid
10 PASS_A A Zero Zero
11 PASS_B B Zero Zero
12 ZERO 0 Zero Zero
13–31 Reserved 0 Zero Zero

For every opcode, ZERO = (OUT == 0) and NEGATIVE = OUT[31]. SLT/SLTU retain subtraction carry/overflow even though their final result is only zero or one. EQ is not an always-on operand-equality indicator. Branch instructions select SUB to obtain all three comparisons. Reserved operations produce ZERO=1, all other flags zero; instruction legality is the decoder's responsibility.

C++ example

namespace alu32_example {
struct Result {
    uint32_t OUT;
    bool ZERO, EQ, LT_SIGNED, LT_UNSIGNED, NEGATIVE, CARRY_OUT, OVERFLOW;
};
Result alu(uint32_t a, uint32_t b, unsigned op) {
    const auto c = control(op);
    const auto ar = addsub(a,b,c.SUB);
    const auto l = logic(a,b);
    const auto sh = shift(a,b,c.SHIFT_LEFT,c.SHIFT_ARITHMETIC);
    const auto cmp = compare(ar.OUT,ar.CARRY_OUT,ar.OVERFLOW,c.SUB);
    const auto out = select(ar.OUT,l.AND_OUT,l.OR_OUT,l.XOR_OUT,sh,
        cmp.SLT_RESULT,cmp.SLTU_RESULT,a,b,c.LOCAL_OP,c.HIGH_HALF,c.OUT_OF_RANGE);
    const auto f = flags(out,c.ARITHMETIC_ENABLE,ar.CARRY_OUT,ar.OVERFLOW);
    return {out,f.ZERO,cmp.EQ,cmp.LT_SIGNED,cmp.LT_UNSIGNED,f.NEGATIVE,f.CARRY_OUT,f.OVERFLOW};
}
}

Unknown inputs and timing

Structural gates can mask unused/unknown inputs. ALU32Behavioral instead makes all outputs unknown if any bit of A, B, or OP is nonbinary, including an unused operand. Its equivalence claim is settled binary behavior, not full four-state or transient equivalence. There is no clock: wait for propagation before sampling.

Implementation

Structural implementation

The root contains CONTROL, ARITHMETIC, LOGIC, SHIFT, COMPARE, RESULT_SELECT, and FLAGS. Arithmetic results feed comparison; control selects a result and qualifies flags. Each group can be expanded independently in the visualizer.

Behavioral implementation

ALU32Behavioral computes the selected operation and flags directly. When its delay twin agrees with that result, the catalog-selected part can use the current operands' gate-list settling time within its per-operation delay-table bound; an older pending result still retains publication order. If the twin cannot answer, the table supplies the timing. The registered contract is rv32i.alu32; structural remains available. Inside a structural ALU the arithmetic, logic, shift, and zero-detect units are always built from gates; each keeps its own behavioral form when used standalone.

Examples

All 46 recorded rows of ALU32Test, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (09507fc65276c4e8). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units AInput · 32 bit BInput · 32 bit OPInput · 5 bit CARRY_OUTExpected output · 1 bit EQExpected output · 1 bit LT_SIGNEDExpected output · 1 bit LT_UNSIGNEDExpected output · 1 bit NEGATIVEExpected output · 1 bit OUTExpected output · 32 bit OVERFLOWExpected output · 1 bit ZEROExpected output · 1 bit
#0row-032 0x00000001 0x00000002 0x00 0 0 0 0 0 0x00000003 0 0
#1row-166 0xFFFFFFFF 0x00000001 0x00 1 0 0 0 0 0x00000000 0 1
#2row-285 0xFFFFFFFF 0xFFFFFFFF 0x00 1 0 0 0 1 0xFFFFFFFE 0 0
#3row-3120 0x7FFFFFFF 0x00000001 0x00 0 0 0 0 1 0x80000000 1 0
#4row-4150 0x80000000 0x80000000 0x00 1 0 0 0 0 0x00000000 1 1
#5row-5184 0x00000005 0x00000005 0x01 1 1 0 0 0 0x00000000 0 1
#6row-6209 0x00000000 0x00000001 0x01 0 0 1 1 1 0xFFFFFFFF 0 0
#7row-7229 0x80000000 0x7FFFFFFF 0x01 1 0 1 0 0 0x00000001 1 0
#8row-8257 0x7FFFFFFF 0xFFFFFFFF 0x01 0 0 0 1 1 0x80000000 1 0
#9row-9285 0xF0F0F0F0 0x0FF00FF0 0x02 0 0 0 0 0 0x00F000F0 0 0
#10row-10301 0xF0F0F0F0 0x0FF00FF0 0x03 0 0 0 0 1 0xFFF0FFF0 0 0
#11row-11321 0xF0F0F0F0 0x0FF00FF0 0x04 0 0 0 0 1 0xFF00FF00 0 0
#12row-12350 0x00000001 0x0000001F 0x05 0 0 0 0 1 0x80000000 0 0
#13row-13378 0x00000001 0x00000020 0x05 0 0 0 0 0 0x00000001 0 0
#14row-14409 0x80000000 0x0000001F 0x06 0 0 0 0 0 0x00000001 0 0
#15row-15435 0x80000000 0x00000021 0x06 0 0 0 0 0 0x40000000 0 0
#16row-16459 0x80000000 0x0000001F 0x07 0 0 0 0 1 0xFFFFFFFF 0 0
#17row-17485 0x80000000 0x00000021 0x07 0 0 0 0 1 0xC0000000 0 0
#18row-18520 0xFFFFFFFF 0x00000001 0x08 1 0 1 0 0 0x00000001 0 0
#19row-19554 0x80000000 0x00000000 0x08 1 0 1 0 0 0x00000001 0 0
#20row-20588 0x7FFFFFFF 0x80000000 0x08 0 0 0 1 0 0x00000000 1 1
#21row-21619 0xFFFFFFFF 0x00000001 0x09 1 0 1 0 0 0x00000000 0 1
#22row-22649 0x00000000 0xFFFFFFFF 0x09 0 0 0 1 0 0x00000001 0 0
#23row-23671 0x7FFFFFFF 0x80000000 0x09 0 0 0 1 0 0x00000001 1 0
#24row-24695 0x12345678 0x9ABCDEF0 0x0A 0 0 0 0 0 0x12345678 0 0
#25row-25711 0x12345678 0x9ABCDEF0 0x0B 0 0 0 0 1 0x9ABCDEF0 0 0
#26row-26737 0x12345678 0x9ABCDEF0 0x0C 0 0 0 0 0 0x00000000 0 1
#27row-27743 0x12345678 0x9ABCDEF0 0x0D 0 0 0 0 0 0x00000000 0 1
#28row-28763 0x12345678 0x9ABCDEF0 0x0E 0 0 0 0 0 0x00000000 0 1
#29row-29769 0x12345678 0x9ABCDEF0 0x0F 0 0 0 0 0 0x00000000 0 1
#30row-30789 0x12345678 0x9ABCDEF0 0x10 0 0 0 0 0 0x00000000 0 1
#31row-31796 0x12345678 0x9ABCDEF0 0x11 0 0 0 0 0 0x00000000 0 1
#32row-32816 0x12345678 0x9ABCDEF0 0x12 0 0 0 0 0 0x00000000 0 1
#33row-33823 0x12345678 0x9ABCDEF0 0x13 0 0 0 0 0 0x00000000 0 1
#34row-34843 0x12345678 0x9ABCDEF0 0x14 0 0 0 0 0 0x00000000 0 1
#35row-35850 0x12345678 0x9ABCDEF0 0x15 0 0 0 0 0 0x00000000 0 1
#36row-36870 0x12345678 0x9ABCDEF0 0x16 0 0 0 0 0 0x00000000 0 1
#37row-37877 0x12345678 0x9ABCDEF0 0x17 0 0 0 0 0 0x00000000 0 1
#38row-38897 0x12345678 0x9ABCDEF0 0x18 0 0 0 0 0 0x00000000 0 1
#39row-39904 0x12345678 0x9ABCDEF0 0x19 0 0 0 0 0 0x00000000 0 1
#40row-40924 0x12345678 0x9ABCDEF0 0x1A 0 0 0 0 0 0x00000000 0 1
#41row-41931 0x12345678 0x9ABCDEF0 0x1B 0 0 0 0 0 0x00000000 0 1
#42row-42951 0x12345678 0x9ABCDEF0 0x1C 0 0 0 0 0 0x00000000 0 1
#43row-43957 0x12345678 0x9ABCDEF0 0x1D 0 0 0 0 0 0x00000000 0 1
#44row-44977 0x12345678 0x9ABCDEF0 0x1E 0 0 0 0 0 0x00000000 0 1
#45row-45983 0x12345678 0x9ABCDEF0 0x1F 0 0 0 0 0 0x00000000 0 1

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open ALU32

Tests

ALU32Test checks the integrated binary contract in both fidelities. ALU32RepresentativeSliceTest validates the lower-level construction. RV32IBuildingBlocksDocumentationTest compiles the C++ examples above and checks their outputs against declared binary test actions. Source implementations, including ALU32Behavioral, are in src/modules/composite/.

4.3.3.9. ALU32Core

IO pins

Pin Direction Width Description
A, B Input 32 each Operands
OP Input 5 Operation
OUT Output 32 Selected result
EQ, LT_SIGNED, LT_UNSIGNED Output 1 each Comparisons, valid for subtraction operations

Behavior

ALU32Core retains inputs A[32], B[32], OP[5] and outputs OUT[32], EQ, LT_SIGNED, and LT_UNSIGNED. It omits ZERO, NEGATIVE, CARRY_OUT, and OVERFLOW, so its structural hierarchy has no FLAGS child. The arithmetic unit still computes carry and overflow internally because signed comparison needs them. The general ALU32 retains all flags. Both variants use the same operation codes and settled binary result/compare rules. ALU32CoreTest checks the reduced interface in structural and behavioral fidelities against the same arithmetic vectors as ALU32Test.

C++ example

namespace alu32_example {
struct CoreResult {
    uint32_t OUT;
    bool EQ, LT_SIGNED, LT_UNSIGNED;
};
CoreResult core(uint32_t a, uint32_t b, unsigned op) {
    const auto r = alu(a, b, op);
    return {r.OUT, r.EQ, r.LT_SIGNED, r.LT_UNSIGNED};
}
}

Unknown inputs and timing

The structural form may mask unknown values in unused logic; the behavioral form returns unknown outputs if any bit of A, B, or OP is nonbinary. Their equivalence claim covers settled binary inputs. The unit is combinational and has no clock.

Implementation

Structural implementation

The CONTROL, ARITHMETIC, LOGIC, SHIFT, COMPARE, and RESULT_SELECT groups share the general ALU32 construction. There is no FLAGS group or externally connected flag storage.

Behavioral implementation

The rv32i.alu32-core family uses ALU32Behavioral in its reduced-interface mode. It computes the same result and comparisons as the general behavioral ALU but does not expose the four omitted flags.

Examples

All 46 recorded rows of ALU32CoreTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.

Default scenario profile: canonical-default-preview / structural (0eaa7ada9ecd34f2). Changing fidelity or the circuit can change these times.

Checkpointzero-based number · timeline label Timesimulator units AInput · 32 bit BInput · 32 bit OPInput · 5 bit EQExpected output · 1 bit LT_SIGNEDExpected output · 1 bit LT_UNSIGNEDExpected output · 1 bit OUTExpected output · 32 bit
#0row-026 0x00000001 0x00000002 0x00 0 0 0 0x00000003
#1row-155 0xFFFFFFFF 0x00000001 0x00 0 0 0 0x00000000
#2row-271 0xFFFFFFFF 0xFFFFFFFF 0x00 0 0 0 0xFFFFFFFE
#3row-3101 0x7FFFFFFF 0x00000001 0x00 0 0 0 0x80000000
#4row-4126 0x80000000 0x80000000 0x00 0 0 0 0x00000000
#5row-5155 0x00000005 0x00000005 0x01 1 0 0 0x00000000
#6row-6177 0x00000000 0x00000001 0x01 0 1 1 0xFFFFFFFF
#7row-7197 0x80000000 0x7FFFFFFF 0x01 0 1 0 0x00000001
#8row-8220 0x7FFFFFFF 0xFFFFFFFF 0x01 0 0 1 0x80000000
#9row-9248 0xF0F0F0F0 0x0FF00FF0 0x02 0 0 0 0x00F000F0
#10row-10259 0xF0F0F0F0 0x0FF00FF0 0x03 0 0 0 0xFFF0FFF0
#11row-11279 0xF0F0F0F0 0x0FF00FF0 0x04 0 0 0 0xFF00FF00
#12row-12303 0x00000001 0x0000001F 0x05 0 0 0 0x80000000
#13row-13324 0x00000001 0x00000020 0x05 0 0 0 0x00000001
#14row-14348 0x80000000 0x0000001F 0x06 0 0 0 0x00000001
#15row-15367 0x80000000 0x00000021 0x06 0 0 0 0x40000000
#16row-16389 0x80000000 0x0000001F 0x07 0 0 0 0xFFFFFFFF
#17row-17408 0x80000000 0x00000021 0x07 0 0 0 0xC0000000
#18row-18436 0xFFFFFFFF 0x00000001 0x08 0 1 0 0x00000001
#19row-19463 0x80000000 0x00000000 0x08 0 1 0 0x00000001
#20row-20490 0x7FFFFFFF 0x80000000 0x08 0 0 1 0x00000000
#21row-21514 0xFFFFFFFF 0x00000001 0x09 0 1 0 0x00000000
#22row-22537 0x00000000 0xFFFFFFFF 0x09 0 0 1 0x00000001
#23row-23559 0x7FFFFFFF 0x80000000 0x09 0 0 1 0x00000001
#24row-24583 0x12345678 0x9ABCDEF0 0x0A 0 0 0 0x12345678
#25row-25595 0x12345678 0x9ABCDEF0 0x0B 0 0 0 0x9ABCDEF0
#26row-26621 0x12345678 0x9ABCDEF0 0x0C 0 0 0 0x00000000
#27row-27627 0x12345678 0x9ABCDEF0 0x0D 0 0 0 0x00000000
#28row-28647 0x12345678 0x9ABCDEF0 0x0E 0 0 0 0x00000000
#29row-29653 0x12345678 0x9ABCDEF0 0x0F 0 0 0 0x00000000
#30row-30673 0x12345678 0x9ABCDEF0 0x10 0 0 0 0x00000000
#31row-31680 0x12345678 0x9ABCDEF0 0x11 0 0 0 0x00000000
#32row-32700 0x12345678 0x9ABCDEF0 0x12 0 0 0 0x00000000
#33row-33707 0x12345678 0x9ABCDEF0 0x13 0 0 0 0x00000000
#34row-34727 0x12345678 0x9ABCDEF0 0x14 0 0 0 0x00000000
#35row-35734 0x12345678 0x9ABCDEF0 0x15 0 0 0 0x00000000
#36row-36754 0x12345678 0x9ABCDEF0 0x16 0 0 0 0x00000000
#37row-37761 0x12345678 0x9ABCDEF0 0x17 0 0 0 0x00000000
#38row-38781 0x12345678 0x9ABCDEF0 0x18 0 0 0 0x00000000
#39row-39788 0x12345678 0x9ABCDEF0 0x19 0 0 0 0x00000000
#40row-40808 0x12345678 0x9ABCDEF0 0x1A 0 0 0 0x00000000
#41row-41815 0x12345678 0x9ABCDEF0 0x1B 0 0 0 0x00000000
#42row-42835 0x12345678 0x9ABCDEF0 0x1C 0 0 0 0x00000000
#43row-43841 0x12345678 0x9ABCDEF0 0x1D 0 0 0 0x00000000
#44row-44861 0x12345678 0x9ABCDEF0 0x1E 0 0 0 0x00000000
#45row-45867 0x12345678 0x9ABCDEF0 0x1F 0 0 0 0x00000000

Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.

Embedded simulation

Open ALU32Core

Tests

ALU32CoreTest checks structural and behavioral results against the same arithmetic vectors. RV32IBuildingBlocksDocumentationTest replays the binary examples against the C++ reference above.