fn dim(&self, lsb: u8) -> i8 {
        (
            ( self.pmapi_repr << (32 - (lsb + 4)) ) as i32
            >> 28
        ) as i8
    }
/*
        We have a 4-bit value in two's complement form which we have to
        sign-extend to 8 bits. We first left shift our 4 bits in pmapi_repr
        to the most significant position, then do an arithmetic right shift
        to bring them to the least significant position in order to
        sign-extend the remaining 4 bits.

        In Rust, an arthimetic/logical right shift is performed depending on
        whether the integer is signed or unsigned. Hence, we cast our integer
        to an i32 before we right shift it.
    */
We have a 4-bit value in two's complement form which we have to
sign-extend to 8 bits. We first left shift our 4 bits in pmapi_repr
to the most significant position, then do an arithmetic right shift
to bring them to the least significant position in order to
sign-extend the remaining 4 bits.

In Rust, an arthimetic/logical right shift is performed depending on
whether the integer is signed or unsigned. Hence, we cast our integer
to an i32 before we right shift it.
We have a 4 - bit value in two ' s complement form which we have to sign - extend to 8 bits . We first left shift our 4 bits in pmapi_repr to the most significant position then do an arithmetic right shift to bring them to the least significant position in order to sign - extend the remaining 4 bits . In Rust an arthimetic / logical right shift is performed depending on whether the integer is signed or unsigned . Hence we cast our integer to an i32 before we right shift it .
fn dim(&self, lsb: u8) -> i8 {
        (
            ( self.pmapi_repr << (32 - (lsb + 4)) ) as i32
            >> 28
        ) as i8
    }
fn dim ( & self , lsb : u8 ) -> i8 { ( ( self . pmapi_repr << ( 32 - ( lsb + 4 ) ) ) as i32 >> 28 ) as i8 }
We have a 4-bit value in two's complement form which we have to
sign-extend to 8 bits.
We have a 4 - bit value in two ' s complement form which we have to sign - extend to 8 bits .
&self
lsb
u8