• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
      • 100-theorems
      • Arithmetic
      • Bit-vectors
        • Sparseint
        • Bitops
        • Bv
          • Byte-to-bits
          • Bits-to-byte-little
          • Bits-to-byte
          • Byte-to-bits-little
          • Bvchop
            • Bvuminus
            • Bvplus
            • Bvminus
          • Ihs
          • Rtl
        • Algebra
      • Testing-utilities
    • Bv

    Bvchop

    Chop a value down to the given size.

    ;; Chop X down to its least significant SIZE bits.
    (defund bvchop (size x)
      (declare (xargs :guard (and (natp size)
                                  (integerp x))))
      (mbe :logic (mod (ifix x) (expt 2 (nfix size)))
           :exec (mod x (expt 2 size))))