Signal Filtering

Posted by anonymous 16 months ago

Logistics Lookup

1.16 KB1.1.10498

Snapping

None

Size

6 x 3

Description

Green input = "data" Red input = "selector" Intermediate red wire: subtracts 2^31 from "data" values which are in the "selector". The max value of a signed 32-bit int is 2^31 - 1 so any positive number minus 2^31 is negative. Last combinator extracts negatives and subtracts 2^31 again, which cancels out the first subtraction: input x becomes (x - 2^31) in red then (x - 2^31 - 2^31) in output which equals x because of 32-bit integer arithmetic. Adding / subtracting 2^31 FLIPS the int "sign bit"

Preview

Blueprint preview

Contents

2
2
1
1
1