Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Understanding BitFieldExtraction Operator bfe[][] #84

Open
prpr2770 opened this issue Jun 24, 2020 · 0 comments
Open

Understanding BitFieldExtraction Operator bfe[][] #84

prpr2770 opened this issue Jun 24, 2020 · 0 comments

Comments

@prpr2770
Copy link

prpr2770 commented Jun 24, 2020

I'm trying to encode and decode information in the following data structure

instance packetload : bit_vector(16)
instance bv3 : bit_vector(3)

    object arbitload2 = {

        object brick = {
            type this = struct {
                brick1 : packetload,       
                brick2 : bv3
            }
            instance idx : unbounded_sequence
            instance arr : array(idx,this)
        }


        variant this of arbitload = struct {
        
            block1      : packetload,    
            block2      : brick.arr   
            
        }
}

And I believe i need to use the BFE-operator. I couldn't find proper documentation about this, and I was wondering if I could get some help in understanding it.

From the file language.md I obtained the following description:

 `bfe[3][0]` is the bit field extraction operator the takes the low order 4 bits of a bit vector.

Further in an earlier issue here
bfe[0][7](enc) was used. I'm confused about the indexing that's provided.

May I have a description of this operator, and how it needs to be used, to extract information from a byte of data?
Should the byte be defined as bit_vector(8) or can it be described by bv[8]?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant